Page 1 of 1

Cutting a face

Posted: Thu Oct 13, 2022 2:58 am
by Russell 22
Hello

Is there a way to split a face with a curve?
Thanks

Re: Cutting a face

Posted: Thu Oct 13, 2022 7:51 pm
by Prashant Kande
Hi Russel

There is no off the shelf api for that. You need to do a bit of coding.

It can be done either by extruding somehow the curve to a surface and building a solid form it for Boolean operations. But I think it is easier to do it at low level:

Get the surface of the face and use IUVSurface_DG.GetCurveProjection() and IUVSurface_DG.GetCurveUVProjection() to get a curve which lies exactly on the surface and its pcurve (the definition in uv parameters).

Get also pcurves for all edges of the face. So you would have a 2d curved polygon and another curve in 2d space of parameters.

Use ICurve2d_DG to find the intersecting edges and the intersection points. Use ICurve2d_DG.SetParameterRange(() to trim the intersecting pcurves of the edges and the cutting curve.

Build a new face (or modify the initial one) by reusing the surface and new curves with something like IBRepFace_DG.AddNewWire(), IBRepWire_DG.AddNewEdge(), IBRepEdge_DG.SetPCurve()

Cheers

Re: Cutting a face

Posted: Mon Oct 17, 2022 2:00 am
by Russell 22
Thank you
I will give it a try. I am sure I will have more questions
Russel