select part of curve for trimming

Hi everyone,

I want to make a function to trim a curve based on intersection with another curve. What user need to do is to select the first curve to trim, select the second curve to intersect, and then click on any location. The location will be used to determine which part of the first curve to delete. Here is an ilustration.

Suppose we have curves C1 (-20,0,0)-(100,0,0) and C2 (0,-20,0)-(0,100,0). These curves intersect at a point P (0,0,0). If user click on C1 and then C2 and then click on a location near negative part of C1, say a location that correspond to point (-5,5,5), then the curve C1 will be trimmed into curve C3 (0,0,0)-(100,0,0).

I have been able to make intersection point by using GeomAPI_ExtremaCurveCurve. The problem is, how to correspond a mouse position into 3D point, and then to select part of curve? Or anybody has a better approach?

Thanks for your response.

P Dolbey's picture