Determine if point is an touch point or intersection point of curves


I am trying to determine if the intersection point of 2 bsplines, found by Geom2dAPI_InterCurveCurve is the touch point. Is there any method to do it?

Benjamin Bihler's picture

Hi Denys,

I have solved something similar for my purposes. You could locate your intersection points on both curves and then compute the curve tangents. Then the angle between both tangents should help you decide whether the curves just touch (obtuse angle?!) or cross each other.


Denys Senkin's picture

Sorry, but I don’t understand how angles could help - for example, if tangentots parallel, the angle could be 0 or 180 degrees, and in both cases the point will be touch point.

After some thinking, I realized, that if tangents are parallel, then it is touch point. Going to try it.

Eugeny's picture

Try obtaining the intersection points using the intersection tool, used in Geom2dAPI_InterCurveCurve - Geom2dAPI_InterCurveCurve::Intersector().Point(index). It will return the IntRes2d_IntersectionPoint, which has the information about transitions. For touching curves it should return the TOUCH transition.