Split curve

I have a curve that have some self intersection points and so will have closed loops.
Each self intersection point will have two parameters.
How can I find both of them?
I want to use this to eliminate the closed loop by spliting the curve at each two parameters of self intersected point.

Rob Bachrach's picture

Although I've never tried these myself, after looking through the
documentation, I found three things you might want to look at:
Geom2dAPI_InterCurveCurve will work on a 2D curve. It won't give you
the parameters, but it will give you curves already created for each
of the segments.
ShapeAnalysis_Wire::CheckSelfIntersectingEdge can help to find the
intersection points.
ShapeFix_Wire::FixSelfIntersection may fix the curve for you. I'm
not sure what it does to "fix" the wire.

Good luck

Susan's picture

Hi Rob Bachrach,
Thank you for your response.
Yes I can get just the (in self interseted curve) points.
How can I get both parameter of this point.

Rob Bachrach's picture

Personally, I don't know how this can work as you could have any
number of self intersections at a point, but if you look at
ShapeAnalysis_Wire::CheckSelfIntersectingEdge, it returns a sequence
of intersection points. An IntRes2d_IntersectionPoint has two
functions (ParamOnFirst and ParamOnSecond) that I think will give
you the parameters for the intersections. You may need to turn your
curve into an edge if it is not already one.

The other option, once you have the points, is to use
Geom2dAPI_ProjectPointOnCurve(2D) or GeomAPI_ProjectPointOnCurve(3D)
to find the parameters of those points on your curve.