Cross multiply the x vector with the y vector to get ZYes, that is exactly what gc:Normal3Pts does.
Oh, I found that gile also has a gc:Coplanarp function in the same library found at https://gilecad.azurewebsites.net/Lisp.aspxYes! It works like a charm
This one should answer your question. :lol:Code - Auto/Visual Lisp: [Select]
You can also obtain the distance without the use of trans by simply calculating the dot product between the unit normal and a vector from a point in the plane to the given point, e.g.:Code - Auto/Visual Lisp: [Select]
) ;; Vector Dot Product - Lee Mac ;; Args: u,v - vectors in R^n ) ;; Unit Vector - Lee Mac ;; Args: v - vector in R^2 or R^3 ) ) ;; Vector Cross Product - Lee Mac ;; Args: u,v - vectors in R^3 (list ) )
(defun c:Test ()
(setq pt1 (list 0.0 0.0 1.0)
pt2 (list 100.00 10.00 1.0)
pt3 (list 10.00 100.0 1.0)
pti (list 200.0 200.0 0.0)
ptj (list 200.0 200.0 4.0)
)
(princ (strcat "\n. Distance pti to plane: " (rtos (disttoplane pti pt1 pt2 pt3) 2 3)))
(princ (strcat "\n. Distance ptj to plane: " (rtos (disttoplane ptj pt1 pt2 pt3) 2 3)))
(princ)
)
You can remove the abs from disttoplane function to get the same result.
Note that the plane can be orientated in two ways which will give you a positive or negative output.
So above or below might not be what you expect it to be.
But if you want to find the difference of pti and ptj, this should work fine.Code - Auto/Visual Lisp: [Select]