Adapt SectionCut to the new APIs
This commit is contained in:
parent
5dc635b0b1
commit
b5b0df2426
@ -84,24 +84,25 @@ sub _plot {
|
|||||||
foreach my $copy (@{$object->_shifted_copies}) {
|
foreach my $copy (@{$object->_shifted_copies}) {
|
||||||
foreach my $layer (@{$object->layers}, @{$object->support_layers}) {
|
foreach my $layer (@{$object->layers}, @{$object->support_layers}) {
|
||||||
# get all ExtrusionPath objects
|
# get all ExtrusionPath objects
|
||||||
my @paths =
|
my @paths = map $_->clone,
|
||||||
map { $_->isa('Slic3r::ExtrusionLoop') ? $_->split_at_first_point : $_->clone }
|
map { ($_->isa('Slic3r::ExtrusionLoop') || $_->isa('Slic3r::ExtrusionPath::Collection')) ? @$_ : $_ }
|
||||||
map { $_->isa('Slic3r::ExtrusionPath::Collection') ? @$_ : $_ }
|
|
||||||
grep defined $_,
|
grep defined $_,
|
||||||
$filter->($layer);
|
$filter->($layer);
|
||||||
|
|
||||||
$_->polyline->translate(@$copy) for @paths;
|
$_->polyline->translate(@$copy) for @paths;
|
||||||
|
|
||||||
require "Slic3r/SVG.pm";
|
if (0) {
|
||||||
Slic3r::SVG::output(
|
require "Slic3r/SVG.pm";
|
||||||
"line.svg",
|
Slic3r::SVG::output(
|
||||||
no_arrows => 1,
|
"line.svg",
|
||||||
#polygon => $line->grow(Slic3r::Geometry::scale $path->width/2),
|
no_arrows => 1,
|
||||||
polygons => [ $object->bounding_box->polygon ],
|
#polygon => $line->grow(Slic3r::Geometry::scale $path->width/2),
|
||||||
lines => [ $self->line ],
|
polygons => [ $object->bounding_box->polygon ],
|
||||||
red_polylines => [ map $_->polyline, @paths ],
|
lines => [ $self->line ],
|
||||||
);
|
red_polylines => [ map $_->polyline, @paths ],
|
||||||
exit;
|
);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
foreach my $path (@paths) {
|
foreach my $path (@paths) {
|
||||||
foreach my $line (@{$path->lines}) {
|
foreach my $line (@{$path->lines}) {
|
||||||
|
Loading…
Reference in New Issue
Block a user