View Full Version : How to find the XYZ intersection of a line with a 3D Polyline

14th Sep 2010, 12:42 pm
I am putting together a lisp routine to automate the creation of a road out of a quarry.

As part of the routine I am using polar to create a line ( a temporary construction line with no specific Z value) from a point at a known angle and default distance (greater than any possible distance to the 3D polyline), towards a 3D Polyline with which there is an intersection.

My problem is that I need to find the XYZ value of the intersection.

I have yet to start on the code for this in the hope that the wheel has already been invented.

My thoughts are that;
1) I need to cycle through the 3d polyline to find the 'inters' on a 2D basis of the segment that intersects the line.
2) Having that 3d segment and the intersection point, calculate the gradient of the segment and the Z value at the intersection.

Do I need to re-invent the wheel?

Many thanks.

14th Sep 2010, 02:45 pm
You can either use the inters function or you could use vla-intersectwith (look it up in the VLisp Developer's Help).