Trimming a 2D curve with another *please help*

OCC is new to me and I am experimenting to see how difficult it will be to use OCC for a 2D sketcher application that I am writing. I wanted to cut/trim one 2D curve with another, which should result in multiple curves. However, I'm not sure how to go about this. I didn't see an example in the OCC samples, so I'm hoping for some help with this.

Currently, I have a small chunk of code that uses the Geom2dAPI_InterCurveCurve class to intersect the two curves, but I'm not sure what to do with the resulting intersection points. It seems like I need to take these 2D intersection points and find the corresponding parameter value on the curve to be trimmed, but I'm not sure how to do this.

Moreno's picture

Hi, i know it's late but i was also looking for similar things, especially find the parameters
of the curves at intersection points.

You do an intersection like this i think :
Geom2dAPI_InterCurveCurve inter(cruve2d_1,curve2d_2);

//and you can find parameters like this
double param1 = inter.Intersector().Point(1).ParamOnFirst(); //parameter on the first curve
double param2 = inter.Intersector().Point(1).ParamOnSecond(); // parameter on the second curve