mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-20 20:22:09 +00:00
Substitute tiny trimmed curves with linear approximation when deflection within tolerance
This commit is contained in:
@@ -983,8 +983,22 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcSweptDiskSolid* l, TopoDS_Shap
|
||||
{
|
||||
gp_Pnt directrix_origin;
|
||||
gp_Vec directrix_tangent;
|
||||
TopExp_Explorer exp(wire, TopAbs_EDGE);
|
||||
TopoDS_Edge edge = TopoDS::Edge(exp.Current());
|
||||
|
||||
TopoDS_Edge edge;
|
||||
|
||||
// Find first edge
|
||||
TopoDS_Vertex v0, v1;
|
||||
TopExp::Vertices(wire, v0, v1);
|
||||
TopTools_IndexedDataMapOfShapeListOfShape map;
|
||||
TopExp::MapShapesAndAncestors(wire, TopAbs_VERTEX, TopAbs_EDGE, map);
|
||||
TopTools_ListOfShape edges;
|
||||
if (map.FindFromKey(v0, edges) && edges.Extent() == 1) {
|
||||
edge = TopoDS::Edge(edges.First());
|
||||
} else {
|
||||
Logger::Error("Unable to locate first edge of:", l->Directrix()->entity);
|
||||
return false;
|
||||
}
|
||||
|
||||
double u0, u1;
|
||||
Handle(Geom_Curve) crv = BRep_Tool::Curve(edge, u0, u1);
|
||||
crv->D1(u0, directrix_origin, directrix_tangent);
|
||||
|
||||
Reference in New Issue
Block a user