Defining custom boundaries on a surface

Technical discussions
Post Reply
Mark Lottier
Posts: 2
Joined: Thu Oct 29, 2020 5:25 am

Defining custom boundaries on a surface

Post by Mark Lottier »

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

Prashant Kande
Posts: 121
Joined: Mon Apr 04, 2016 4:55 am

Re: Defining custom boundaries on a surface

Post by Prashant Kande »

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

Mark Lottier
Posts: 2
Joined: Thu Oct 29, 2020 5:25 am

Re: Defining custom boundaries on a surface

Post by Mark Lottier »

Thank you, Prashant
How can I get mesh for the face?

Prashant Kande
Posts: 121
Joined: Mon Apr 04, 2016 4:55 am

Re: Defining custom boundaries on a surface

Post by Prashant Kande »

Use

Code: Select all

IGeometry_DG iGeom = iEntity.SetGeometryType("Mesh");
IMesh mesh = iGeom as IMesh;
See more about controlling its density in this thread

Post Reply