Part: [skip ci] the number of domains returned by TopoShape::getDomains must match with number of faces

If a face cannot be meshed then an empty domain is added
This commit is contained in:
wmayer
2020-02-26 00:55:07 +01:00
parent a6b22b3251
commit 43e6be9020

View File

@@ -3224,8 +3224,14 @@ void TopoShape::getDomains(std::vector<Domain>& domains) const
TopLoc_Location loc;
Handle(Poly_Triangulation) theTriangulation = BRep_Tool::Triangulation(face, loc);
if (theTriangulation.IsNull())
if (theTriangulation.IsNull()) {
// For a face that cannot be meshed append an empty domain.
// It's important for some algorithms (e.g. color mapping) that the numbers of
// faces and domains match
Domain domain;
domains.push_back(domain);
continue;
}
Domain domain;
// copy the points