mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	SlaSupports gizmo - show holes position even when user did not Preview the drilled mesh
This commit is contained in:
		
							parent
							
								
									49c5822be4
								
							
						
					
					
						commit
						58b5e75a9c
					
				
					 3 changed files with 9 additions and 4 deletions
				
			
		|  | @ -358,12 +358,14 @@ bool CommonGizmosData::update_from_backend(GLCanvas3D& canvas, ModelObject* mode | |||
|             m_backend_mesh_transformed = po->get_mesh_to_print(); | ||||
|             m_backend_mesh_transformed.transform(canvas.sla_print()->sla_trafo(*m_model_object).inverse()); | ||||
|             m_mesh = &m_backend_mesh_transformed; | ||||
|             m_has_drilled_mesh = true; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     if (! m_mesh) { | ||||
|         m_mesh = &m_model_object->volumes.front()->mesh(); | ||||
|         m_backend_mesh_transformed.clear(); | ||||
|         m_has_drilled_mesh = false; | ||||
|     } | ||||
| 
 | ||||
|     m_model_object_id = m_model_object->id(); | ||||
|  |  | |||
|  | @ -227,10 +227,13 @@ public: | |||
|         m_clipping_plane_distance = m_clipping_plane_distance_stash; | ||||
|     } | ||||
| 
 | ||||
|     bool has_drilled_mesh() const { return m_has_drilled_mesh; } | ||||
| 
 | ||||
| private: | ||||
|     const TriangleMesh* m_old_mesh; | ||||
|     TriangleMesh m_backend_mesh_transformed; | ||||
|     float m_clipping_plane_distance_stash = 0.f; | ||||
|     bool m_has_drilled_mesh = false; | ||||
| }; | ||||
| 
 | ||||
| } // namespace GUI
 | ||||
|  |  | |||
|  | @ -335,7 +335,7 @@ void GLGizmoSlaSupports::render_points(const Selection& selection, bool picking) | |||
|     } | ||||
| 
 | ||||
|     // Now render the drain holes:
 | ||||
|     /*if (! m_c->m_cavity_mesh) {
 | ||||
|     if (! m_c->has_drilled_mesh()) { | ||||
|         render_color[0] = 0.7f; | ||||
|         render_color[1] = 0.7f; | ||||
|         render_color[2] = 0.7f; | ||||
|  | @ -370,7 +370,7 @@ void GLGizmoSlaSupports::render_points(const Selection& selection, bool picking) | |||
|                 glFrontFace(GL_CCW); | ||||
|             glsafe(::glPopMatrix()); | ||||
|         } | ||||
|     }*/ | ||||
|     } | ||||
| 
 | ||||
|     if (!picking) | ||||
|         glsafe(::glDisable(GL_LIGHTING)); | ||||
|  | @ -414,14 +414,14 @@ bool GLGizmoSlaSupports::unproject_on_mesh(const Vec2d& mouse_pos, std::pair<Vec | |||
|         // In case the hollowed and drilled mesh is available, we can allow
 | ||||
|         // placing points in holes, because they should never end up
 | ||||
|         // on surface that's been drilled away.
 | ||||
|         /*if (! m_c->m_cavity_mesh) {
 | ||||
|         if (! m_c->has_drilled_mesh()) { | ||||
|             for (const sla::DrainHole& hole : m_c->m_model_object->sla_drain_holes) { | ||||
|                 if (hole.is_inside(hit)) { | ||||
|                     in_hole = true; | ||||
|                     break; | ||||
|                 } | ||||
|             } | ||||
|         }*/ | ||||
|         } | ||||
|         if (! in_hole) { | ||||
|             // Return both the point and the facet normal.
 | ||||
|             pos_and_normal = std::make_pair(hit, normal); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lukas Matena
						Lukas Matena