mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Added prototype make_cylinder()
This commit is contained in:
		
							parent
							
								
									3bb237deee
								
							
						
					
					
						commit
						b91b98b21e
					
				
					 5 changed files with 54 additions and 6 deletions
				
			
		|  | @ -60,7 +60,7 @@ sub new { | |||
|         }, | ||||
|         label_width => 100, | ||||
|     ); | ||||
|     my @options = ("box"); | ||||
|     my @options = ("box", "cylinder"); | ||||
|     $self->{type} = Wx::ComboBox->new($self, 1, "box", wxDefaultPosition, wxDefaultSize, \@options, wxCB_READONLY); | ||||
| 
 | ||||
|     $optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new( | ||||
|  |  | |||
|  | @ -342,14 +342,19 @@ sub on_btn_lambda { | |||
|     } | ||||
|     my $params = $dlg->ObjectParameter; | ||||
|     my $name = "lambda-".$params->{"type"}; | ||||
|     my $mesh = Slic3r::TriangleMesh->new(); | ||||
| 
 | ||||
|     my $new_volume = $self->{model_object}->add_volume(mesh => Slic3r::Test::mesh($params->{"type"}, dim=>$params->{"dim"}), material_id=>"generic"); | ||||
|     #TODO support non-boxes | ||||
|     if ($name eq "box") { | ||||
|         $mesh = $mesh->cube($params->{"dim"}[0], $params->{"dim"}[1], $params->{"dim"}[2]); | ||||
|     } elsif ($name eq "cylinder") { | ||||
|         $mesh = $mesh->cylinder($params->{"dim"}[0], $params->{"dim"}[1]); | ||||
|     } | ||||
| 
 | ||||
|     my $new_volume = $self->{model_object}->add_volume(mesh => $mesh); | ||||
|     $new_volume->set_modifier($is_modifier); | ||||
|     $new_volume->set_name($name); | ||||
| 
 | ||||
|     # apply the same translation we applied to the object | ||||
|     $new_volume->mesh->translate(@{$self->{model_object}->origin_translation}); | ||||
| 
 | ||||
|     # set a default extruder value, since user can't add it manually | ||||
|     $new_volume->config->set_ifndef('extruder', 0); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Joseph Lenox
						Joseph Lenox