mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
Fixes for edge curves and non-planar faces with inner boundaries. #338
This commit is contained in:
@@ -320,6 +320,17 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& face) {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
mf->Add(wire);
|
mf->Add(wire);
|
||||||
|
|
||||||
|
// Same as above:
|
||||||
|
// In case of (non-planar) face surface, p-curves need to be computed.
|
||||||
|
if (BRep_Tool::Surface(mf->Face())->DynamicType() != STANDARD_TYPE(Geom_Plane)) {
|
||||||
|
TopExp_Explorer exp(wire, TopAbs_EDGE);
|
||||||
|
for (; exp.More(); exp.Next()) {
|
||||||
|
const TopoDS_Edge& edge = TopoDS::Edge(exp.Current());
|
||||||
|
ShapeFix_Edge fix_edge;
|
||||||
|
fix_edge.FixAddPCurve(edge, mf->Face(), false, getValue(GV_PRECISION));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
processed ++;
|
processed ++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -715,7 +715,11 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcEdgeCurve* l, TopoDS_Wire& res
|
|||||||
const bool is_bounded = l->EdgeGeometry()->is(IfcSchema::Type::IfcBoundedCurve);
|
const bool is_bounded = l->EdgeGeometry()->is(IfcSchema::Type::IfcBoundedCurve);
|
||||||
|
|
||||||
if (!is_bounded && convert_curve(l->EdgeGeometry(), crv)) {
|
if (!is_bounded && convert_curve(l->EdgeGeometry(), crv)) {
|
||||||
mw.Add(BRepBuilderAPI_MakeEdge(crv, p1, p2));
|
BRepBuilderAPI_MakeEdge me(crv, p1, p2);
|
||||||
|
if (!me.IsDone()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
mw.Add(me.Edge());
|
||||||
result = mw;
|
result = mw;
|
||||||
return true;
|
return true;
|
||||||
} else if (is_bounded && convert_wire(l->EdgeGeometry(), result)) {
|
} else if (is_bounded && convert_wire(l->EdgeGeometry(), result)) {
|
||||||
@@ -745,7 +749,11 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcEdgeCurve* l, TopoDS_Wire& res
|
|||||||
ecrv->D0(u1, a);
|
ecrv->D0(u1, a);
|
||||||
b = p2;
|
b = p2;
|
||||||
} else {
|
} else {
|
||||||
mw.Add(BRepBuilderAPI_MakeEdge(ecrv, u1, u2));
|
BRepBuilderAPI_MakeEdge me(ecrv, u1, u2);
|
||||||
|
if (!me.IsDone()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
mw.Add(me.Edge());
|
||||||
first = false;
|
first = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -776,7 +784,10 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcEdgeLoop* l, TopoDS_Wire& resu
|
|||||||
mw.Add(TopoDS::Edge(TopoDS_Iterator(w).Value()));
|
mw.Add(TopoDS::Edge(TopoDS_Iterator(w).Value()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = mw;
|
if (!mw.IsDone()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
result = mw.Wire();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user