mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 06:33:57 -06:00
New bridging logic, more robust. #58
This commit is contained in:
parent
1ef4d006a0
commit
a1c766cc52
8 changed files with 86 additions and 75 deletions
|
@ -9,6 +9,7 @@ use warnings;
|
|||
|
||||
use Slic3r::Geometry qw(polygon_lines polygon_remove_parallel_continuous_edges
|
||||
polygon_segment_having_point point_in_polygon move_points rotate_points);
|
||||
use Slic3r::Geometry::Clipper qw(JT_MITER);
|
||||
|
||||
# the constructor accepts an array(ref) of points
|
||||
sub new {
|
||||
|
@ -75,4 +76,15 @@ sub safety_offset {
|
|||
return (ref $self)->new(Slic3r::Geometry::Clipper::safety_offset([$self])->[0]);
|
||||
}
|
||||
|
||||
sub offset {
|
||||
my $self = shift;
|
||||
my ($distance, $scale, $joinType, $miterLimit) = @_;
|
||||
$scale ||= $Slic3r::resolution * 1000000;
|
||||
$joinType = JT_MITER if !defined $joinType;
|
||||
$miterLimit ||= 2;
|
||||
|
||||
my $offsets = Math::Clipper::offset([$self], $distance, $scale, $joinType, $miterLimit);
|
||||
return @$offsets;
|
||||
}
|
||||
|
||||
1;
|
Loading…
Add table
Add a link
Reference in a new issue