mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Remove scale, rotate, duplicate, duplicate_grid from config (but leave them in CLI)
This commit is contained in:
		
							parent
							
								
									385e0e0974
								
							
						
					
					
						commit
						bfa2ee2770
					
				
					 4 changed files with 18 additions and 50 deletions
				
			
		| 
						 | 
				
			
			@ -7,7 +7,7 @@ use List::Util qw(first);
 | 
			
		|||
 | 
			
		||||
# cemetery of old config settings
 | 
			
		||||
our @Ignore = qw(duplicate_x duplicate_y multiply_x multiply_y support_material_tool acceleration
 | 
			
		||||
    adjust_overhang_flow standby_temperature);
 | 
			
		||||
    adjust_overhang_flow standby_temperature scale rotate duplicate duplicate_grid);
 | 
			
		||||
 | 
			
		||||
our $Options = print_config_def();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -19,15 +19,6 @@ our $Options = print_config_def();
 | 
			
		|||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# sub _get {
 | 
			
		||||
#     my ($self, $opt_key) = @_;
 | 
			
		||||
#     use XXX;
 | 
			
		||||
#     if (!defined first { $_ eq $opt_key } @{$self->get_keys}) {
 | 
			
		||||
#         ZZZ $opt_key;
 | 
			
		||||
#     }
 | 
			
		||||
#     return $self->get($opt_key);
 | 
			
		||||
# }
 | 
			
		||||
 | 
			
		||||
