mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 13:02:39 -07:00
Test triangulate2() instead of the faulty triangulate()
This commit is contained in:
@@ -244,7 +244,7 @@ ExPolygon::triangulate(Polygons* polygons) const
|
||||
{
|
||||
// first make trapezoids
|
||||
Polygons trapezoids;
|
||||
this->get_trapezoids(&trapezoids);
|
||||
this->get_trapezoids2(&trapezoids);
|
||||
|
||||
// then triangulate each trapezoid
|
||||
for (Polygons::iterator polygon = trapezoids.begin(); polygon != trapezoids.end(); ++polygon)
|
||||
|
||||
@@ -134,7 +134,7 @@ is $expolygon->area, 100*100-20*20, 'area';
|
||||
}
|
||||
|
||||
{
|
||||
my $triangles = $expolygon->triangulate;
|
||||
my $triangles = $expolygon->triangulate2;
|
||||
is scalar(@$triangles), 8, 'expected number of triangles';
|
||||
is sum(map $_->area, @$triangles), $expolygon->area, 'sum of triangles area equals original expolygon area';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user