mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Working curve approximation of the concave hull with clipper offset.
This commit is contained in:
		
							parent
							
								
									fbe415f88e
								
							
						
					
					
						commit
						f297da0d01
					
				
					 8 changed files with 243 additions and 694 deletions
				
			
		
							
								
								
									
										49
									
								
								src/slabasebed.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								src/slabasebed.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,49 @@ | |||
| #include <iostream> | ||||
| #include <string> | ||||
| 
 | ||||
| #include <libslic3r.h> | ||||
| #include "TriangleMesh.hpp" | ||||
| #include "SLABasePool.hpp" | ||||
| #include "benchmark.h" | ||||
| 
 | ||||
| const std::string USAGE_STR = { | ||||
|     "Usage: slabasebed stlfilename.stl" | ||||
| }; | ||||
| 
 | ||||
| void confess_at(const char * /*file*/, | ||||
|                 int /*line*/, | ||||
|                 const char * /*func*/, | ||||
|                 const char * /*pat*/, | ||||
|                 ...) {} | ||||
| 
 | ||||
| int main(const int argc, const char *argv[]) { | ||||
|     using namespace Slic3r; | ||||
|     using std::cout; using std::endl; | ||||
| 
 | ||||
|     if(argc < 2) { | ||||
|         cout << USAGE_STR << endl; | ||||
|         return EXIT_SUCCESS; | ||||
|     } | ||||
| 
 | ||||
|     TriangleMesh model; | ||||
|     Benchmark bench; | ||||
| 
 | ||||
|     model.ReadSTLFile(argv[1]); | ||||
|     model.align_to_origin(); | ||||
| 
 | ||||
|     ExPolygons ground_slice; | ||||
|     TriangleMesh basepool; | ||||
| 
 | ||||
|     sla::ground_layer(model, ground_slice, 0.1f); | ||||
| 
 | ||||
|     bench.start(); | ||||
|     sla::create_base_pool(ground_slice, basepool); | ||||
|     bench.stop(); | ||||
| 
 | ||||
|     cout << "Base pool creation time: " << std::setprecision(10) | ||||
|          << bench.getElapsedSec() << " seconds." << endl; | ||||
| 
 | ||||
|     basepool.write_ascii("out.stl"); | ||||
| 
 | ||||
|     return EXIT_SUCCESS; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 tamasmeszaros
						tamasmeszaros