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-11-27 14:40:03 +0400
committerAlessandro Ranellucci <aar@cpan.org>2011-11-30 19:07:31 +0400
commitd51a37a0ae1d27f2336e97284fb5852f0f204e4a (patch)
tree497827cca01eeccbf541abd483962c7412bc62e7 /t/geometry.t
parent15d060019ff07bfde42ed742053efd7feb54c5cf (diff)
Refactoring: moved slicing code to new TriangleMesh class, leaving in STL just what's needed to read that particular input format. Slic3r will now warn if model is not manifold. #16
Diffstat (limited to 't/geometry.t')
-rw-r--r--t/geometry.t33
1 files changed, 18 insertions, 15 deletions
diff --git a/t/geometry.t b/t/geometry.t
index cd06d6f37..bc81cb610 100644
--- a/t/geometry.t
+++ b/t/geometry.t
@@ -28,21 +28,24 @@ isnt Slic3r::Geometry::line_intersection($line1, $line2, 1), undef, 'line_inters
#==========================================================
-my $polyline = [
- [459190000, 5152739000], [147261000, 4612464000], [147261000, 3487535000], [339887000, 3153898000],
- [437497000, 3438430000], [454223000, 3522515000], [523621000, 3626378000], [627484000, 3695776000],
- [750000000, 3720147000], [872515000, 3695776000], [976378000, 3626378000], [1045776000, 3522515000],
- [1070147000, 3400000000], [1045776000, 3277484000], [976378000, 3173621000], [872515000, 3104223000],
- [827892000, 3095347000], [698461000, 2947261000], [2540810000, 2947261000], [2852739000, 3487535000],
- [2852739000, 4612464000], [2540810000, 5152739000],
-];
-
-# this points belongs to $polyline
-my $point = [2797980957.103410,3392691792.513960];
-
-is_deeply Slic3r::Geometry::polygon_segment_having_point($polyline, $point),
- [ [2540810000, 2947261000], [2852739000, 3487535000] ],
- 'polygon_segment_having_point';
+{
+ my $polyline = [
+ [459190000, 5152739000], [147261000, 4612464000], [147261000, 3487535000], [339887000, 3153898000],
+ [437497000, 3438430000], [454223000, 3522515000], [523621000, 3626378000], [627484000, 3695776000],
+ [750000000, 3720147000], [872515000, 3695776000], [976378000, 3626378000], [1045776000, 3522515000],
+ [1070147000, 3400000000], [1045776000, 3277484000], [976378000, 3173621000], [872515000, 3104223000],
+ [827892000, 3095347000], [698461000, 2947261000], [2540810000, 2947261000], [2852739000, 3487535000],
+ [2852739000, 4612464000], [2540810000, 5152739000],
+ ];
+
+ # this points belongs to $polyline
+ my $point = [2797980957.103410,3392691792.513960];
+
+ local $Slic3r::Geometry::epsilon = 1E-5;
+ is_deeply Slic3r::Geometry::polygon_segment_having_point($polyline, $point),
+ [ [2540810000, 2947261000], [2852739000, 3487535000] ],
+ 'polygon_segment_having_point';
+}
#==========================================================