Guest Jreez Posted May 17, 2005 Share Posted May 17, 2005 I have a plane defined from ucs-world points: (1,1,0),(3.6,2,1),2.2,3.6,2) . It is intersected by the line defined by ucs-worlds points: (1.6,3.2,0.2) and(2.8,1.4,1.8 ). Im having trouble trying to manipulate the UCS in order to find the location of the piercing point, the true length of the line and slope. Its been a while since we went over this and its not coming back to me...your help is much appreciated Quote Link to comment Share on other sites More sharing options...
erona Posted May 18, 2005 Share Posted May 18, 2005 Hi Jreez, welcome to CTF! Your situation really made me ponder as I have never done anything like that before. I don't know what you are working on but I think I found a way (or at least my way) to do it. Type UCS, then New, then 3 for 3point. Just pick the three corners of your plane to make the UCS aligned to it. Next, we need to rotate the UCS 90 Quote Link to comment Share on other sites More sharing options...
fuccaro Posted May 18, 2005 Share Posted May 18, 2005 AutoCAD comes with a built in function for that. Draw first the line and also draw two lines to define the plane (you have 3 points for the plane, so draw lines from a point to the other two). How do you need to use the intersection? Probable you wish to place a point or start a line from or something. So start that command (POINT or LINE) and when AutoCAD prompts you for the point, enter 'CAL ILP(END,END,END,END,END) The cursor should change in a square. Pick first the two endpoints of the line, after that the 3 endpoints of the lines defining the plane. It is not so complicated as it sounds; ILP means Intersection between Line and Plane and it needs 5 arguments: the first two points to specify the line and more 3 points to determine the plane. Quote Link to comment Share on other sites More sharing options...
David Bethel Posted May 18, 2005 Share Posted May 18, 2005 If you full ACAD, this lisp will find the intesection point. You would have to set the UCS ( 3P ) prior to calling the function. ;;;INTERSECTION POINT OF A LINE AND THE CURRENT CS ;;;ARG -> 2 WCS Line Points ;;;RET -> 'LIST (point) or nil (defun int_line_plane (p1 p2 / tp1 tp2 ip) (setq tp1 (trans p1 0 1) tp2 (trans p2 0 1)) (if (setq ip (inters tp1 tp2 (list (car tp1) (cadr tp1) 0) (list (car tp2) (cadr tp2) 0) nil)) (setq ip (trans ip 1 0))) ip) Remember to reset the UCS afterwards. -David Quote Link to comment Share on other sites More sharing options...
BUrBaKy Posted May 13, 2013 Share Posted May 13, 2013 This is brilliant! Very helpfull! Quote Link to comment Share on other sites More sharing options...
albertsmith2021 Posted May 17, 2013 Share Posted May 17, 2013 Really amazing for us ....helpful a lot!! Quote Link to comment Share on other sites More sharing options...
lrm Posted July 12, 2013 Share Posted July 12, 2013 Here’s a method using vector math and Visual LISP to find the intersection of a line and a plane in 3D space. Assume the plane is defined by three points, P1, P2, and P3. The line is defined by two points L1, and L2. The first step is to define the plane by using a normal vector N (a line perpendicular to the plane) and a point on the plane (either P1, P2, or P3 will do). Using a cross product we can define the normal as: N = (P2-P1) cross (P3- p1) We will use a parametric definition for the line. That is, a point on the line P, is defined by two points on the line and an independent variable t. P = (1-t)*L1 + t*L2 Given a value for t and the coordinates of L1 and L2 we can find a point on the line that passes through L1 and L2. To find that value of t where the line intersects the plane (we will call it tk) we can use the following expression: tk = - ( N1 dot (L1 – P1)) / (N dot (L2 – L1)) where dot is the dot product of two vectors. Knowing tk, the point of intersection of the line and the plane PInt is: PInt = (1-tk) * L1 + tk * L2 or Pint = L1 – tk*(L2-L1) Here’s the code in VisualLISP with functions to compute the dot and cross product of two vectors. (defun c:PlaneLineIntersect (/) (setq osn (getvar "osmode")) ; save current OSNAP settings (command "ucs" "") ; change to the WCS (setvar "pdmode" 35) ; set point style to something you can see (setq P1 (getpoint "\n Enter 1st point on plane") P2 (getpoint "\n Enter 2nd point on plane") P3 (getpoint "\n Enter 3rd point on plane") L1 (getpoint "\n Enter point on one end of line") L2 (getpoint "\n Enter point on other end of line") ) ; Calculate plane normal N (setq N (cross (mapcar '- P2 P1) (mapcar '- P3 p1))) ; calculate tk (setq tk (- (/ (dot N (mapcar '- L1 P1)) (dot N (mapcar '- L2 L1))))) ; the point of intersection is (setq PInt (mapcar '+ L1 (mapcar '* (mapcar '- L2 L1) (list tk tk tk)))) ; draw a line from L1 to point of intersection (setvar "osmode" 0) ; first turn off OSNAP (command "line" L1 PInt "") (command "point" PInt "") (setvar "osmode" osn) ; set osnap back to original setting ) ;;; Compute the dot product of 2 vectors a and b (defun dot (a b / dd) (setq dd (mapcar '* a b)) (setq dd (+ (nth 0 dd) (nth 1 dd) (nth 2 dd))) ) ;end of dot ;;; Compute the cross product of 2 vectors (defun cross (a b / crs) (setq crs (list (- (* (nth 1 a) (nth 2 b)) (* (nth 1 b) (nth 2 a)) ) (- (* (nth 0 b) (nth 2 a)) (* (nth 0 a) (nth 2 b)) ) (- (* (nth 0 a) (nth 1 b)) (* (nth 0 b) (nth 1 a)) ) ) ) ) Quote Link to comment Share on other sites More sharing options...
JD Mather Posted July 12, 2013 Share Posted July 12, 2013 Autodesk Inventor has tools for this. Not limited to plane - could be pierce point of any vector through any organic surface. Quote Link to comment Share on other sites More sharing options...
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.