diff --git a/src/ifcgeom/IfcGeomFaces.cpp b/src/ifcgeom/IfcGeomFaces.cpp index 3b30fd9eb7..41379ea7b7 100644 --- a/src/ifcgeom/IfcGeomFaces.cpp +++ b/src/ifcgeom/IfcGeomFaces.cpp @@ -234,11 +234,10 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& face) { process_wire: if (face_surface.IsNull()) { - if (count(wire, TopAbs_EDGE) > 128) { + gp_Pln pln; + if (count(wire, TopAbs_EDGE) > 128 && approximate_plane_through_wire(wire, pln)) { // tfk: optimization find the underlying surface ourselves since it's going // to be planar in IFC if no explicit surface is given. Should we always do this? - gp_Pln pln; - approximate_plane_through_wire(wire, pln); mf = new BRepBuilderAPI_MakeFace(pln, wire, true); } else { mf = new BRepBuilderAPI_MakeFace(wire); @@ -261,7 +260,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& face) { // In case of (non-planar) face surface, p-curves need to be computed. // For planar faces, Open Cascade generates p-curves on the fly. - if (!face_surface.IsNull()) { + if (!face_surface.IsNull() && face_surface->DynamicType() != STANDARD_TYPE(Geom_Plane)) { TopExp_Explorer exp(outer_face_bound, TopAbs_EDGE); for (; exp.More(); exp.Next()) { const TopoDS_Edge& edge = TopoDS::Edge(exp.Current()); diff --git a/src/ifcgeom/IfcGeomFunctions.cpp b/src/ifcgeom/IfcGeomFunctions.cpp index 65d9c0f790..420a2653a4 100644 --- a/src/ifcgeom/IfcGeomFunctions.cpp +++ b/src/ifcgeom/IfcGeomFunctions.cpp @@ -3381,7 +3381,7 @@ bool IfcGeom::Kernel::wire_intersections(const TopoDS_Wire& wire, TopTools_ListO TopoDS_Edge e = wd->Edge(k + 1); TopoDS_Vertex v1, v2; - TopExp::Vertices(e, v1, v2); + TopExp::Vertices(e, v1, v2, true); const TopoDS_Vertex* v = first == forward ? &v2 : &v1; // gp_Pnt p2 = points3d.Value(1);