DiscussionsIssue archiveOther usage issues

Archived discussion

Point of Intersection Between Two Lines

Other usage issuesTue, 10/13/2015 - 17:222 replies

Browse this forum
QuestionAuthor

I have two gp_Lin elements (lin1 and lin2), and I know that they intersect in 3D space (the value of lin1.distance(lin2) is 0). Is there a function I can use to find the point at which they intersect instead of coding it all by hand (I could not find one)?

 

Thanks for any help!

Author

Discussion

2 archived replies

Posts are displayed in their archived order.

01Commenter-1

Hi Author,

It is always a challenge to find the intersection of 3d lines/curves, because of computational error.  You might be better served using something like GeomAPI_ExtremaCurveCurve to find the closest point.  You can then compare the distance to make sure it is within some tolerance of 0.  Then, simply take the extrema point from one of the curves.

Commenter-1

02Author

Yes, the solution you proposed seemed to work quite well. Thanks a lot!

Author