giskumar Posted January 4, 2013 Posted January 4, 2013 Hi all, I would like to find the intersection point between below 3D Lines Line1: (5.0,5.0,8.0) (10.0,10.0,5.0) Line2: (5.0,5.0,4.0) (10.0,10.0,6.0) Please any one let me know how can i find the intersection point(3D) between these Lines. Regards, Kumar. Quote
Stefan BMR Posted January 4, 2013 Posted January 4, 2013 (setq l1 (entmakex '((0 . "LINE") (10 5.0 5.0 8.0) (11 10.0 10.0 5.0))) l2 (entmakex '((0 . "LINE") (10 5.0 5.0 4.0) (11 10.0 10.0 6.0))) ) (vlax-invoke (vlax-ename->vla-object l1) 'IntersectWith (vlax-ename->vla-object l2) acExtendBoth ;or acExtendNone ) Quote
hmsilva Posted January 4, 2013 Posted January 4, 2013 another way: (setq p1 '(5.0 5.0 8.0) p2 '(10.0 10.0 5.0) p3 '(5.0 5.0 4.0) p4 '(10.0 10.0 6.0) ) (setq intpoint (inters p1 p2 p3 p4 nil)) Henrique Quote
giskumar Posted January 4, 2013 Author Posted January 4, 2013 Thanks for the reply. I thought these functions works on 2D only, It is good to here also works on 3D lines. Quote
BIGAL Posted January 5, 2013 Posted January 5, 2013 A bit more Inters is the original or plain jane lisp intersection command and intesectwith is the newer Vl version I would go down the VL version, intersectwith has 4 options that can be included as part of the test for an intersection, inters has 1 true or false. Intesectwith can calculate an intersection even if the lines do not cross calculating the new pt. Quote
gS7 Posted January 5, 2013 Posted January 5, 2013 (edited) Check this And I am sure You will Learn from this Site http://www.lee-mac.com/intersectionfunctions.html Edited January 5, 2013 by gS7 Quote
BIGAL Posted January 6, 2013 Posted January 6, 2013 This may be a little undocumented but a time saver when typing you can replace intersect mode with 0 1 2 3 Quote
Lee Mac Posted January 6, 2013 Posted January 6, 2013 This may be a little undocumented but a time saver when typing you can replace intersect mode with 0 1 2 3 All enumerations will evaluate to either an integer or some other constant data type - hence the name; the protected symbol is merely used to give some meaning to an otherwise 'magic number' e.g. (eval acbylayer) = 256. I strongly disagree with your suggested 'timesaver' as it will render code unreadable and completely defeats the self-documenting purpose of the enumeration symbol. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.