Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is any idea to enhance the longitude of mesh model which extract from solid 3D?

0 REPLIES 0
Reply
Message 1 of 1
moonlikestoneBX57A
142 Views, 0 Replies

Is any idea to enhance the longitude of mesh model which extract from solid 3D?

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?

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report