Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Skew lines -shortest distance

24 REPLIES 24
SOLVED
Reply
Message 1 of 25
klosow
3092 Views, 24 Replies

Skew lines -shortest distance

Hello I create the LISP script (attached) to find the shortest distance between two skew lines.

Finnally, I want to draw a segment which represents this shortest distance. It should be a line between apperen intersections of:  PR1 and PR2 lines and PR2 and PR1 lines (on the screen they will be visible in the same point). Lines were indicated before, so I want to write proper LISP expression without indicating them again. What is proper form of line command?

(command "_line"  ???????? "")

Pawel Klosowski

 

24 REPLIES 24
Message 21 of 25
stevor
in reply to: pbejse

Kent's code worked for me, after the point values were stored in WCS form and translated to UCS as needed. At least it matched the solutions from INT2.lsp of http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline3d/int2.lsp.
S
Message 22 of 25
pbejse
in reply to: stevor

Yup, both codes work from  Kent and Gatsy. two different approach same result Smiley Happy

wanted to do one myself, but as you can see...  Smiley Sad

 

well, learn new things everyday.

 

 

 

 

 

 

Message 23 of 25
stevor
in reply to: pbejse

And I got Gasty's version to work by translating the 10 and 11 point data to UCS.
S
Message 24 of 25
diagodose2009
in reply to: klosow


Hello.Pawel Klosowski.
I recompile your lisp into Visual C++ObjectARX..
I convert lisp to C++LISP..
I transform C++LISP into C++ObjectARX
Please send to me, the drawing file for testing , the lisp programs..at adress .. see a1.zip
I need DRAWING FILE for testing programme LISP and C++ObjectARX.
Alles gutes..
Message 25 of 25
stevor
in reply to: diagodose2009

1 Attached zip should have 2 dwgs, 2K format: 2 skewed lines, and the same with a Closest Point of Approach line. 2. For recodeing into faster languages, you might consider using the methods that do not involve changing the coordinate system.
S

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost