mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 13:02:39 -07:00
Update tests after recent serialization changes
This commit is contained in:
3
t/arcs.t
3
t/arcs.t
@@ -59,8 +59,7 @@ use Slic3r::Geometry qw(epsilon scale X Y);
|
|||||||
|
|
||||||
isa_ok $collection1->paths->[0], 'Slic3r::ExtrusionPath::Arc', 'path';
|
isa_ok $collection1->paths->[0], 'Slic3r::ExtrusionPath::Arc', 'path';
|
||||||
isa_ok $collection2->paths->[0], 'Slic3r::ExtrusionPath::Arc', 'path';
|
isa_ok $collection2->paths->[0], 'Slic3r::ExtrusionPath::Arc', 'path';
|
||||||
|
|
||||||
$_->deserialize for $collection1->paths->[0], $collection2->paths->[0];
|
|
||||||
my $expected_length = scale 7.06858347057701;
|
my $expected_length = scale 7.06858347057701;
|
||||||
ok abs($collection1->paths->[0]->length - $expected_length) < scale epsilon, 'cw oriented arc has correct length';
|
ok abs($collection1->paths->[0]->length - $expected_length) < scale epsilon, 'cw oriented arc has correct length';
|
||||||
ok abs($collection2->paths->[0]->length - $expected_length) < scale epsilon, 'ccw oriented arc has correct length';
|
ok abs($collection2->paths->[0]->length - $expected_length) < scale epsilon, 'ccw oriented arc has correct length';
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ use Slic3r::Geometry qw(scale);
|
|||||||
}
|
}
|
||||||
my $polyline = Slic3r::Polyline->new($points);
|
my $polyline = Slic3r::Polyline->new($points);
|
||||||
my $serialized = $polyline->serialize;
|
my $serialized = $polyline->serialize;
|
||||||
my $deserialized = $serialized->deserialize;
|
my $deserialized = Slic3r::Polyline->deserialize($serialized);
|
||||||
is scalar(@$deserialized), scalar(@$points), 'number of deserialized points';
|
is scalar(@$deserialized), scalar(@$points), 'number of deserialized points';
|
||||||
is_deeply $deserialized, $points, 'deserialized points coordinates';
|
is_deeply $deserialized, $points, 'deserialized points coordinates';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user