mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	New high_res_perimeters option (like the "Skin" plugin for Skeinforge)
This commit is contained in:
		
							parent
							
								
									1978a99416
								
							
						
					
					
						commit
						119eb0693f
					
				
					 7 changed files with 28 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -40,6 +40,7 @@ Slic3r current features are:
 | 
			
		|||
* retraction;
 | 
			
		||||
* skirt (with rounded corners);
 | 
			
		||||
* use relative or absolute extrusion commands;
 | 
			
		||||
* high-res perimeters (like the "Skin" plugin for Skeinforge);
 | 
			
		||||
* center print around bed center point;
 | 
			
		||||
* multiple solid layers near horizontal external surfaces;
 | 
			
		||||
* ability to scale, rotate and multiply input object;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -45,9 +45,10 @@ our $perimeter_feed_rate        = 30;   # mm/sec
 | 
			
		|||
our $bottom_layer_speed_ratio   = 0.3;
 | 
			
		||||
 | 
			
		||||
# accuracy options
 | 
			
		||||
our $resolution         = 0.00000001;
 | 
			
		||||
our $layer_height       = 0.4;
 | 
			
		||||
our $thickness_ratio    = 1;
 | 
			
		||||
our $resolution             = 0.00000001;
 | 
			
		||||
our $layer_height           = 0.4;
 | 
			
		||||
our $high_res_perimeters    = 0;
 | 
			
		||||
our $thickness_ratio        = 1;
 | 
			
		||||
our $flow_width;
 | 
			
		||||
 | 
			
		||||
# print options
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -59,6 +59,10 @@ our $Options = {
 | 
			
		|||
        label   => 'Layer height (mm)',
 | 
			
		||||
        type    => 'f',
 | 
			
		||||
    },
 | 
			
		||||
    'high_res_perimeters' => {
 | 
			
		||||
        label   => 'High-res perimeters',
 | 
			
		||||
        type    => 'bool',
 | 
			
		||||
    },
 | 
			
		||||
    
 | 
			
		||||
    # print options
 | 
			
		||||
    'perimeter_offsets' => {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,6 +4,7 @@ use Moo;
 | 
			
		|||
has 'shift_x'            => (is => 'ro', default => sub {0} );
 | 
			
		||||
has 'shift_y'            => (is => 'ro', default => sub {0} );
 | 
			
		||||
has 'z'                  => (is => 'rw', default => sub {0} );
 | 
			
		||||
has 'flow_ratio'         => (is => 'rw', default => sub {1});
 | 
			
		||||
 | 
			
		||||
has 'extrusion_distance' => (is => 'rw', default => sub {0} );
 | 
			
		||||
has 'retracted'          => (is => 'rw', default => sub {1} );  # this spits out some plastic at start
 | 
			
		||||
| 
						 | 
				
			
			@ -90,6 +91,7 @@ sub extrude {
 | 
			
		|||
        my $e = $line->a->distance_to($line->b) * $Slic3r::resolution
 | 
			
		||||
            * (($Slic3r::nozzle_diameter**2) / ($Slic3r::filament_diameter ** 2))
 | 
			
		||||
            * $Slic3r::thickness_ratio 
 | 
			
		||||
            * $self->flow_ratio
 | 
			
		||||
            * $Slic3r::filament_packing_density;
 | 
			
		||||
        
 | 
			
		||||
        $gcode .= $self->G1($line->b, undef, $e, $description);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -29,7 +29,7 @@ sub new {
 | 
			
		|||
        ),
 | 
			
		||||
        accuracy => Slic3r::GUI::OptionsGroup->new($self,
 | 
			
		||||
            title => 'Accuracy',
 | 
			
		||||
            options => [qw(layer_height)],
 | 
			
		||||
            options => [qw(layer_height high_res_perimeters)],
 | 
			
		||||
        ),
 | 
			
		||||
        print => Slic3r::GUI::OptionsGroup->new($self,
 | 
			
		||||
            title => 'Print settings',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -211,6 +211,18 @@ sub export_gcode {
 | 
			
		|||
    # write gcode commands layer by layer
 | 
			
		||||
    foreach my $layer (@{ $self->layers }) {
 | 
			
		||||
        
 | 
			
		||||
        # with the --high-res-perimeters options enabled we extrude perimeters for
 | 
			
		||||
        # each layer twice at half height
 | 
			
		||||
        if ($Slic3r::high_res_perimeters && $layer->id > 0) {
 | 
			
		||||
            # go to half-layer
 | 
			
		||||
            printf $fh $extruder->move_z($Slic3r::z_offset + $layer->z * $Slic3r::resolution - $Slic3r::layer_height/2);
 | 
			
		||||
            
 | 
			
		||||
            # extrude perimeters
 | 
			
		||||
            $extruder->flow_ratio(0.5);
 | 
			
		||||
            printf $fh $extruder->extrude_loop($_, 'perimeter') for @{ $layer->perimeters };
 | 
			
		||||
            $extruder->flow_ratio(1);
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        # go to layer
 | 
			
		||||
        printf $fh $extruder->move_z($Slic3r::z_offset + $layer->z * $Slic3r::resolution);
 | 
			
		||||
        
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,6 +40,7 @@ GetOptions(
 | 
			
		|||
    
 | 
			
		||||
    # accuracy options
 | 
			
		||||
    'layer-height=f'        => \$Slic3r::layer_height,
 | 
			
		||||
    'high-res-perimeters'   => \$Slic3r::high_res_perimeters,
 | 
			
		||||
    
 | 
			
		||||
    # print options
 | 
			
		||||
    'perimeters=i'          => \$Slic3r::perimeter_offsets,
 | 
			
		||||
| 
						 | 
				
			
			@ -139,6 +140,9 @@ Usage: slic3r.pl [ OPTIONS ] file.stl
 | 
			
		|||
    
 | 
			
		||||
  Accuracy options:
 | 
			
		||||
    --layer-height      Layer height in mm (default: $Slic3r::layer_height)
 | 
			
		||||
    --high-res-perimeters
 | 
			
		||||
                        Print perimeters at half layer height to get surface accuracy
 | 
			
		||||
                        (default: disabled)
 | 
			
		||||
  
 | 
			
		||||
  Print options:
 | 
			
		||||
    --perimeters        Number of perimeters/horizontal skins (range: 1+, 
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue