From 43e6be9020199e6453653e1b041679679efee574 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 26 Feb 2020 00:55:07 +0100 Subject: [PATCH] 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 --- src/Mod/Part/App/TopoShape.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index b63c1a6a62..bb99412635 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -3224,8 +3224,14 @@ void TopoShape::getDomains(std::vector& 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