sub new_from_defaults {
 | 
			
		||||
    my $class = shift;
 | 
			
		||||
    my (@opt_keys) = @_;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -57,7 +57,6 @@ sub set_model {
 | 
			
		|||
        $instance->scaling_factor($instance->scaling_factor * $self->scale);
 | 
			
		||||
        $instance->rotation($instance->rotation + $self->rotate);
 | 
			
		||||
    }
 | 
			
		||||
    # TODO: --scale --rotate, --duplicate* shouldn't be stored in config
 | 
			
		||||
    
 | 
			
		||||
    if ($self->duplicate_grid->[X] > 1 || $self->duplicate_grid->[Y] > 1) {
 | 
			
		||||
        $model->duplicate_objects_grid($self->duplicate_grid, $self->_print->config->duplicate_distance);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										25
									
								
								slic3r.pl
									
										
									
									
									
								
							
							
						
						
									
										25
									
								
								slic3r.pl
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -37,6 +37,11 @@ my %cli_options = ();
 | 
			
		|||
        'merge|m'               => \$opt{merge},
 | 
			
		||||
        'repair'                => \$opt{repair},
 | 
			
		||||
        'info'                  => \$opt{info},
 | 
			
		||||
        
 | 
			
		||||
        'scale=f'               => \$opt{scale},
 | 
			
		||||
        'rotate=i'              => \$opt{rotate},
 | 
			
		||||
        'duplicate=i'           => \$opt{duplicate},
 | 
			
		||||
        'duplicate-grid=s'      => \$opt{duplicate_grid},
 | 
			
		||||
    );
 | 
			
		||||
    foreach my $opt_key (keys %{$Slic3r::Config::Options}) {
 | 
			
		||||
        my $cli = $Slic3r::Config::Options->{$opt_key}->{cli} or next;
 | 
			
		||||
| 
						 | 
				
			
			@ -126,11 +131,15 @@ if (@ARGV) {  # slicing from command line
 | 
			
		|||
            next;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        if (defined $opt{duplicate_grid}) {
 | 
			
		||||
            $opt{duplicate_grid} = [ split /[,x]/, $opt{duplicate_grid}, 2 ];
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        my $sprint = Slic3r::Print::Simple->new(
 | 
			
		||||
            scale           => $config->scale,
 | 
			
		||||
            rotate          => $config->rotate,
 | 
			
		||||
            duplicate       => $config->duplicate,
 | 
			
		||||
            duplicate_grid  => $config->duplicate_grid,
 | 
			
		||||
            scale           => $opt{scale}          // 1,
 | 
			
		||||
            rotate          => $opt{rotate}         // 0,
 | 
			
		||||
            duplicate       => $opt{duplicate}      // 1,
 | 
			
		||||
            duplicate_grid  => $opt{duplicate_grid} // [1,1],
 | 
			
		||||
            status_cb       => sub {
 | 
			
		||||
                my ($percent, $message) = @_;
 | 
			
		||||
                printf "=> %s\n", $message;
 | 
			
		||||
| 
						 | 
				
			
			@ -394,11 +403,11 @@ $j
 | 
			
		|||
                        (mm, default: $config->{brim_width})
 | 
			
		||||
   
 | 
			
		||||
   Transform options:
 | 
			
		||||
    --scale             Factor for scaling input object (default: $config->{scale})
 | 
			
		||||
    --rotate            Rotation angle in degrees (0-360, default: $config->{rotate})
 | 
			
		||||
    --duplicate         Number of items with auto-arrange (1+, default: $config->{duplicate})
 | 
			
		||||
    --scale             Factor for scaling input object (default: 1)
 | 
			
		||||
    --rotate            Rotation angle in degrees (0-360, default: 0)
 | 
			
		||||
    --duplicate         Number of items with auto-arrange (1+, default: 1)
 | 
			
		||||
    --bed-size          Bed size, only used for auto-arrange (mm, default: $config->{bed_size}->[0],$config->{bed_size}->[1])
 | 
			
		||||
    --duplicate-grid    Number of items with grid arrangement (default: $config->{duplicate_grid}->[0],$config->{duplicate_grid}->[1])
 | 
			
		||||
    --duplicate-grid    Number of items with grid arrangement (default: 1,1)
 | 
			
		||||
    --duplicate-distance Distance in mm between copies (default: $config->{duplicate_distance})
 | 
			
		||||
   
 | 
			
		||||
   Sequential printing options:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -126,11 +126,6 @@ class PrintConfigDef
 | 
			
		|||
        Options["disable_fan_first_layers"].cli = "disable-fan-first-layers=i";
 | 
			
		||||
        Options["disable_fan_first_layers"].max = 1000;
 | 
			
		||||
 | 
			
		||||
        Options["duplicate"].type = coInt;
 | 
			
		||||
        Options["duplicate"].label = "Copies (autoarrange)";
 | 
			
		||||
        Options["duplicate"].cli = "duplicate=i";
 | 
			
		||||
        Options["duplicate"].min = 1;
 | 
			
		||||
 | 
			
		||||
        Options["duplicate_distance"].type = coFloat;
 | 
			
		||||
        Options["duplicate_distance"].label = "Distance between copies";
 | 
			
		||||
        Options["duplicate_distance"].tooltip = "Distance used for the auto-arrange feature of the plater.";
 | 
			
		||||
| 
						 | 
				
			
			@ -138,10 +133,6 @@ class PrintConfigDef
 | 
			
		|||
        Options["duplicate_distance"].cli = "duplicate-distance=f";
 | 
			
		||||
        Options["duplicate_distance"].aliases.push_back("multiply_distance");
 | 
			
		||||
 | 
			
		||||
        Options["duplicate_grid"].type = coPoint;
 | 
			
		||||
        Options["duplicate_grid"].label = "Copies (grid)";
 | 
			
		||||
        Options["duplicate_grid"].cli = "duplicate-grid=s";
 | 
			
		||||
 | 
			
		||||
        Options["end_gcode"].type = coString;
 | 
			
		||||
        Options["end_gcode"].label = "End G-code";
 | 
			
		||||
        Options["end_gcode"].tooltip = "This end procedure is inserted at the end of the output file. Note that you can use placeholder variables for all Slic3r settings.";
 | 
			
		||||
| 
						 | 
				
			
			@ -584,16 +575,6 @@ class PrintConfigDef
 | 
			
		|||
        Options["retract_speed"].cli = "retract-speed=f@";
 | 
			
		||||
        Options["retract_speed"].max = 1000;
 | 
			
		||||
 | 
			
		||||
        Options["rotate"].type = coInt;
 | 
			
		||||
        Options["rotate"].label = "Rotate";
 | 
			
		||||
        Options["rotate"].sidetext = "°";
 | 
			
		||||
        Options["rotate"].cli = "rotate=i";
 | 
			
		||||
        Options["rotate"].max = 359;
 | 
			
		||||
 | 
			
		||||
        Options["scale"].type = coFloat;
 | 
			
		||||
        Options["scale"].label = "Scale";
 | 
			
		||||
        Options["scale"].cli = "scale=f";
 | 
			
		||||
 | 
			
		||||
        Options["skirt_distance"].type = coFloat;
 | 
			
		||||
        Options["skirt_distance"].label = "Distance from object";
 | 
			
		||||
        Options["skirt_distance"].tooltip = "Distance between skirt and object(s). Set this to zero to attach the skirt to the object(s) and get a brim for better adhesion.";
 | 
			
		||||
| 
						 | 
				
			
			@ -1057,9 +1038,7 @@ class PrintConfig : public virtual StaticConfig
 | 
			
		|||
    ConfigOptionBool                cooling;
 | 
			
		||||
    ConfigOptionFloat               default_acceleration;
 | 
			
		||||
    ConfigOptionInt                 disable_fan_first_layers;
 | 
			
		||||
    ConfigOptionInt                 duplicate;
 | 
			
		||||
    ConfigOptionFloat               duplicate_distance;
 | 
			
		||||
    ConfigOptionPoint               duplicate_grid;
 | 
			
		||||
    ConfigOptionString              end_gcode;
 | 
			
		||||
    ConfigOptionFloatOrPercent      external_perimeter_speed;
 | 
			
		||||
    ConfigOptionBool                external_perimeters_first;
 | 
			
		||||
| 
						 | 
				
			
			@ -1108,8 +1087,6 @@ class PrintConfig : public virtual StaticConfig
 | 
			
		|||
    ConfigOptionFloats              retract_restart_extra;
 | 
			
		||||
    ConfigOptionFloats              retract_restart_extra_toolchange;
 | 
			
		||||
    ConfigOptionInts                retract_speed;
 | 
			
		||||
    ConfigOptionInt                 rotate;
 | 
			
		||||
    ConfigOptionFloat               scale;
 | 
			
		||||
    ConfigOptionFloat               skirt_distance;
 | 
			
		||||
    ConfigOptionInt                 skirt_height;
 | 
			
		||||
    ConfigOptionInt                 skirts;
 | 
			
		||||
| 
						 | 
				
			
			@ -1147,9 +1124,7 @@ class PrintConfig : public virtual StaticConfig
 | 
			
		|||
        this->cooling.value                                      = true;
 | 
			
		||||
        this->default_acceleration.value                         = 0;
 | 
			
		||||
        this->disable_fan_first_layers.value                     = 1;
 | 
			
		||||
        this->duplicate.value                                    = 1;
 | 
			
		||||
        this->duplicate_distance.value                           = 6;
 | 
			
		||||
        this->duplicate_grid.point                               = Pointf(1,1);
 | 
			
		||||
        this->end_gcode.value                                    = "M104 S0 ; turn off temperature\nG28 X0  ; home X axis\nM84     ; disable motors\n";
 | 
			
		||||
        this->external_perimeter_speed.value                     = 70;
 | 
			
		||||
        this->external_perimeter_speed.percent                   = true;
 | 
			
		||||
| 
						 | 
				
			
			@ -1212,8 +1187,6 @@ class PrintConfig : public virtual StaticConfig
 | 
			
		|||
        this->retract_restart_extra_toolchange.values[0]         = 0;
 | 
			
		||||
        this->retract_speed.values.resize(1);
 | 
			
		||||
        this->retract_speed.values[0]                            = 30;
 | 
			
		||||
        this->rotate.value                                       = 0;
 | 
			
		||||
        this->scale.value                                        = 1;
 | 
			
		||||
        this->skirt_distance.value                               = 6;
 | 
			
		||||
        this->skirt_height.value                                 = 1;
 | 
			
		||||
        this->skirts.value                                       = 1;
 | 
			
		||||
| 
						 | 
				
			
			@ -1255,9 +1228,7 @@ class PrintConfig : public virtual StaticConfig
 | 
			
		|||
        if (opt_key == "cooling")                                    return &this->cooling;
 | 
			
		||||
        if (opt_key == "default_acceleration")                       return &this->default_acceleration;
 | 
			
		||||
        if (opt_key == "disable_fan_first_layers")                   return &this->disable_fan_first_layers;
 | 
			
		||||
        if (opt_key == "duplicate")                                  return &this->duplicate;
 | 
			
		||||
        if (opt_key == "duplicate_distance")                         return &this->duplicate_distance;
 | 
			
		||||
        if (opt_key == "duplicate_grid")                             return &this->duplicate_grid;
 | 
			
		||||
        if (opt_key == "end_gcode")                                  return &this->end_gcode;
 | 
			
		||||
        if (opt_key == "external_perimeter_speed")                   return &this->external_perimeter_speed;
 | 
			
		||||
        if (opt_key == "external_perimeters_first")                  return &this->external_perimeters_first;
 | 
			
		||||
| 
						 | 
				
			
			@ -1306,8 +1277,6 @@ class PrintConfig : public virtual StaticConfig
 | 
			
		|||
        if (opt_key == "retract_restart_extra")                      return &this->retract_restart_extra;
 | 
			
		||||
        if (opt_key == "retract_restart_extra_toolchange")           return &this->retract_restart_extra_toolchange;
 | 
			
		||||
        if (opt_key == "retract_speed")                              return &this->retract_speed;
 | 
			
		||||
        if (opt_key == "rotate")                                     return &this->rotate;
 | 
			
		||||
        if (opt_key == "scale")                                      return &this->scale;
 | 
			
		||||
        if (opt_key == "skirt_distance")                             return &this->skirt_distance;
 | 
			
		||||
        if (opt_key == "skirt_height")                               return &this->skirt_height;
 | 
			
		||||
        if (opt_key == "skirts")                                     return &this->skirts;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue