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
|
||||
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';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue