mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Merge branch 'sapir-modelcpp'
This commit is contained in:
		
						commit
						6e207d3830
					
				
					 17 changed files with 911 additions and 222 deletions
				
			
		| 
						 | 
				
			
			@ -10,7 +10,7 @@ use Slic3r::Print::State ':steps';
 | 
			
		|||
use Slic3r::Surface ':types';
 | 
			
		||||
 | 
			
		||||
has 'print'             => (is => 'ro', weak_ref => 1, required => 1);
 | 
			
		||||
has 'model_object'      => (is => 'ro', required => 1);
 | 
			
		||||
has 'model_object'      => (is => 'ro', required => 1);  # caller is responsible for holding the Model object
 | 
			
		||||
has 'region_volumes'    => (is => 'rw', default => sub { [] });  # by region_id
 | 
			
		||||
has 'copies'            => (is => 'ro');  # Slic3r::Point objects in scaled G-code coordinates
 | 
			
		||||
has 'config'            => (is => 'ro', default => sub { Slic3r::Config::PrintObject->new });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,15 +44,15 @@ sub set_model {
 | 
			
		|||
    my ($self, $model) = @_;
 | 
			
		||||
    
 | 
			
		||||
    # make method idempotent so that the object is reusable
 | 
			
		||||
    $self->_print->delete_all_objects;
 | 
			
		||||
    $self->_print->clear_objects;
 | 
			
		||||
    
 | 
			
		||||
    # make sure all objects have at least one defined instance
 | 
			
		||||
    my $need_arrange = $model->add_default_instances;
 | 
			
		||||
    
 | 
			
		||||
    # apply scaling and rotation supplied from command line if any
 | 
			
		||||
    foreach my $instance (map @{$_->instances}, @{$model->objects}) {
 | 
			
		||||
        $instance->scaling_factor($instance->scaling_factor * $self->scale);
 | 
			
		||||
        $instance->rotation($instance->rotation + $self->rotate);
 | 
			
		||||
        $instance->set_scaling_factor($instance->scaling_factor * $self->scale);
 | 
			
		||||
        $instance->set_rotation($instance->rotation + $self->rotate);
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    if ($self->duplicate_grid->[X] > 1 || $self->duplicate_grid->[Y] > 1) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue