For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

3d Curve Intersections

Matt Schmulen's picture
Forums: 

Im trying to intesect 2 curves

I construct my 2 curves

Handle(Geom_Curve) curve1 = BRep_Tool::Curve(E1, first, last);
Handle(Geom_Curve) curve2 = BRep_Tool::Curve(E2, first, last);

and then I construct ExtremaCC..

GeomAPI_ExtremaCurveCurve ecc(curve1, curve2);

then I check for NbExtrema to see if I have an intersection.

The problem is that this test returns false positives, that is the curves that I am intersecting are perpedicular to each other and do not interect with each other but the NbExtrema from the GeomAPI_ExtremaCurveCurve is 1, should I be using a different object for this, or query the GeomAPI_ExtremaCurveCurve class differently.

Any help is greatly appriciated

Thanks
Matt

Stephane Routelous's picture

Hi Matt,

an Extrema is NOT an intersection.
If you get the both computed points ( with NearestPoints ), you have an intersection if P1 == P2 ( I think ).
If not the extrema class is used to compute the minimum distance between 2 curves.

HTH

Stephane Routelous's picture

BTW, don't forget to put the u1min,u1max,u2min and u2max in the GeomAPI_ExtremaCC, because you can have unwanted result ( for example if you edges are done with complete circles just delimited with the parameters, it can happens that the both circles have an intersection, but your edges not )