Compare commits

...

1 Commits

Author SHA1 Message Date
Andrej730 6f6175c8c5 IfcGeom::util::is_manifold not to consider circles as manifold #4283
Investigating I've found that SvgSerializer with prefiltering enabled (after #3359) was ignoring representations that consisted only of a circle curves since it was considered manifold by `IfcGeom::util::is_manifold(s)` in https://github.com/IfcOpenShell/IfcOpenShell/blob/0e0678b926c34f2c28e69558959d3b29e51a50ec/src/serializers/SvgSerializer.h#L433 and topology explorer `TopExp_Explorer exp(s, TopAbs_FACE)` ignored that shape as it had no faces.

IfcGeom::util::is_manifold considered a full circle manifold since it was ignoring edges with `v0.IsSame(v1)` considering them manifold but in case of a full circle, circle is a TopoDS_Edge with both vertices at the same location but it also has a circle curve and I've added check for that.
2024-02-15 14:04:21 +05:00
+11 -3
View File
@@ -11,6 +11,7 @@
#include <gp_GTrsf2d.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Circle.hxx>
#include <Geom_OffsetSurface.hxx>
#include <ShapeAnalysis_Curve.hxx>
@@ -106,10 +107,17 @@ bool IfcGeom::util::is_manifold(const TopoDS_Shape& a) {
TopoDS_Vertex v0, v1;
TopExp::Vertices(e, v0, v1);
const bool degenerate = !v0.IsNull() && !v1.IsNull() && v0.IsSame(v1);
if (degenerate) {
continue;
// consider degenerate edges as manifold
if (!v0.IsNull() && !v1.IsNull()) {
if (v0.IsSame(v1)) {
// full circle curves have both verts match but still may be non-manifold
double dF, dL;
Handle(Geom_Curve) curve = BRep_Tool::Curve(TopoDS::Edge(e), dF, dL);
if (curve.IsNull() || dynamic_cast<Geom_Circle*>(curve.get()) == nullptr) {
continue;
}
}
}
if (map.FindFromIndex(i).Extent() != 2) {