mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
More elaborate shape fixing on face surface
This commit is contained in:
@@ -97,6 +97,9 @@
|
|||||||
|
|
||||||
#include <BRepLib_FindSurface.hxx>
|
#include <BRepLib_FindSurface.hxx>
|
||||||
|
|
||||||
|
#include <ShapeFix_Shape.hxx>
|
||||||
|
#include <ShapeExtend_MsgRegistrator.hxx>
|
||||||
|
|
||||||
#include "../ifcgeom/IfcGeom.h"
|
#include "../ifcgeom/IfcGeom.h"
|
||||||
|
|
||||||
#ifdef SCHEMA_HAS_IfcBSplineSurfaceWithKnots
|
#ifdef SCHEMA_HAS_IfcBSplineSurfaceWithKnots
|
||||||
@@ -352,12 +355,24 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& result)
|
|||||||
// For planar faces, Open Cascade generates p-curves on the fly.
|
// For planar faces, Open Cascade generates p-curves on the fly.
|
||||||
|
|
||||||
for (TopTools_ListIteratorOfListOfShape it(face_list); it.More(); it.Next()) {
|
for (TopTools_ListIteratorOfListOfShape it(face_list); it.More(); it.Next()) {
|
||||||
// Small chance there are multiple faces
|
ShapeFix_Shape sfs(it.Value());
|
||||||
const TopoDS_Face& face = TopoDS::Face(it.Value());
|
|
||||||
for (TopExp_Explorer exp2(face, TopAbs_EDGE); exp2.More(); exp2.Next()) {
|
Handle(ShapeExtend_MsgRegistrator) msg;
|
||||||
const TopoDS_Edge& edge = TopoDS::Edge(exp2.Current());
|
msg = new ShapeExtend_MsgRegistrator;
|
||||||
ShapeFix_Edge fix_edge;
|
sfs.SetMsgRegistrator(msg);
|
||||||
fix_edge.FixAddPCurve(edge, face, false, getValue(GV_PRECISION));
|
|
||||||
|
sfs.Perform();
|
||||||
|
it.Value() = sfs.Shape();
|
||||||
|
|
||||||
|
ShapeExtend_DataMapIteratorOfDataMapOfShapeListOfMsg jt(msg->MapShape());
|
||||||
|
for (; jt.More(); jt.Next()) {
|
||||||
|
Message_ListIteratorOfListOfMsg kt(jt.Value());
|
||||||
|
for (; kt.More(); kt.Next()) {
|
||||||
|
char* c = new char[kt.Value().Value().LengthOfCString() + 1];
|
||||||
|
kt.Value().Value().ToUTF8CString(c);
|
||||||
|
Logger::Notice(c, l);
|
||||||
|
delete[] c;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user