From a4532cc7222742b4e0b8e28b404725204d3e01d8 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Wed, 3 Jul 2024 20:03:06 +0200 Subject: [PATCH] Remove assumptions on solid topology in SVG camera frustrum detection #4924 --- src/serializers/SvgSerializer.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/serializers/SvgSerializer.cpp b/src/serializers/SvgSerializer.cpp index 1db8f772da..86e5681ae3 100644 --- a/src/serializers/SvgSerializer.cpp +++ b/src/serializers/SvgSerializer.cpp @@ -434,6 +434,12 @@ namespace { }; boost::optional box_from_compound(TopoDS_Shape& compound) { + /* + // in v0.8 apparently we don't get a solid/shell anymore because + // we no longer use PrimAPI, but rather resolve the box to an + // explicit shell with 6 faces in the mapping, which - depending + // on settings - may remain solely a compound of 6. + TopExp_Explorer exp(compound, TopAbs_SHELL); TopoDS_Shell shell; if (exp.More()) { @@ -446,12 +452,14 @@ namespace { else { return boost::none; } + */ + auto& shell = compound; if (IfcGeom::util::count(shell, TopAbs_FACE) != 6) { return boost::none; } - TopoDS_Iterator it(shell); + TopExp_Explorer it(shell, TopAbs_FACE); for (; it.More(); it.Next()) { const auto& face = TopoDS::Face(it.Value()); auto surf = BRep_Tool::Surface(face);