mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-20 21:27:52 -06:00
Completely rewritten the slicing algorithm
It should work with any model now. There are still problems with some bridges.
This commit is contained in:
parent
ad27f25c71
commit
459577f9a2
8 changed files with 137 additions and 246 deletions
|
@ -3,6 +3,7 @@ use Moo;
|
|||
|
||||
use Math::Clipper qw();
|
||||
use Sub::Quote;
|
||||
use XXX;
|
||||
|
||||
# arrayref of ordered points
|
||||
has 'points' => (
|
||||
|
@ -61,9 +62,14 @@ sub merge_continuous_lines {
|
|||
|
||||
sub cleanup {
|
||||
my $self = shift;
|
||||
my $tolerance = shift || (1 / $Slic3r::resolution);
|
||||
@{$self->points} = map Slic3r::Point->cast($_),
|
||||
my $tolerance = shift || 10;
|
||||
|
||||
my $points = $self->p;
|
||||
push @$points, $points->[0] if $self->isa('Slic3r::Polyline::Closed');
|
||||
my @clean_points = map Slic3r::Point->cast($_),
|
||||
Slic3r::Geometry::Douglas_Peucker($self->p, $tolerance);
|
||||
pop @clean_points if $self->isa('Slic3r::Polyline::Closed');
|
||||
@{$self->points} = @clean_points;
|
||||
}
|
||||
|
||||
sub reverse_points {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue