mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Fix regression in --complete-objects causing fatal error and/or wrong warnings about object heights
This commit is contained in:
		
							parent
							
								
									b71bc37111
								
							
						
					
					
						commit
						5843f5df6c
					
				
					 1 changed files with 10 additions and 13 deletions
				
			
		|  | @ -188,10 +188,16 @@ sub validate { | |||
|          | ||||
|         # check vertical clearance | ||||
|         { | ||||
|             my @obj_copies = $self->object_copies; | ||||
|             pop @obj_copies;  # ignore the last copy: its height doesn't matter | ||||
|             my $scaled_clearance = scale $Slic3r::Config->extruder_clearance_height; | ||||
|             if (grep { +($_->size)[Z] > $scaled_clearance } map @{$self->objects->[$_->[0]]->meshes}, @obj_copies) { | ||||
|             my @object_height = (); | ||||
|             foreach my $object (@{$self->objects}) { | ||||
|                 my $height = $object->size->[Z]; | ||||
|                 push @object_height, $height for @{$object->copies}; | ||||
|             } | ||||
|             @object_height = sort { $a <=> $b } @object_height; | ||||
|             # ignore the tallest *copy* (this is why we repeat height for all of them): | ||||
|             # it will be printed as last one so its height doesn't matter | ||||
|             pop @object_height; | ||||
|             if (max(@object_height) > scale $Slic3r::Config->extruder_clearance_height) { | ||||
|                 die "Some objects are too tall and cannot be printed without extruder collisions.\n"; | ||||
|             } | ||||
|         } | ||||
|  | @ -265,15 +271,6 @@ sub init_extruders { | |||
|     } | ||||
| } | ||||
| 
 | ||||
| sub object_copies { | ||||
|     my $self = shift; | ||||
|     my @oc = (); | ||||
|     for my $obj_idx (0 .. $#{$self->objects}) { | ||||
|         push @oc, map [ $obj_idx, $_ ], @{$self->objects->[$obj_idx]->copies}; | ||||
|     } | ||||
|     return @oc; | ||||
| } | ||||
| 
 | ||||
| sub layer_count { | ||||
|     my $self = shift; | ||||
|     return max(map { scalar @{$_->layers} } @{$self->objects}); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alessandro Ranellucci
						Alessandro Ranellucci