63 boost::unit_test::data::make( RegressionTriangulationTests_tests ), relPath )
69 for(
ZONE* zone : m_board->Zones() )
71 if( zone->GetIsRuleArea() )
76 auto poly = zone->GetFilledPolysList( layer );
78 if( poly->OutlineCount() == 0 )
82 poly->IsTriangulationUpToDate(),
83 "Triangulation invalid for " + relPath +
" layer " +
LayerName( layer )
84 +
" zone " + zone->GetFriendlyName() +
" net '" + zone->GetNetname()
85 +
"' with " + std::to_string( poly->OutlineCount() )
86 +
" polygons at position " + std::to_string( poly->BBox().Centre().x )
87 +
", " + std::to_string( poly->BBox().Centre().y ) );
89 double area = poly->Area();
90 double tri_area = 0.0;
92 for(
int ii = 0; ii < poly->TriangulatedPolyCount(); ii++ )
94 const auto tri_poly = poly->TriangulatedPolygon( ii );
96 for(
const auto& tri : tri_poly->Triangles() )
97 tri_area += tri.Area();
100 double diff =
std::abs( area - tri_area );
104 "Triangulation area mismatch in " + relPath +
" layer "
106 +
" difference: " + std::to_string( diff ) );