Hi,
I need to convert some surfaces which have holes and external edges to meshes. I see a way to create a surface. I have not figured out how to set the contours of holes and edges: The contours are bspline curves, lines, circle. How can I add these contours to the surface to get a mesh in the end?
Thank you,
Mark
Defining custom boundaries on a surface
-
- Posts: 121
- Joined: Mon Apr 04, 2016 4:55 am
Re: Defining custom boundaries on a surface
Hi Mark
You need to define an entity with BRep geometry, shape of which is a solid, which consists of a single face. A face basically is a surface with wires on it which define contours of edges and holes.
Shell case in Shape builder, implemented in ShellBuilder.CreateNewShell() shows the way. You need to decide sequences of curves for each wire. The external contour should go in CCW direction. The holes should go in CW direction.
The sample starts with creating vertices first. Their coordinates can be found by calculating intersections of consecutive curves (with ICurve_DGGetIntersection*()).
The sample creates structure first by using IBRepWire_DG.AddVertex() and IBRepWire_DG.CloseWire(). Geometry of the edges can be adjusted after that by calling IBRepEdge_DG.SetCurve().
There are other methods of defining edges and wires. Have a look at the Face sample
You need to define an entity with BRep geometry, shape of which is a solid, which consists of a single face. A face basically is a surface with wires on it which define contours of edges and holes.
Shell case in Shape builder, implemented in ShellBuilder.CreateNewShell() shows the way. You need to decide sequences of curves for each wire. The external contour should go in CCW direction. The holes should go in CW direction.
The sample starts with creating vertices first. Their coordinates can be found by calculating intersections of consecutive curves (with ICurve_DGGetIntersection*()).
The sample creates structure first by using IBRepWire_DG.AddVertex() and IBRepWire_DG.CloseWire(). Geometry of the edges can be adjusted after that by calling IBRepEdge_DG.SetCurve().
There are other methods of defining edges and wires. Have a look at the Face sample
-
- Posts: 2
- Joined: Thu Oct 29, 2020 5:25 am
Re: Defining custom boundaries on a surface
Thank you, Prashant
How can I get mesh for the face?
How can I get mesh for the face?
-
- Posts: 121
- Joined: Mon Apr 04, 2016 4:55 am
Re: Defining custom boundaries on a surface
Use
See more about controlling its density in this thread
Code: Select all
IGeometry_DG iGeom = iEntity.SetGeometryType("Mesh");
IMesh mesh = iGeom as IMesh;