Implemented skirt
This commit is contained in:
parent
d8b848a67f
commit
ff5044c031
@ -28,16 +28,16 @@ Also, http://xkcd.com/224/
|
|||||||
|
|
||||||
## What's its current status?
|
## What's its current status?
|
||||||
|
|
||||||
Slic3r is able to:
|
Slic3r current features are:
|
||||||
|
|
||||||
* read binary and ASCII STL files;
|
* read binary and ASCII STL files;
|
||||||
* generate multiple perimeters (skins);
|
* generate multiple perimeters (skins);
|
||||||
* generate rectilinear fill (100% solid for external surfaces or with customizable less density for inner surfaces);
|
* generate rectilinear fill (100% solid for external surfaces or with customizable less density for inner surfaces);
|
||||||
* retraction;
|
* retraction;
|
||||||
|
* skirt;
|
||||||
* use relative or absolute extrusion commands;
|
* use relative or absolute extrusion commands;
|
||||||
* center print around bed center point;
|
* center print around bed center point;
|
||||||
* use different speed for bottom layer;
|
* use different speed for bottom layer.
|
||||||
* output relevant GCODE.
|
|
||||||
|
|
||||||
Roadmap includes the following goals:
|
Roadmap includes the following goals:
|
||||||
|
|
||||||
@ -46,8 +46,6 @@ Roadmap includes the following goals:
|
|||||||
* option for filling multiple solid layers near external surfaces;
|
* option for filling multiple solid layers near external surfaces;
|
||||||
* support material for internal perimeters;
|
* support material for internal perimeters;
|
||||||
* ability to infill in the direction of bridges;
|
* ability to infill in the direction of bridges;
|
||||||
* extra perimeters on alternate layers;
|
|
||||||
* skirt;
|
|
||||||
* cool;
|
* cool;
|
||||||
* nice packaging for cross-platform deployment.
|
* nice packaging for cross-platform deployment.
|
||||||
|
|
||||||
|
@ -38,6 +38,9 @@ our $retract_length = 2; # mm
|
|||||||
our $retract_restart_extra = 0; # mm
|
our $retract_restart_extra = 0; # mm
|
||||||
our $retract_speed = 40; # mm/sec
|
our $retract_speed = 40; # mm/sec
|
||||||
|
|
||||||
|
our $skirts = 3;
|
||||||
|
our $skirt_distance = 6; # mm
|
||||||
|
|
||||||
our $use_relative_e_distances = 0;
|
our $use_relative_e_distances = 0;
|
||||||
|
|
||||||
our $print_center = [100,100]; # object will be centered around this point
|
our $print_center = [100,100]; # object will be centered around this point
|
||||||
|
@ -46,6 +46,13 @@ has 'perimeters' => (
|
|||||||
default => sub { [] },
|
default => sub { [] },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
# ordered collection of extrusion paths to build skirt loops
|
||||||
|
has 'skirts' => (
|
||||||
|
is => 'rw',
|
||||||
|
isa => 'ArrayRef[Slic3r::ExtrusionPath]',
|
||||||
|
default => sub { [] },
|
||||||
|
);
|
||||||
|
|
||||||
# collection of surfaces generated by offsetting the innermost perimeter(s)
|
# collection of surfaces generated by offsetting the innermost perimeter(s)
|
||||||
# they represent boundaries of areas to fill
|
# they represent boundaries of areas to fill
|
||||||
has 'fill_surfaces' => (
|
has 'fill_surfaces' => (
|
||||||
|
@ -73,6 +73,23 @@ sub make_perimeter {
|
|||||||
}
|
}
|
||||||
push @{ $layer->perimeters }, Slic3r::ExtrusionPath->new_from_points(reverse @path_points);
|
push @{ $layer->perimeters }, Slic3r::ExtrusionPath->new_from_points(reverse @path_points);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# generate skirt on bottom layer
|
||||||
|
if ($layer->id == 0 && $Slic3r::skirts > 0) {
|
||||||
|
# find out convex hull
|
||||||
|
my $points = [ map { @{ $_->mgp_polygon->polygons->[0] } } @{ $layer->surfaces } ];
|
||||||
|
my $convex_hull = $self->_mgp_from_points_ref($points)->convexhull2;
|
||||||
|
my $convex_hull_polygon = $self->_mgp_from_points_ref($convex_hull);
|
||||||
|
|
||||||
|
# draw outlines from outside to inside
|
||||||
|
for (my $i = $Slic3r::skirts - 1; $i >= 0; $i--) {
|
||||||
|
my $outline = $convex_hull_polygon->offset_polygon(
|
||||||
|
- ($Slic3r::skirt_distance + ($Slic3r::flow_width * $i)) / $Slic3r::resolution
|
||||||
|
);
|
||||||
|
push @{$outline->[0]}, $outline->[0][0]; # repeat first point as last to complete the loop
|
||||||
|
push @{ $layer->skirts }, Slic3r::ExtrusionPath->new_from_points(@{$outline->[0]});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub offset_polygon {
|
sub offset_polygon {
|
||||||
|
@ -185,6 +185,9 @@ sub export_gcode {
|
|||||||
printf $fh "G1 Z%.${dec}f F%.${dec}f ; move to next layer\n",
|
printf $fh "G1 Z%.${dec}f F%.${dec}f ; move to next layer\n",
|
||||||
$z, $travel_feed_rate;
|
$z, $travel_feed_rate;
|
||||||
|
|
||||||
|
# extrude skirts
|
||||||
|
$Extrude->($_, 'skirt') for @{ $layer->skirts };
|
||||||
|
|
||||||
# extrude perimeters
|
# extrude perimeters
|
||||||
$Extrude->($_, 'perimeter') for @{ $layer->perimeters };
|
$Extrude->($_, 'perimeter') for @{ $layer->perimeters };
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@ GetOptions(
|
|||||||
'temperature=i' => \$Slic3r::temperature,
|
'temperature=i' => \$Slic3r::temperature,
|
||||||
'print-feed-rate=i' => \$Slic3r::print_feed_rate,
|
'print-feed-rate=i' => \$Slic3r::print_feed_rate,
|
||||||
'travel-feed-rate=i' => \$Slic3r::travel_feed_rate,
|
'travel-feed-rate=i' => \$Slic3r::travel_feed_rate,
|
||||||
|
'skirts=i' => \$Slic3r::skirts,
|
||||||
|
'skirt-distance=i' => \$Slic3r::skirt_distance,
|
||||||
'bottom-layer-speed-ratio=f' => \$Slic3r::bottom_layer_speed_ratio,
|
'bottom-layer-speed-ratio=f' => \$Slic3r::bottom_layer_speed_ratio,
|
||||||
'use-relative-e-distances' => \$Slic3r::use_relative_e_distances,
|
'use-relative-e-distances' => \$Slic3r::use_relative_e_distances,
|
||||||
'print-center=s' => \$Slic3r::print_center,
|
'print-center=s' => \$Slic3r::print_center,
|
||||||
@ -120,6 +122,9 @@ Usage: slic3r.pl [ OPTIONS ] file.stl
|
|||||||
--retract-restart-extra
|
--retract-restart-extra
|
||||||
Additional amount of filament in mm to push after compensating
|
Additional amount of filament in mm to push after compensating
|
||||||
retraction (default: $Slic3r::retract_restart_extra)
|
retraction (default: $Slic3r::retract_restart_extra)
|
||||||
|
--skirts Number of skirts to draw (default: $Slic3r::skirts)
|
||||||
|
--skirt-distance Distance in mm between innermost skirt and object
|
||||||
|
(default: $Slic3r::skirt_distance)
|
||||||
--use-relative-e-distances
|
--use-relative-e-distances
|
||||||
Use relative distances for extrusion in GCODE output
|
Use relative distances for extrusion in GCODE output
|
||||||
--print-center Coordinates of the point to center the print around
|
--print-center Coordinates of the point to center the print around
|
||||||
|
Loading…
Reference in New Issue
Block a user