Face from triangulation

Technical discussions
Post Reply
Joaquin_
Posts: 2
Joined: Wed Jul 06, 2022 7:06 am

Face from triangulation

Post by Joaquin_ »

Hello,

I'm trying to build a DGKC model by converting a mesh object. It looks like IBRepBuilder_DG has the methods to build a wire from a triangle edges and a face using IBRepBuilder_DG.CreateFace7().

I am wondering is there a way to merge two adjascent faces and remove the internal edge? In other words, is it possible to build a surface from a mesh?

Thank you
Regards

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

Re: Face from triangulation

Post by Prashant Kande »

Hi Joaquin.

Generally mesh to brep conversion involves manual work. There is no general method.

What you are asking sounds more specific. Like: Given a patch of smooth meshed surface convert it to a brep face. It still can be challenging. I will give just general pointers.

If the mesh is planar it is easy by building a wire from the outer contour and using IBRepBuilder_DG.CreateFace7().

Generally to merge two faces you need both to share the same underlying surface.

For a relatively simple patch (a stretched and bent rectangle) the surface can be found by approximation like it is done in the DiffSurface sample.

To define the wire, select three or more segmented curves lying on the mesh. Fit bspline curves into them using IBSplineCurveInterpolator_DG.
The curves should be projected to the surface. Please check out Face sample for that.

Build edges for the curves by creating an edge and calling IBRepEdge_DG.SetCurve() for it. Add them to the wire. Add the wire to the face.

Good luck

Joaquin_
Posts: 2
Joined: Wed Jul 06, 2022 7:06 am

Re: Face from triangulation

Post by Joaquin_ »

Thank you, Prashant
I will try that. I will probably have questions on the way

Post Reply