uli Posted February 14, 2013 Posted February 14, 2013 Hi guys, It's about a play with parametric equations...trying to obtain a torr...and the result is strange for me, i cannot get real dimensions for the torr..i don't understand why...any help? Sorry for my lisp, looks like hell.. (defun c:tor ( / R r x y z plist );torr ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun randnum (/ ) (if (not seed) (setq seed (getvar "DATE"))) (setq modulus 65536 multiplier 25173 increment 13849 seed (rem (+ (* multiplier seed) increment) modulus) random (/ seed modulus))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun point (xplist) (setq i 0) (repeat (length xplist) (entmakex (list(cons 0 "POINT") (cons 100 "AcDbEntity") (cons 67 0) (cons 8 "0") (cons 100 "AcDbPoint") (cons 10 (nth i xplist)) (cons 62 256) (cons 50 0) ) ) (setq i (1+ i)) )) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq x 10000) (if (and (setq R (getreal "\n R=")) (setq r (getreal "\n r=")) ) (progn (setq plist nil) (repeat x (setq ux (* pi 2 (randnum))) (setq vx (* pi 2 (randnum))) (setq x (* (+ (* 5 R) (* r (cos vx))) (cos ux) )) (setq y (* (+ (* 5 R) (* r (cos vx))) (sin ux ) )) (setq z (* r (sin vx))) (setq px (list x y z)) (setq plist (cons px plist)) ) )) (point plist) (princ)) Please compare with this one (defun c:tor ( / R r x y z plist );torr ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun randnum (/ ) (if (not seed) (setq seed (getvar "DATE"))) (setq modulus 65536 multiplier 25173 increment 13849 seed (rem (+ (* multiplier seed) increment) modulus) random (/ seed modulus))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun point (xplist) (setq i 0) (repeat (length xplist) (entmakex (list(cons 0 "POINT") (cons 100 "AcDbEntity") (cons 67 0) (cons 8 "0") (cons 100 "AcDbPoint") (cons 10 (nth i xplist)) (cons 62 256) (cons 50 0) ) ) (setq i (1+ i)) )) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq x 10000) (if (and (setq R (getreal "\n R=")) (setq r (getreal "\n r=")) ) (progn (setq plist nil) (repeat x (setq ux (* pi 2 (randnum))) (setq vx (* pi 2 (randnum))) (setq x (* (+ (* 1 R) (* r (cos vx))) (cos ux) )) (setq y (* (+ (* 1 R) (* r (cos vx))) (sin ux ) )) (setq z (* r (sin vx))) (setq px (list x y z)) (setq plist (cons px plist)) ) )) (point plist) (princ)) Quote
Stefan BMR Posted February 14, 2013 Posted February 14, 2013 (setq R ... (setq r ... Try different variable names. AutoLisp is not case sensitive. Quote
uli Posted February 14, 2013 Author Posted February 14, 2013 How can i draw a mesh (surface) through these points? Triangulate? Or to draw a solid ... Quote
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.