mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Fixed shifted clippimg plane triangulation on scaled meshes,
fighting z-fighting has to be done in world coords.
This commit is contained in:
		
							parent
							
								
									8dfc0422a8
								
							
						
					
					
						commit
						d9f2fd7501
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		|  | @ -106,7 +106,6 @@ void MeshClipper::recalculate_triangles() | |||
|     Transform3d tr = Transform3d::Identity(); | ||||
|     tr.rotate(q); | ||||
|     tr = m_trafo.get_matrix() * tr; | ||||
|     height_mesh += 0.001f; // to avoid z-fighting
 | ||||
| 
 | ||||
|     if (m_limiting_plane != ClippingPlane::ClipsNothing()) | ||||
|     { | ||||
|  | @ -165,6 +164,8 @@ void MeshClipper::recalculate_triangles() | |||
| 
 | ||||
|     m_triangles2d = triangulate_expolygons_2f(expolys, m_trafo.get_matrix().matrix().determinant() < 0.); | ||||
| 
 | ||||
|     tr.pretranslate(0.001 * m_plane.get_normal().normalized()); // to avoid z-fighting
 | ||||
| 
 | ||||
|     m_vertex_array.release_geometry(); | ||||
|     for (auto it=m_triangles2d.cbegin(); it != m_triangles2d.cend(); it=it+3) { | ||||
|         m_vertex_array.push_geometry(tr * Vec3d((*(it+0))(0), (*(it+0))(1), height_mesh), up); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lukas Matena
						Lukas Matena