Spiral
Spiral
(OP)
Is it possible to draw a true spiral in Acad. The spiral I'm trying to create is a polyline starting from a center point with a groove spacing of 5/32". I've done it with offset circles but that's not a true spiral. Any help on this would be greatly appreciated.
Thanks,
Ron
Thanks,
Ron





RE: Spiral
RE: Spiral
Flores
RE: Spiral
RE: Spiral
This will draw a helix path, you will need to draw the shape to extrude.
; helcon.lsp
; mfuccaro@hotmail.com
(defun C:Helcon()
(setq segs 40); segments/turn
(setq spin -1); -1=CW, 1=CCW
(setq ri (getreal "base radius ") rf (getreal "top radius "))
(initget (+ 1 4))
(setq h (getreal "elevation "))
(initget (+ 1 2 4))
(setq tu (getreal "turns "))
(setq old (getvar "osmode"))
(setvar "cmdecho" 0)
(setq fi1 (/ (* 2 PI) segs) i 0)
(setq points (fix (* tu segs))
h1 (/ h points) r1 (/ (- rf ri) points)
s (getpoint "center of base ")
end (list (car s) (cadr s) (+ h (caddr s))))
(setvar "osmode" 0 )
(command "line" s end "")
(command "chprop" "l" "" "c" 1 "")
(command "3dpoly")
(setq i 0)
(repeat (1+ points)
(setq fi (* i fi1) h (* i h1) r (+ ri (* i r1)))
(setq x (* r (cos fi)) y (* spin r (sin fi)))
(command (list (+ (car s) x) (+ (cadr s) y) (+ (caddr s) h)))
(setq i (1+ i)))
(command "")
(setvar "osmode" old))
Flores
RE: Spiral
RE: Spiral
RE: Spiral
RE: Spiral
http://online.redwoods.cc.ca.us/instruct/darnold/calcpr...
Is that kind of spiral you want to??
Pardal
RE: Spiral
Do you want to draw a Spiral? (Each circle is smaller than the previous one, like a piece of thread wrapped around a cone)
Or do you want to draw a Helix? (Each circle is the same size as the previous one, like a piece of thread wrapped around a cylinder.)
Hmmm . . . Rocky
RE: Spiral
RE: Spiral
;**************************************************************************
; SPIRAL.LSP
;
; Este progrma construye una espiral. Puede ser cargado y llamado
; introduciendo "spiral" o de la manera siguiente:
; (cspiral <num. rotaciones> <centro> <Crecimiento por rotacion>
; <puntos por rotacion>).
;
; Designed and implemented by Kelvin R. Throop in January 1985
;**************************************************************************
(defun cspiral (ntimes bpoint cfac lppass / ang dist tp ainc dinc circle bs cs)
(setq cs (getvar "cmdecho")) ; save old cmdecho and blipmode
(setq bs (getvar "blipmode"))
(setvar "blipmode" 0) ; turn blipmode off
(setvar "cmdecho" 0) ; turn cmdecho off
(setq circle (* 3.141596235 2))
(setq ainc (/ circle lppass))
(setq dinc (/ cfac lppass))
(setq ang 0.0)
(setq dist 0.0)
(command "_pline" bpoint) ; start spiral from base point and...
(repeat ntimes
(repeat lppass
(setq tp (polar bpoint (setq ang (+ ang ainc))
(setq dist (+ dist dinc))))
(command tp) ; continue to the next point...
)
)
(command) ; until done.
(setvar "blipmode" bs) ; restore saved blipmode
(setvar "cmdecho" cs) ; restore saved cmdecho
nil
)
;
; Interactive spiral generation
;
(defun C:SPIRAL ( / nt bp cf lp)
(initget 1) ; bp must not be null
(setq bp (getpoint "\nCentro: "))
(initget 7) ; nt must not be zero, neg, or null
(setq nt (getint "\nNumero de rotaciones: "))
(initget 3) ; cf must not be zero, or null
(setq cf (getdist "\nCrecimiento por rotacion: "))
(initget 6) ; lp must not be zero or neg
(setq lp (getint "\nPuntos por rotacion <30>: "))
(cond ((null lp) (setq lp 30)))
(cspiral nt bp cf lp)
)
;-------- Traduccion AUTODESK AG ESPANA (Barcelona, 419 36 29)-------------
Or
http://www.mymcad.com/tipstricks_question50.html
Lothar
RE: Spiral
;; A.Dudek
;;; 3DSPIRAL.LSP
;;; Copyright (C) 1993 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>).
;;;
;;;
;;; Revision 3/9/95 Anthony Dudek
;;; Fixed problem of not drawing a full 360 degree helix when using only one
;;; rotation of 3dpolyline
;;;
(defun myerror (s) ; If an error (such as CTRL-C) occurs while this command is active...
(if (/= s "Function cancelled")
(princ (strcat "\nError: " s))
)
(setvar "cmdecho" ocmd) ; Restore saved modes
(setvar "blipmode" oblp)
(setq *error* olderr) ; Restore old *error* handler
(princ)
)
(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
;;;
;;; section of revised code
(if (= ntimes 1) ; if the number of
;rotations is 1
(repeat (1+ lppass) ; then calculate points ;one extra time to allow
; for the missing polyline segment at the end of
; the rotation
(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...
);close inner repeat
;;;
;otherwise
(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...
);close inner repeat
);close if
);close main repeat
(command "") ; until done.
(princ)
);close defun
;;;
;;; Interactive spiral generation
;;;
(defun C:SPIRAL (/ olderr ocmd oblp nt bp cf lp)
(command ".undo" "group")
(setq olderr *error*
*error* myerror)
(setq ocmd (getvar "cmdecho"))
(setq oblp (getvar "blipmode"))
(setvar "cmdecho" 0)
(initget 1) ; bp must not be null
(setq bp (getpoint "\nCenter point: "))
(initget 7) ; nt must not be zero, neg, or null
(setq nt (getint "\nNumber of rotations: "))
(initget 3) ; cf must not be zero, or null
(setq cf (getdist "\nGrowth per rotation: "))
(initget 6) ; lp must not be zero or neg
(setq lp (getint "\nPoints per rotation <30>: "))
(cond ((null lp) (setq lp 30)))
(cspiral nt bp cf lp nil nil)
(setvar "cmdecho" ocmd)
(setvar "blipmode" oblp)
(setq *error* olderr) ; Restore old *error* handler
(princ)
(command ".undo" "end")
)
;;;
;;; Interactive spiral generation
;;;
(defun C:3DSPIRAL (/ olderr ocmd oblp nt bp hg vg sr lp)
(command ".undo" "group")
(setq olderr *error*
*error* myerror)
(setq ocmd (getvar "cmdecho"))
(setq oblp (getvar "blipmode"))
(setvar "cmdecho" 0)
(initget 1) ; bp must not be null
(setq bp (getpoint "\nCenter point: "))
(initget 7) ; nt must not be zero, neg, or null
(setq nt (getint "\nNumber of rotations: "))
(initget 7) ; sr must not be zero, neg, or null
(setq sr (getdist bp "\nStarting radius: "))
(initget 1) ; cf must not be zero, or null
(setq hg (getdist "\nHorizontal growth per rotation: "))
(initget 3) ; cf must not be zero, or null
(setq vg (getdist "\nVertical growth per rotation: "))
(initget 6) ; lp must not be zero or neg
(setq lp (getint "\nPoints per rotation <30>: "))
(cond ((null lp) (setq lp 30)))
(cspiral nt bp hg lp sr vg)
(setvar "cmdecho" ocmd)
(setvar "blipmode" oblp)
(setq *error* olderr) ; Restore old *error* handler
(princ)
(command ".undo" "end")
)
(defun C:3s ()
(C:3dspiral))
;;;
(princ "\n\tC:SPIRAL and C:3DSPIRAL loaded. ")
(princ "\n\tStart 3DSPIRAL command with 3S")
(princ)
Pardal
RE: Spiral
Hope this helps.
Paul
RE: Spiral
I think the short answer to your question, is no, a true spiral such as you describe can't exist in AutoCAD. A polyline is always made up of arcs and straight lines, and a spiral just isn't composed of arcs and straight lines. The radius of curvature continuously changes along the length. Ditto on on a helix, where the curvature doesn't change, but the plane of the curvature does.