Hi,
I try to exact the solid 3d of a circular pipe into the mesh model, but the mesh model is shown as a square pipe.
The exact code is shown as the following:
using (BrepAPI.Brep brep = new BrepAPI.Brep(solid))
{
using (BrepAPI.Mesh2dControl mc = new BrepAPI.Mesh2dControl())
{
mc.MaxNodeSpacing = length;
mc.MaxSubdivisions = 1;
using (BrepAPI.Mesh2dFilter mf = new BrepAPI.Mesh2dFilter())
{
mf.Insert(brep, mc);
using (BrepAPI.Mesh2d m = new BrepAPI.Mesh2d(mf))
{
Dictionary<acadGeo.Point3d,IfcCartesianPoint> pts = new Dictionary<acadGeo.Point3d,IfcCartesianPoint>();
foreach (BrepAPI.Element2d e in m.Element2ds)
{
//New
foreach (BrepAPI.Node n in e.Nodes)
{
if (pts.ContainsKey(n.Point))
continue;
pts.Add(n.Point, Create3DPoint(model, n.Point.X, n.Point.Y, n.Point.Z));
n.Dispose();
}
e.Dispose();
}
foreach (BrepAPI.Element2d e in m.Element2ds)
{
var loop = model.Instances.New<IfcPolyLoop>();
foreach (BrepAPI.Node n in e.Nodes)
{
loop.Polygon.Add(pts[n.Point]);
}
IfcFaceOuterBound outerBound = CreateFaceOuterBound(model, loop);
IfcFace face = CreateFace(model, outerBound);
closedShell.CfsFaces.Add(face);
}
}
}
}
}
Is any idea to enhance the longitude of mesh model which extract from solid 3D?