mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Add free functions to slice a TriangleMesh
This commit is contained in:
		
							parent
							
								
									8604e19384
								
							
						
					
					
						commit
						514bb23c6c
					
				
					 1 changed files with 23 additions and 0 deletions
				
			
		|  | @ -198,6 +198,29 @@ private: | |||
|     void make_expolygons(std::vector<IntersectionLine> &lines, const float closing_radius, ExPolygons* slices) const; | ||||
| }; | ||||
| 
 | ||||
| inline void slice_mesh( | ||||
|     const TriangleMesh &                              mesh, | ||||
|     const std::vector<float> &                        z, | ||||
|     std::vector<Polygons> &                           layers, | ||||
|     TriangleMeshSlicer::throw_on_cancel_callback_type thr = nullptr) | ||||
| { | ||||
|     if (mesh.empty()) return; | ||||
|     TriangleMeshSlicer slicer(&mesh); | ||||
|     slicer.slice(z, &layers, thr); | ||||
| } | ||||
| 
 | ||||
| inline void slice_mesh( | ||||
|     const TriangleMesh &                              mesh, | ||||
|     const std::vector<float> &                        z, | ||||
|     std::vector<ExPolygons> &                         layers, | ||||
|     float                                             closing_radius, | ||||
|     TriangleMeshSlicer::throw_on_cancel_callback_type thr = nullptr) | ||||
| { | ||||
|     if (mesh.empty()) return; | ||||
|     TriangleMeshSlicer slicer(&mesh); | ||||
|     slicer.slice(z, closing_radius, &layers, thr); | ||||
| } | ||||
| 
 | ||||
| TriangleMesh make_cube(double x, double y, double z); | ||||
| 
 | ||||
| // Generate a TriangleMesh of a cylinder
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 tamasmeszaros
						tamasmeszaros