mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
New bridging logic, more robust. #58
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user