Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2011-10-10 00:18:06 +0400
committerAlessandro Ranellucci <aar@cpan.org>2011-10-10 00:18:06 +0400
commit84abd41cf454bcc9bccaa0c3921263d519106d97 (patch)
tree76a4f389ba15fa0aab363157fe374dd5e262e22b /t/geometry.t
parent459577f9a2ee4b6a751ba735cf23a023bcd68ce8 (diff)
Fixes for bridges
Diffstat (limited to 't/geometry.t')
-rw-r--r--t/geometry.t43
1 files changed, 41 insertions, 2 deletions
diff --git a/t/geometry.t b/t/geometry.t
index 4c65d6ae5..24746e451 100644
--- a/t/geometry.t
+++ b/t/geometry.t
@@ -2,7 +2,7 @@ use Test::More;
use strict;
use warnings;
-plan tests => 15;
+plan tests => 17;
BEGIN {
use FindBin;
@@ -10,7 +10,9 @@ BEGIN {
}
use Slic3r;
-use Slic3r::Geometry qw(PI);
+use Slic3r::Geometry qw(PI polyline_remove_parallel_continuous_edges
+ polyline_remove_acute_vertices polygon_remove_acute_vertices
+ polygon_remove_parallel_continuous_edges);
#==========================================================
@@ -114,3 +116,40 @@ is Slic3r::Geometry::can_connect_points(@$points, $polygons), 0, 'can_connect_po
}
#==========================================================
+
+{
+ my $polygon = [
+ [2265447881, 7013509857], [2271869937, 7009802077], [2606221146, 6816764300], [1132221146, 4263721402],
+ [1098721150, 4205697705], [1228411320, 4130821051], [1557501031, 3940821051], [1737340080, 3836990933],
+ [1736886253, 3837252951], [1494771522, 3977037948], [2959638603, 6514262167], [3002271522, 6588104548],
+ [3083252364, 6541350240], [2854283608, 6673545411], [2525193897, 6863545411],
+ ];
+ polygon_remove_parallel_continuous_edges($polygon);
+ polygon_remove_acute_vertices($polygon);
+ is scalar(@$polygon), 4, 'polygon_remove_acute_vertices';
+
+ use Slic3r::SVG;
+ #pop @$polygon;
+ Slic3r::SVG::output(undef, "vert.svg",
+ polylines => [$polygon],
+ );
+}
+
+#==========================================================
+
+{
+ my $polygon = [
+ [226.5447881,701.3509857], [260.6221146,681.67643], [109.872115,420.5697705], [149.4771522,397.7037948],
+ [300.2271522,658.8104548], [308.3252364,654.135024],
+ ];
+ polyline_remove_acute_vertices($polygon);
+ is scalar(@$polygon), 6, 'polyline_remove_acute_vertices';
+ use Slic3r::SVG;
+ local $Slic3r::resolution = 0.1;
+ pop @$polygon;
+ Slic3r::SVG::output(undef, "vert2.svg",
+ polylines => [$polygon],
+ );
+}
+
+#========================================================== \ No newline at end of file