Hello
Is there a way to split a face with a curve?
Thanks
Cutting a face
-
- Posts: 121
- Joined: Mon Apr 04, 2016 4:55 am
Re: Cutting a face
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
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
-
- Posts: 2
- Joined: Thu Oct 13, 2022 2:55 am
Re: Cutting a face
Thank you
I will give it a try. I am sure I will have more questions
Russel
I will give it a try. I am sure I will have more questions
Russel