Nautilus Shell

This routine creates a 3D Mesh in the form of a nautilus shell. No user input is required, the shell parameters are fixed.

Code:
;   create a nautilus shell 
;   mfuccaro@hotmail.com 
;  ----- July.2003 ----- 
;
(defun c:nautilus( / radius Rad_inc n m ang1M ang1N old ) 
  (setq Rad_Inc 0.2      ;radius increment 
   n 25         ;mesh N size 
   m 60         ;mesh M size 
   ang1N (/ (* 2.0 pi) n)   ;angular increment 
   ang1M (/ pi 20.0)   ;angular increment 
   angN 0.0      ;angle in N direction 
   old (getvar "osmode")) 
  (command "3dmesh" (1+ n) m) 
  (setvar "osmode" 0) 
  (repeat (1+ n) 
    (setq Radius 0.0      ;radius of cross section 
     angM 0.0      ;angle in M direction 
     angN (+ angN ang1N)) 
    (repeat m 
      (command 
   (setq Radius (+ Radius Rad_Inc) 
       angM (+ angM ang1M) 
       p (list (* (+ Radius (* Radius (cos angN))) (cos angM)) 
          (* Radius (sin angN)) 
          (* (+ Radius (* Radius (cos angN))) (sin angM))))) 
      )        ;repeat m 
    )      ;repeat n+1 
  (setvar "osmode" old) 
  (princ) 
  )      ;defun 
(princ "\nRoutine loaded. Type NAUTILUS at the command prompt.") 
(princ)
Download nautilus.lsp 1.03 KB

The result of this routine is illustrated below:



See the original topic for more details.