mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 15:44:12 -06:00
Test triangulate2() instead of the faulty triangulate()
This commit is contained in:
parent
2720000a17
commit
19fdf9b184
2 changed files with 2 additions and 2 deletions
|
@ -244,7 +244,7 @@ ExPolygon::triangulate(Polygons* polygons) const
|
||||||
{
|
{
|
||||||
// first make trapezoids
|
// first make trapezoids
|
||||||
Polygons trapezoids;
|
Polygons trapezoids;
|
||||||
this->get_trapezoids(&trapezoids);
|
this->get_trapezoids2(&trapezoids);
|
||||||
|
|
||||||
// then triangulate each trapezoid
|
// then triangulate each trapezoid
|
||||||
for (Polygons::iterator polygon = trapezoids.begin(); polygon != trapezoids.end(); ++polygon)
|
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 scalar(@$triangles), 8, 'expected number of triangles';
|
||||||
is sum(map $_->area, @$triangles), $expolygon->area, 'sum of triangles area equals original expolygon area';
|
is sum(map $_->area, @$triangles), $expolygon->area, 'sum of triangles area equals original expolygon area';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue