×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

RE: Spiral

If you search this forum for "spiral" you will find some solutions.  I forget how to paste in the threads so I can't put them here.

RE: Spiral

Are you trying to draw threads on a screw, or a spring?

Flores

RE: Spiral

(OP)
I guess it would be a flat spring.

RE: Spiral

Good luck with a "flat spring" whenever using vanilla ACAD.  Circles can be revolved around a Helix easily, but whenever you revolve another shape, it doesn't extrude correctly because the shape twists as it is extruded.
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

THE WAY I WOULD DRAW A TRUE SPIRAL IS TO CALCULATE X,Y,Z POSITIONS OF SEVERAL POINT UNTIL A FULL PITCH IS DEVELOPED; THEN POLYLINE ALL THE POINTS; THEN ARRAY TO THE LENGTH NEEDED;THEN JOIN AND FIT THE POLYLINES.

RE: Spiral

(OP)
Thanks for all the support. It gives me many ways to figure this out. By the way Chicopee was my home town up until about 6 years ago. Small world.

RE: Spiral

Hey, I grew up in Springfield!!

RE: Spiral

Ron --

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

(OP)
To clarify, it would be like a groove in a record. With each succesive wrap having a consistent 5/32" gap. Thanks for all the responses.

RE: Spiral

Hi Ron,

;**************************************************************************
;                               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

This is the lisp as from the previous link , it is english for a better understood.



;;  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

Be aware that "spiral" is not a specific shape, but there are different shapes of spirals, generated by different equations.  Contrast your example with the kind in a snail's shell, where the spacing gets wider as you go out.  Each is generated by different equations.

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources