mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 07:03:59 -06:00
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
This commit is contained in:
parent
15d060019f
commit
d51a37a0ae
16 changed files with 642 additions and 451 deletions
33
t/geometry.t
33
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';
|
||||
}
|
||||
|
||||
#==========================================================
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue