Page 1 of 1

Tangential vs intersection curves

Posted: Mon Oct 14, 2024 2:56 am
by Sanjay Kumar
Hi,

I have built two 2d bspline curves as IBSplineCurve2d_DG. I need to find its intersection points. It is also important to check whether the intersections are a touch or regular. Is there any method to do it?

Thanks

Re: Tangential vs intersection curves

Posted: Tue Oct 15, 2024 1:12 am
by Ben Davidson
It is pretty simple.

Query ICurve2d_DG out of the IBSplineCurve2d_DG. IBSplineCurve2d_DG has two GetIntersection() methods.

It looks like the second version should suit your better. The method returns 0 is there is no intersection or the number of them. The intersections themselves are returned via ISetR1_DG, which is an array of ranges. Normally all ranges are singletons (min == max). flagsTangential is an array of same size as the other two arrays.
flagsTangential[k] will be true if the k-th intersection was tangential.