Page 1 of 1

Defining custom boundaries on a surface

Posted: Thu Oct 29, 2020 5:32 am
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

Re: Defining custom boundaries on a surface

Posted: Thu Nov 05, 2020 3:31 am
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

Re: Defining custom boundaries on a surface

Posted: Thu Nov 05, 2020 5:32 am
by Mark Lottier
Thank you, Prashant
How can I get mesh for the face?

Re: Defining custom boundaries on a surface

Posted: Mon Nov 09, 2020 4:56 am
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