Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Line tangent to 3D spline?

Hi All,
Is there a way to draw a line tangent to a 3D spline at some arbitrary point on the spline?


  • You can draw a line Perpendicular to a 3d spline in a specific plane, then perp to that in the intersection.
    You really need to know what plane you want the tangent in. Set the UCS the align your view.

  • edited August 26

    Here is some Lisp code:

    (defun KGA_Geom_VectorScale (vec scl)
      (mapcar '(lambda (a) (* a (float scl))) vec)
    (defun KGA_Geom_VectorUnit (vec / mag)
      (if (/= 0.0 (setq mag (distance '(0.0 0.0 0.0) vec)))
        (KGA_Geom_VectorScale vec (/ 1.0 mag))
    (defun c:DrawTangent ( / doc enm len pt vec)
      (setq doc (vla-get-activedocument (vlax-get-acad-object)))
      (vla-endundomark doc)
      (vla-startundomark doc)
          (setq enm (car (entsel "\nSelect curve: ")))
          (setq pt (getpoint "\nPick point on curve: "))
          (setq pt (vlax-curve-getclosestpointto enm pt))
          (setq len (getdist "\nLength of line: "))
            vec (KGA_Geom_VectorUnit (vlax-curve-getfirstderiv enm (vlax-curve-getparamatpoint enm pt)))
            vec (KGA_Geom_VectorScale vec (/ len 2.0))
              '(0 . "LINE")
              (cons 10 (mapcar '- pt vec))
              (cons 11 (mapcar '+ pt vec))
      (vla-endundomark doc)
  • Here is some Lisp code: [snip]


    One of these days I really need to sit down to go through the VLAX- and associated documentation...

Sign In or Register to comment.
Origami is the Japanese word for paper folding. ORI means to fold and KAMI means paper and involves the creation of paper forms usually entirely by folding.

Powered by VanillaForums, Designed by Steam