mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	new cheaper constructor for DynamicPrintConfig from FullPrintConfig:
DynamicPrintConfig::full_print_config() new cheaper constructors of DynamicConfig / DynamicPrintConfig from ConfigBase Unit tests: ported test_model from upstream Slic3r, thanks @lordofhyphens Unit tests refactored to use less autos and initializer lists for readibility, DynamicPrintConfig is handled by value, not by shared pointer.
This commit is contained in:
		
							parent
							
								
									90d5712091
								
							
						
					
					
						commit
						69c8b1cd21
					
				
					 12 changed files with 190 additions and 107 deletions
				
			
		|  | @ -18,22 +18,22 @@ using namespace Slic3r; | |||
| SCENARIO("Extrusion width specifics", "[!mayfail]") { | ||||
|     GIVEN("A config with a skirt, brim, some fill density, 3 perimeters, and 1 bottom solid layer and a 20mm cube mesh") { | ||||
|         // this is a sharedptr
 | ||||
|         std::shared_ptr<DynamicPrintConfig> config(Slic3r::DynamicPrintConfig::new_from_defaults()); | ||||
|         config->opt_int("skirts") = 1; | ||||
|         config->opt_float("brim_width") = 2.; | ||||
|         config->opt_int("perimeters") = 3; | ||||
|         config->set_deserialize("fill_density", "40%"); | ||||
|         config->set_deserialize("first_layer_height", "100%"); | ||||
|         DynamicPrintConfig config = Slic3r::DynamicPrintConfig::full_print_config(); | ||||
|         config.opt_int("skirts") = 1; | ||||
|         config.opt_float("brim_width") = 2.; | ||||
|         config.opt_int("perimeters") = 3; | ||||
|         config.set_deserialize("fill_density", "40%"); | ||||
|         config.set_deserialize("first_layer_height", "100%"); | ||||
| 
 | ||||
|         WHEN("first layer width set to 2mm") { | ||||
|             Slic3r::Model model; | ||||
|             config->set_deserialize("first_layer_extrusion_width", "2"); | ||||
|             config.set_deserialize("first_layer_extrusion_width", "2"); | ||||
|             std::shared_ptr<Print> print = Slic3r::Test::init_print({TestMesh::cube_20x20x20}, model, config); | ||||
| 
 | ||||
|             std::vector<double> E_per_mm_bottom; | ||||
|             std::string gcode = Test::gcode(print); | ||||
|             Slic3r::GCodeReader parser; | ||||
|             const double layer_height = config->opt_float("layer_height"); | ||||
|             const double layer_height = config.opt_float("layer_height"); | ||||
|             parser.parse_buffer(gcode, [&E_per_mm_bottom, layer_height] (Slic3r::GCodeReader& self, const Slic3r::GCodeReader::GCodeLine& line) | ||||
|             {  | ||||
|                 if (self.z() == Approx(layer_height).margin(0.01)) { // only consider first layer
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 bubnikv
						bubnikv