PDA

View Full Version : ACAD (Any): Creating a 3D Spring or Spiral


architech
01-09-2004, 09:52 PM
Attachments moved from this post ...
http://www.autocadeverything.com/phpBB/ftopic260.php
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hy can somebody please tell me if there's a quicker way to draw a spring. Maby theres a block allready drawn or something.


To do what you ask, you need to approach this like doing handrails for a stair.

You do 36 inch posts and place them in a circle, then pull each post up 7 or 9 inches in the air ... just like climbing a spiral stair.

Then do a "3DPOLY" and snap to each endpoint of the top post.

Now draw a circle in "FRONT VIEW" ... so change the UCS as needed.

Now do the "EXTRUDE" command along the path.

Instant spring! Or handrail ....

.
.
.
.
.

Or you can try this LISP found at XANADu which is listed here.

http://www.autocadeverything.com/phpBB/viewtopic.php?t=167

Attached is the 3DSpiral.LSP & Sol_spring.lsp in the LSP.zip



Hope that helps.


And attached is a sample 3D spring DWG file using the 3DPOLY in the SPIRAL_DWG.zip

architech
06-10-2004, 12:49 PM
http://www.cadalyst.com/cadalyst/article/articleDetail.jsp?id=81921

http://www.cadforum.cz/cadforum_en/qaID.asp?tip=836

http://www.cadtutorforum.net/forum/viewtopic.php?t=74

http://www.cadpanel.com/autolisp_downloads.htm#Draw%20Helixes%20with%20a%2 0dialog%20box

http://www.caddigest.com/subjects/autocad/tutorials/select/SCREWS/SCREWS.HTM

http://www.caddigest.com/subjects/autocad/tutorials/select/southworth_3d_screw.htm

architech
18-10-2004, 04:57 PM
The following autolisp program adds a coomand named "H3" to drawing session. It requests you the center, radius, pitche, no. of revolutions, and no. of steps in each revolution to create a 3d helix. If you use the created 3dpoliline as an extrusion path, it will rotate the section around the path. So it is suitable for circular sections. To create 3d helical models with non-circular sections, you have to use the Autodesk Mechanical Desktop or some other parametric modeling applications.


;;;;; Farzad
;;;;; Jan 27 2003

(defun C:h3(/ c r p n nr ps pb pe Beta dBeta z dz vertex )
(setq c (getpoint "\n Center : "))
(setq r (getdist c "\n Radius : "))
(setq p (getdist "\n Pitch : "))
(setq n (getreal "\n No. of revolutions : "))
(setq nr (getint "\n No. of steps in each round : "))
(setq ps '((0 . "POLYLINE") (100 . "AcDbEntity") (67 . 0) (100 . "AcDb3dPolyline") (66 . 1) (10 0.0 0.0 0.0) (70 . 8) (40 . 0.0) (41 . 0.0) (210 0.0 0.0 1.0) (71 . 0) (72 . 0) (73 . 0) (74 . 0) (75 . 0)))
(setq pb '((0 . "VERTEX") (100 . "AcDbEntity") (67 . 0) (100 . "AcDbVertex") (100 . "AcDb3dPolylineVertex") (10 0.0 0.0 0.0) (40 . 0.0) (41 . 0.0) (42 . 0.0) (70 . 32) (50 . 0.0) (71 . 0) (72 . 0) (73 . 0) (74 . 0)))
(setq pe '((0 . "SEQEND")))
(entmake ps)
(setq z 0.0)
(setq dz (/ p nr))
(setq dBeta (/ (* 2 pi) nr))
(setq Beta 0.0)
(while (<= Beta (* n (* 2 pi)))
(setq vertex (list (+ (car c) (* r (cos Beta)))
(+ (cadr c) (* r (sin Beta)))
(+ (caddr c) z)
)
)
(setq pb (subst (append '(10) vertex) (assoc 10 pb) pb))
(entmake pb)
(setq z (+ z dz))
(setq Beta (+ Beta dBeta))
)
(entmake pe)
(princ)
)

architech
25-09-2005, 09:58 PM
Here's the 3DSpiral.LSP that was lost after this board changed its code format. :(

gudmund
07-12-2005, 08:55 AM
how do you extrude along a path? can't seem to find that one. do you know if its available in 2004?
thanks

architech
08-12-2005, 02:11 AM
Type EXTRUDE .... along the path should be one of the options....
Hope that helps....

EXTRUDE has been part of AutoCAD since release 14.
:080402gud

gudmund
08-12-2005, 12:29 PM
wow, i never really noticed that before! silly me. i've been extruding stuff for ages and going to ridiculous lengths to make bendy things like hosepipes, basically revolving each little segment and sticking them together. this would have saved me so much time! thanks! :banghead3

barkas
01-02-2007, 02:32 PM
wow :)
thanks for the links

Adesu
20-02-2007, 02:17 AM
Hi architech,
Here trick to create 3d spring,it have two system creating spring
1).Manual system (look at attach file)
2).Program system,look this below

; ccs is stand for Create Coil Spring
; Design by : Adesu <Ade Suharna>
; Email : mteybid@yuasabattery.co.id
; Homepage : http://www.yuasa-battery.co.id
; Create : 24 March 2005
; Program no.: 219/03/2005
; Edit by : Adesu 13/05/2005 1).
; Kevin Nehls 16/05/2005 2).
; Adesu 11/07/2005 3).
; 04/08/2005 4).remove render ("2).")
; 03/09/2005 5).remove ssadd,el3,isolines
; 19/09/2005 6).add error system


(defun c:ccs (/ *error* om lay seg ang cnt rad pit len leng x y z point el p1
rads el1 el2)
(setq *error* myer) ; 6).
(setq om (getvar "osmode")) ; 5).
(setvar "osmode" 0)
(setq lay (getvar "clayer"))
(if
(/= lay "SPRING")
(command "_layer" "m" "SPRING" "c" 1 "" "")
)
(setq seg 36) ; in one circle become 36 part
(setq ang (/ (* 2 pi) seg)) ; (* 2 pi) in radian = 360
(setq cnt 0)
(setq rad (getdist "\nENTER NEW RADIUS<10>: ")) ; 3
(if (= rad nil)(setq rad 10))
(setq pit (getreal "\nENTER NEW PITCH<3>: ")) ; 3
(if (= pit nil)(setq pit 3.0))
(setq len (getdist "\nENTER LENGTH OF SPRING<25>: ")) ; 3
(if (= len nil)(setq len 25))
(setq leng (fix (/ len pit)))
(command "_vpoint" "r" 315 25 "")
(command "_3dpoly")
(repeat leng
(repeat (1+ seg)
(setq x (* rad (sin (* cnt ang))))
(setq y (* rad (cos (* cnt ang))))
(setq z (* cnt (/ pit seg)))
(setq point (list x y z))
(command point)
(setq cnt (1+ cnt))
)
)
(command "")
(setq el (entlast)) ; 1).
(setq p1 (polar (list 0 0 0)(* pi 0.5) rad)) ; 1).
(command "_zoom" "d" "")
(setq rads (getdist "\nENTER RADIUS OF WIRE<1.25>: ")) ; 3).
(if (= rads nil)(setq rads 1.25))
(cond ((= rads pit)(setq rads (* pit 0.45)))
((> rads pit)(setq rads (* pit 0.45)))
((> rads (/ pit 2.0))(setq rads (* pit 0.45)))
) ; 3).
(command "_circle" p1 rads) ; 1).
(setq el1 (entlast))
(if (not (member "geom3d.arx" (arx))) ; 1).
(arxload "geom3d")) ; 1).
(rotate3d el1 "y" p1 "r" 0 90) ; 1).
(setq el2 (entlast))
(command "_extrude" el2 "" "p" el) ; 1).
(command "_zoom" "e" "")
(command "_erase" el "") ; 1).
(command "_regen")
(command "_shademode" "g") ; 3).
(setvar "osmode" om)
(setq *error* nil) ; 6).
(princ)
)

(defun myer (msg) ; 6).
(setvar "osmode" om)
(setq att "***Resetting system variable was done***")
(princ att)
)