You may change the xmax and ymax -with Notepad or with any other text editor- but keep the ymax impair.Code:; MOEBIUS SURFACE ; mfuccaro@hotmail.com ;;;;;;;;;;;;- 21.05.2003 -; (defun c:mb() (setq xmax 200 ymax 11;you may change here the dimensions x 0 rad2 (/ xmax (* 2 PI)) save (list (getvar "osmode") (getvar "cmdecho"))) (setvar "cmdecho" 0) (setvar "osmode" 0) (command "3dmesh" (1+ xmax) ymax) (repeat (1+ xmax) (setq y (- (/ ymax 2))) (repeat ymax (setq ang1 (/ (* x PI) xmax) ;twist along OY x1 x y1 (* y (cos ang1)) z1 (* y (sin ang1))) (setq ang2 (/ (* x1 2 PI) xmax) ;bend on OZ x2 (* rad2 (sin ang2)) y2 y1 z2 (* (+ rad2 z1) (cos ang2))) (command (list x2 y2 z2)) (setq y (1+ y))) (setq x (1+ x))) (command "vpoint" (list 1 1 1)) (setvar "osmode" (car save)) (setvar "cmdecho" (cadr save)) (princ) )
*** editing ***
As I mentioned before (read bellow) the code must be cleaned before you can use it. Here it goes:Code:; MOBIUS SURFACE ; mfuccaro@hotmail.com ;;;;;;;;;;;;- 21.05.2003 -; (defun c:mb() (setq xmax 200 ymax 11;you may change here the dimensions x 0 rad2 (/ xmax (* 2 PI)) save (list (getvar "osmode") (getvar "cmdecho"))) (setvar "cmdecho" 0) (setvar "osmode" 0) (command "3dmesh" (1+ xmax) ymax) (repeat (1+ xmax) (setq y (- (/ ymax 2))) (repeat ymax (setq ang1 (/ (* x PI) xmax) ;twist along OY x1 x y1 (* y (cos ang1)) z1 (* y (sin ang1))) (setq ang2 (/ (* x1 2 PI) xmax) ;bend on OZ x2 (* rad2 (sin ang2)) y2 y1 z2 (* (+ rad2 z1) (cos ang2))) (command (list x2 y2 z2)) (setq y (1+ y))) (setq x (1+ x))) (command "vpoint" (list 1 1 1)) (setvar "osmode" (car save)) (setvar "cmdecho" (cadr save)) (princ) )



Reply With Quote
It's nice to be nice, but sometimes is nicer to be evil!

at the results.I must find out where they hand out thease brain things.joking aside i think the way you take a problem and find a solution is great.are there seperate courses for learning lisp routines or is it just a case of knowing computer programming. 

Bookmarks