FIX: fix some rendering issues

1. increase the logo's resolution
2. set the logo's height to 0.02
3. fix a clip issue when shell preview

Change-Id: Ibd2491c2d4cc38ab10a2627f0024712d0a6a09b2
This commit is contained in:
lane.wei 2022-07-27 19:45:05 +08:00 committed by Lane.Wei
parent 77afdc6467
commit 461eaa13aa
2 changed files with 3 additions and 3 deletions

View File

@ -1070,7 +1070,6 @@ void GCodeViewer::reset()
}
m_paths_bounding_box = BoundingBoxf3();
m_max_bounding_box = BoundingBoxf3();
m_shell_bounding_box = BoundingBoxf3();
m_max_print_height = 0.0f;
m_tools.m_tool_colors = std::vector<Color>();
m_tools.m_tool_visibles = std::vector<bool>();

View File

@ -385,7 +385,8 @@ void PartPlate::render_logo(bool bottom) const
// starts generating the main texture, compression will run asynchronously
GLint max_tex_size = OpenGLManager::get_gl_info().get_max_tex_size();
if (!m_partplate_list->m_logo_texture.load_from_svg_file(m_partplate_list->m_logo_texture_filename, true, true, true, max_tex_size/8)) {
GLint logo_tex_size = (max_tex_size < 2048)?max_tex_size: 2048;
if (!m_partplate_list->m_logo_texture.load_from_svg_file(m_partplate_list->m_logo_texture_filename, true, true, true, logo_tex_size)) {
BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": load logo texture from %1% failed!")%m_partplate_list->m_logo_texture_filename;
return;
}
@ -1838,7 +1839,7 @@ bool PartPlate::set_shape(const Pointfs& shape, const Pointfs& exclude_areas, Ve
ExPolygon logo_poly;
generate_logo_polygon(logo_poly);
if (!m_logo_triangles.set_from_triangles(triangulate_expolygon_2f(logo_poly, NORMALS_UP), GROUND_Z+0.28f))
if (!m_logo_triangles.set_from_triangles(triangulate_expolygon_2f(logo_poly, NORMALS_UP), GROUND_Z+0.02f))
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ":Unable to create plate triangles\n";
ExPolygon poly;