# intersecting 3D lines

5 messages
Open this post in threaded view
|

## intersecting 3D lines

 Sorry -being lazy- but is there code somewhere for computing the intersection, if any, of 2 3-d lines? Sent from the OpenSCAD mailing list archive at Nabble.com._______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: intersecting 3D lines

 In case no one has code... Not code but some formulas and videos can be found using Google "intersection of lines in 3D" https://socratic.org/questions/how-do-i-find-the-intersection-of-two-lines-in-three-dimensional-space https://math.stackexchange.com/questions/270767/find-intersection-of-two-3d-lines/271366 http://paulbourke.net/geometry/pointlineplane/calclineline.cs  has some code in C. I hope that this gets you started. On 2021-02-26 7:08 a.m., kitwallace wrote: Sorry -being lazy- but is there code somewhere for computing the intersection, if any, of 2 3-d lines? Sent from the OpenSCAD mailing list archive at Nabble.com. ```_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org ``` ```-- Ron Wheeler Artifact Software 438-345-3369 [hidden email]``` _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: intersecting 3D lines

 Thanks  - I used Pauls' code -  here it is in OpenSCAD in case anyone looks : function intersection (p1,p2,p3,p4,eps=0.0001) =    let (p13=p1-p3,           p43=p4-p3)           norm(p43)