mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Merge remote-tracking branch 'origin/master' into updating
This commit is contained in:
		
						commit
						4131a92cec
					
				
					 11 changed files with 82 additions and 30 deletions
				
			
		|  | @ -1,18 +1,22 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <!-- | ||||
|   This file is autogenerated by CMake | ||||
|   Note: In the .in template file, the $ {}-style variables are interpreted by CMake while the $()-style variables belong to MSVC | ||||
| --> | ||||
| <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||||
|   <ImportGroup Label="PropertySheets"> | ||||
|   </ImportGroup> | ||||
|   <PropertyGroup Label="UserMacros" /> | ||||
|   <PropertyGroup> | ||||
|     <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(FxCopDir);$(PATH);c:\wperl64d\bin\;</ExecutablePath> | ||||
|     <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(FxCopDir);$(PATH);${PROPS_PERL_BIN_PATH}\;</ExecutablePath> | ||||
|   </PropertyGroup> | ||||
|   <ItemDefinitionGroup /> | ||||
|   <ItemGroup /> | ||||
| 
 | ||||
|   <PropertyGroup> | ||||
|     <LocalDebuggerCommand>C:\wperl64d\bin\perl.exe</LocalDebuggerCommand> | ||||
|     <LocalDebuggerCommand>${PROPS_PERL_EXECUTABLE}</LocalDebuggerCommand> | ||||
|     <LocalDebuggerCommandArguments>slic3r.pl</LocalDebuggerCommandArguments> | ||||
|     <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> | ||||
|     <LocalDebuggerWorkingDirectory>..\..</LocalDebuggerWorkingDirectory> | ||||
|     <LocalDebuggerWorkingDirectory>${PROPS_CMAKE_SOURCE_DIR}</LocalDebuggerWorkingDirectory> | ||||
|   </PropertyGroup> | ||||
| </Project> | ||||
|  | @ -1152,7 +1152,11 @@ sub InitGL { | |||
|     $self->volumes->finalize_geometry(1)  | ||||
|         if ($^O eq 'linux' && $self->UseVBOs); | ||||
| 
 | ||||
|     $self->zoom_to_bed; | ||||
|     if (scalar @{$self->volumes} > 0) { | ||||
|         $self->zoom_to_volumes; | ||||
|     } else { | ||||
|         $self->zoom_to_bed; | ||||
|     }     | ||||
|          | ||||
|     glClearColor(0, 0, 0, 1); | ||||
|     glColor3f(1, 0, 0); | ||||
|  |  | |||
|  | @ -1809,8 +1809,7 @@ sub list_item_deselected { | |||
|     if ($self->{list}->GetFirstSelected == -1) { | ||||
|         $self->select_object(undef); | ||||
|         $self->{canvas}->Refresh; | ||||
|         #FIXME VBOs are being refreshed just to change a selection color? | ||||
|         $self->{canvas3D}->reload_scene if $self->{canvas3D}; | ||||
|         $self->{canvas3D}->deselect_volumes if $self->{canvas3D}; | ||||
|     } | ||||
|     undef $self->{_lecursor}; | ||||
| } | ||||
|  | @ -1822,8 +1821,7 @@ sub list_item_selected { | |||
|     my $obj_idx = $event->GetIndex; | ||||
|     $self->select_object($obj_idx); | ||||
|     $self->{canvas}->Refresh; | ||||
|     #FIXME VBOs are being refreshed just to change a selection color? | ||||
|     $self->{canvas3D}->reload_scene if $self->{canvas3D}; | ||||
|     $self->{canvas3D}->update_volumes_selection if $self->{canvas3D}; | ||||
|     undef $self->{_lecursor}; | ||||
| } | ||||
| 
 | ||||
|  | @ -2016,7 +2014,14 @@ sub selection_changed { | |||
| sub select_object { | ||||
|     my ($self, $obj_idx) = @_; | ||||
| 
 | ||||
|     $_->selected(0) for @{ $self->{objects} }; | ||||
|     # remove current selection | ||||
|     foreach my $o (0..$#{$self->{objects}}) { | ||||
|         $PreventListEvents = 1; | ||||
|         $self->{objects}->[$o]->selected(0); | ||||
|         $self->{list}->Select($o, 0); | ||||
|         $PreventListEvents = 0; | ||||
|     } | ||||
|      | ||||
|     if (defined $obj_idx) { | ||||
|         $self->{objects}->[$obj_idx]->selected(1); | ||||
|         # We use this flag to avoid circular event handling | ||||
|  |  | |||
|  | @ -32,6 +32,8 @@ sub new { | |||
|     $self->{on_instances_moved} = sub {}; | ||||
|     $self->{on_wipe_tower_moved} = sub {}; | ||||
| 
 | ||||
|     $self->{objects_volumes_idxs} = (); | ||||
|          | ||||
|     $self->on_select(sub { | ||||
|         my ($volume_idx) = @_; | ||||
|         $self->{on_select_object}->(($volume_idx == -1) ? undef : $self->volumes->[$volume_idx]->object_idx) | ||||
|  | @ -181,6 +183,17 @@ sub set_on_enable_action_buttons { | |||
|     $self->on_enable_action_buttons($cb); | ||||
| } | ||||
| 
 | ||||
| sub update_volumes_selection { | ||||
|     my ($self) = @_; | ||||
| 
 | ||||
|     foreach my $obj_idx (0..$#{$self->{model}->objects}) { | ||||
|         if ($self->{objects}[$obj_idx]->selected) { | ||||
|             my @volume_idxs = @{$self->{objects_volumes_idxs}[$obj_idx]}; | ||||
|             $self->select_volume($_) for @volume_idxs; | ||||
|         } | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| sub reload_scene { | ||||
|     my ($self, $force) = @_; | ||||
| 
 | ||||
|  | @ -194,12 +207,14 @@ sub reload_scene { | |||
| 
 | ||||
|     $self->{reload_delayed} = 0; | ||||
| 
 | ||||
|     $self->{objects_volumes_idxs} = ();     | ||||
|     foreach my $obj_idx (0..$#{$self->{model}->objects}) { | ||||
|         my @volume_idxs = $self->load_object($self->{model}, $self->{print}, $obj_idx); | ||||
|         if ($self->{objects}[$obj_idx]->selected) { | ||||
|             $self->select_volume($_) for @volume_idxs; | ||||
|         } | ||||
|         push(@{$self->{objects_volumes_idxs}}, \@volume_idxs); | ||||
|     } | ||||
|      | ||||
|     $self->update_volumes_selection; | ||||
|          | ||||
|     if (defined $self->{config}->nozzle_diameter) { | ||||
|         # Should the wipe tower be visualized? | ||||
|         my $extruders_count = scalar @{ $self->{config}->nozzle_diameter }; | ||||
|  |  | |||
|  | @ -116,7 +116,6 @@ sub new { | |||
|         $canvas->set_auto_bed_shape; | ||||
|         $canvas->SetSize([500,500]); | ||||
|         $canvas->SetMinSize($canvas->GetSize); | ||||
|         $canvas->zoom_to_volumes; | ||||
|     } | ||||
|      | ||||
|     $self->{sizer} = Wx::BoxSizer->new(wxHORIZONTAL); | ||||
|  |  | |||
|  | @ -163,7 +163,6 @@ sub new { | |||
|         $canvas->set_auto_bed_shape; | ||||
|         $canvas->SetSize([500,700]); | ||||
|         $canvas->update_volumes_colors_by_extruder($self->GetParent->GetParent->GetParent->{config}); | ||||
|         $canvas->zoom_to_volumes; | ||||
|     } | ||||
|      | ||||
|     $self->{sizer} = Wx::BoxSizer->new(wxHORIZONTAL); | ||||
|  |  | |||
|  | @ -665,7 +665,12 @@ endif () | |||
| 
 | ||||
| if (MSVC) | ||||
|     # Here we associate some additional properties with the MSVC project to enable compilation and debugging out of the box. | ||||
|     set_target_properties(XS PROPERTIES VS_USER_PROPS "${PROJECT_SOURCE_DIR}/cmake/msvc/xs.wperl64d.props") | ||||
|     get_filename_component(PROPS_PERL_BIN_PATH "${PERL_EXECUTABLE}" DIRECTORY) | ||||
|     string(REPLACE "/" "\\" PROPS_PERL_BIN_PATH "${PROPS_PERL_BIN_PATH}") | ||||
|     string(REPLACE "/" "\\" PROPS_PERL_EXECUTABLE "${PERL_EXECUTABLE}") | ||||
|     string(REPLACE "/" "\\" PROPS_CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}") | ||||
|     configure_file("${PROJECT_SOURCE_DIR}/cmake/msvc/xs.wperl.props.in" "${CMAKE_BINARY_DIR}/xs.wperl.props" NEWLINE_STYLE CRLF) | ||||
|     set_target_properties(XS PROPERTIES VS_USER_PROPS "${CMAKE_BINARY_DIR}/xs.wperl.props") | ||||
| endif() | ||||
| 
 | ||||
| # l10n | ||||
|  |  | |||
|  | @ -269,6 +269,10 @@ TriangleMesh Model::mesh() const | |||
| 
 | ||||
| static bool _arrange(const Pointfs &sizes, coordf_t dist, const BoundingBoxf* bb, Pointfs &out) | ||||
| { | ||||
|     if (sizes.empty()) | ||||
|         // return if the list is empty or the following call to BoundingBoxf constructor will lead to a crash
 | ||||
|         return true; | ||||
| 
 | ||||
|     // we supply unscaled data to arrange()
 | ||||
|     bool result = Slic3r::Geometry::arrange( | ||||
|         sizes.size(),               // number of parts
 | ||||
|  |  | |||
|  | @ -598,10 +598,10 @@ std::string Print::validate() const | |||
|             return "The Wipe Tower is currently only supported with the relative extruder addressing (use_relative_e_distances=1)."; | ||||
|         SlicingParameters slicing_params0 = this->objects.front()->slicing_parameters(); | ||||
| 
 | ||||
|         const PrintObject* most_layered_object = this->objects.front(); // object with highest layer_height_profile.size() encountered so far
 | ||||
|         const PrintObject* tallest_object = this->objects.front(); // let's find the tallest object
 | ||||
|         for (const auto* object : objects) | ||||
|             if (object->layer_height_profile.size() > most_layered_object->layer_height_profile.size()) | ||||
|                 most_layered_object = object; | ||||
|             if (*(object->layer_height_profile.end()-2) > *(tallest_object->layer_height_profile.end()-2) ) | ||||
|                     tallest_object = object; | ||||
| 
 | ||||
|         for (PrintObject *object : this->objects) { | ||||
|             SlicingParameters slicing_params = object->slicing_parameters(); | ||||
|  | @ -618,17 +618,26 @@ std::string Print::validate() const | |||
|             object->update_layer_height_profile(); | ||||
|             object->layer_height_profile_valid = was_layer_height_profile_valid; | ||||
| 
 | ||||
|             if ( this->config.variable_layer_height ) { | ||||
|                 int i = 0; | ||||
|                 while ( i < object->layer_height_profile.size() ) { | ||||
|                     if (std::abs(most_layered_object->layer_height_profile[i] - object->layer_height_profile[i]) > EPSILON) | ||||
|                         return "The Wipe tower is only supported if all objects have the same layer height profile"; | ||||
|                     ++i; | ||||
|                     if (i == object->layer_height_profile.size()-2) // this element contains the objects max z, if the other object is taller,
 | ||||
|                                                                     // it does not have to match - we will step over it
 | ||||
|                         if (most_layered_object->layer_height_profile[i] > object->layer_height_profile[i]) | ||||
|                             ++i; | ||||
|             if ( this->config.variable_layer_height ) { // comparing layer height profiles
 | ||||
|                 bool failed = false; | ||||
|                 if (tallest_object->layer_height_profile.size() >= object->layer_height_profile.size() ) { | ||||
|                     int i = 0; | ||||
|                     while ( i < object->layer_height_profile.size() && i < tallest_object->layer_height_profile.size()) { | ||||
|                         if (std::abs(tallest_object->layer_height_profile[i] - object->layer_height_profile[i])) { | ||||
|                             failed = true; | ||||
|                             break; | ||||
|                         } | ||||
|                         ++i; | ||||
|                         if (i == object->layer_height_profile.size()-2) // this element contains this objects max z
 | ||||
|                             if (tallest_object->layer_height_profile[i] > object->layer_height_profile[i]) // the difference does not matter in this case
 | ||||
|                                 ++i; | ||||
|                     } | ||||
|                 } | ||||
|                 else | ||||
|                     failed = true; | ||||
| 
 | ||||
|                 if (failed) | ||||
|                     return "The Wipe tower is only supported if all objects have the same layer height profile"; | ||||
|             } | ||||
| 
 | ||||
|             /*for (size_t i = 5; i < object->layer_height_profile.size(); i += 2)
 | ||||
|  |  | |||
|  | @ -4,6 +4,8 @@ | |||
| #include <utility> | ||||
| #include <unordered_map> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| 
 | ||||
| #include <wx/settings.h> | ||||
| #include <wx/stattext.h> | ||||
| #include <wx/textctrl.h> | ||||
|  | @ -741,9 +743,12 @@ void ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese | |||
| 		if (install_bundles.size() > 0) { | ||||
| 			// Install bundles from resources.
 | ||||
| 			updater->install_bundles_rsrc(std::move(install_bundles), snapshot); | ||||
| 		} else { | ||||
| 			BOOST_LOG_TRIVIAL(info) << "No bundles need to be installed from resources"; | ||||
| 		} | ||||
| 
 | ||||
| 		if (page_welcome->reset_user_profile()) { | ||||
| 			BOOST_LOG_TRIVIAL(info) << "Resetting user profiles..."; | ||||
| 			preset_bundle->reset(true); | ||||
| 		} | ||||
| 
 | ||||
|  | @ -828,10 +833,13 @@ ConfigWizard::~ConfigWizard() {} | |||
| 
 | ||||
| bool ConfigWizard::run(PresetBundle *preset_bundle, const PresetUpdater *updater) | ||||
| { | ||||
| 	BOOST_LOG_TRIVIAL(info) << "Running ConfigWizard, reason: " << p->run_reason; | ||||
| 	if (ShowModal() == wxID_OK) { | ||||
| 		p->apply_config(GUI::get_app_config(), preset_bundle, updater); | ||||
| 		BOOST_LOG_TRIVIAL(info) << "ConfigWizard applied"; | ||||
| 		return true; | ||||
| 	} else { | ||||
| 		BOOST_LOG_TRIVIAL(info) << "ConfigWizard cancelled"; | ||||
| 		return false; | ||||
| 	} | ||||
| } | ||||
|  |  | |||
|  | @ -1312,7 +1312,7 @@ void TabFilament::build() | |||
| 		}; | ||||
| 		optgroup->append_line(line); | ||||
| 
 | ||||
|         optgroup = page->new_optgroup(_(L("Toolchange behaviour"))); | ||||
|         optgroup = page->new_optgroup(_(L("Toolchange parameters with single extruder MM printers"))); | ||||
| 		optgroup->append_single_option_line("filament_loading_speed"); | ||||
|         optgroup->append_single_option_line("filament_unloading_speed"); | ||||
|         optgroup->append_single_option_line("filament_toolchange_delay"); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 YuSanka
						YuSanka