Very large refactoring. Ditched Slic3r::Polyline::Closed and reorganized geometric classes.

This commit is contained in:
Alessandro Ranellucci 2011-12-30 19:59:51 +01:00
parent 2def6a9787
commit 8ed91a8ec4
20 changed files with 293 additions and 349 deletions

View file

@ -13,13 +13,13 @@ use Slic3r;
use Slic3r::Geometry qw(epsilon);
{
my $path = Slic3r::ExtrusionPath->cast([
my $path = Slic3r::ExtrusionPath->new(polyline => Slic3r::Polyline->new(
[135322.42,26654.96], [187029.11,99546.23], [222515.14,92381.93], [258001.16,99546.23],
[286979.42,119083.91], [306517.1,148062.17], [313681.4,183548.2],
[306517.1,219034.23], [286979.42,248012.49], [258001.16,267550.17], [222515.14,274714.47],
[187029.11,267550.17], [158050.85,248012.49], [138513.17,219034.23], [131348.87,183548.2],
[86948.77,175149.09], [119825.35,100585],
], role => 'fill');
), role => 'fill');
my $collection = Slic3r::ExtrusionPath::Collection->new(paths => [$path]);
$collection->detect_arcs(30);
@ -31,14 +31,17 @@ use Slic3r::Geometry qw(epsilon);
#==========================================================
{
my $path1 = Slic3r::ExtrusionPath->cast([
my $path1 = Slic3r::ExtrusionPath->new(polyline => Slic3r::Polyline->new(
[10,20], [10.7845909572784,19.9691733373313], [11.5643446504023,19.8768834059514],
[12.3344536385591,19.7236992039768], [13.0901699437495,19.5105651629515],
[13.8268343236509,19.2387953251129], [14.5399049973955,18.9100652418837],
[15.2249856471595,18.5264016435409], [15.8778525229247,18.0901699437495],
[16.4944804833018,17.6040596560003],
], role => 'fill');
my $path2 = Slic3r::ExtrusionPath->cast([ reverse @{$path1->points} ], role => 'fill');
), role => 'fill');
my $path2 = Slic3r::ExtrusionPath->new(
polyline => Slic3r::Polyline->new(reverse @{$path1->points}),
role => 'fill',
);
my $collection1 = Slic3r::ExtrusionPath::Collection->new(paths => [$path1]);
my $collection2 = Slic3r::ExtrusionPath::Collection->new(paths => [$path2]);