Check boolean result manifoldness for shells individually. Fixes #516.

This commit is contained in:
Thomas Krijnen
2018-12-08 10:37:54 +01:00
parent 747ddeb20c
commit 8c0c216a1d
+18 -8
View File
@@ -235,16 +235,26 @@ namespace {
} }
bool is_manifold(const TopoDS_Shape& a) { bool is_manifold(const TopoDS_Shape& a) {
TopTools_IndexedDataMapOfShapeListOfShape map; if (a.ShapeType() == TopAbs_COMPOUND) {
TopExp::MapShapesAndAncestors(a, TopAbs_EDGE, TopAbs_FACE, map); TopoDS_Iterator it(a);
for (; it.More(); it.Next()) {
for (int i = 1; i <= map.Extent(); ++i) { if (!is_manifold(it.Value())) {
if (map.FindFromIndex(i).Extent() != 2) { return false;
return false; }
} }
} return true;
} else {
TopTools_IndexedDataMapOfShapeListOfShape map;
TopExp::MapShapesAndAncestors(a, TopAbs_EDGE, TopAbs_FACE, map);
return true; for (int i = 1; i <= map.Extent(); ++i) {
if (map.FindFromIndex(i).Extent() != 2) {
return false;
}
}
return true;
}
} }
bool is_manifold(const TopTools_ListOfShape& l) { bool is_manifold(const TopTools_ListOfShape& l) {