Documente Academic
Documente Profesional
Documente Cultură
;
;
;
;
;
;
;
;
;
;
;
;;;
;;;
;;;
;;;
;;;
;;;
;;;
;;;
;;;
;;;
;;;
;;;
;;;
;;;
3DSPIRAL
3DSPIRAL.LSP
Copyright (C) 1992 by Autodesk, Inc.
Permission to use, copy, modify, and distribute this software
for any purpose and without fee is hereby granted, provided
that the above copyright notice appears in all copies and that
both that copyright notice and this permission notice appear in
all supporting documentation.
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED
WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR
PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.
--------------------------------------------------------------------------;
DESCRIPTION
This is a programming example.
Designed and implemented by Kelvin R. Throop in January 1985
This program constructs a spiral. It can be loaded and called
by typing either "spiral", "3dspiral" or the following:
(cspiral <# rotations> <base point> <horiz growth per rotation>
<points per circle> <start radius>
<vert growth per rotation>).
--------------------------------------------------------------------------;
)
(defun cspiral (ntimes bpoint hfac lppass strad vfac
/ ang dist tp ainc dhinc dvinc circle dv)
(setvar "blipmode" 0)
; turn blipmode off
(setvar "cmdecho" 0)
; turn cmdecho off
(setq circle (* 3.141596235 2))
(setq ainc (/ circle lppass))
(setq dhinc (/ hfac lppass))
(if vfac (setq dvinc (/ vfac lppass)))
(setq ang 0.0)
(if vfac
(setq dist strad dv 0.0)
(setq dist 0.0)
)
(if vfac
(command "3dpoly")
; start spiral ...
(command "pline" bpoint)
; start spiral from base point and...
)
(repeat ntimes
(repeat lppass
(setq tp (polar bpoint (setq ang (+ ang ainc))
(setq dist (+ dist dhinc))
)
)
(if vfac
(setq tp (list (car tp) (cadr tp) (+ dv (caddr tp)))
dv (+ dv dvinc)
)
)
(command tp)
; continue to the next point...
Pgina 1
3DSPIRAL
)
)
(command "")
(princ)
; until done.
)
;;;
;;;
;;;
be null
be zero, neg, or null
be zero, or null
be zero or neg
*error* handler
)
;;;
;;;
;;;