1. ## Curved Cone

Registered forum members do not see this ad.

I vas unable to make it perfect; there are small geometrical errors at the joint of the different segments. Save your work before to start this routine, especially if you asked for a very smooth solid!
On computers with limited resources, you may (try) to increase the speed:
- set the SHADEMODE to 2D wireframe
- use the PLAN command before you start
- don't zoom/pan during the lisp works
Code:
```; Draw a solid curved cone
; mfuccaro@hotmail.com
; _____________ Apr. 2004 ____
;
(defun c:CUCONE(/ arc arc_cen arc_rad arc_ang1 arc_ang2 ang0
r1 r2 r0 r rr ; radiuses for the cross_section
ct pts a b o_snap solid
p p1 p2
xmin xmax ymin ymax zmin zmax ;bounding box
k i j) ;Used as index

(setvar "cmdecho" 0)
(command "undo" "begin")
(setq arc (entget (car (entsel "\nselect arc  ")))
arc_cen (cdr (assoc 10 arc))
arc_ang1 (cdr (assoc 50 arc))
arc_ang2 (cdr (assoc 51 arc))
ang0 (/ (- arc_ang2 arc_ang1) (getvar "surftab1"))
r1 (getdist "  end radius ")
r2 (getdist "  start radius ")
r0 (/ (- r2 r1) (* 1.0 (getvar "surftab1"))))
(if (<= (* r1 r2) 0) (progn
(quit)))
(setq ct (cons (+ arc_rad (car arc_cen)) (cdr arc_cen))
pts nil
r (- r1 r0)
a (- arc_ang1 ang0)
b (/ (* 2 pi) (getvar "surftab2"))
o_snap (getvar "osmode")

(repeat (1+ (getvar "surftab1"))
(setq i 0
r (+ r r0)
a (+ a ang0))

(repeat (1+ (getvar "surftab2"))
(setq p (polar ct (- (/ PI 2) (* (setq i (1+ i)) b)) r)
rr (- (car p1) (car arc_cen))
p2 (list (+ (car arc_cen) (* rr (cos a)))
(+ (cadr arc_cen) (* rr (sin a)))
pts (cons p2 pts)))
(setq pts (cons (polar arc_cen a arc_rad) pts))
)
(setq xmin (apply 'min (mapcar 'car pts))
xmax (apply 'max (mapcar 'car pts))
ymin (apply 'min (mapcar 'cadr pts))
ymax (apply 'max (mapcar 'cadr pts))
zmin (apply 'min (mapcar 'caddr pts))
zmax (apply 'max (mapcar 'caddr pts)))
(command "zoom" "w" (list xmin ymin) (list xmax ymax))
(setq i 0)
(repeat (getvar "surftab1")
(setq j (+ i 2 (getvar "surftab2")) k 1)
(command "box" (list xmin ymin zmin) (list xmax ymax zmax))
(command "slice" "l" "" arc_cen (nth (1+ i) pts) (nth (+ i 2) pts) (nth j pts))
(command "slice" "l" "" arc_cen (nth (1+ j) pts) (nth (+ j 2) pts) (nth i pts))
(repeat (getvar "surftab2")
(if (< k (/ (getvar "surftab2") 2))
(progn
(command "slice" "l" "" (nth (+ i k) pts) (nth (+ j k) pts) (nth (+ j k 1) pts) (nth j pts))
(command "slice" "l" "" (nth (+ j k 1) pts) (nth (+ i k 1) pts) (nth (+ i k) pts) (nth i pts))
)
(progn
(command "slice" "l" "" (nth (+ i k) pts) (nth (+ j k) pts) (nth (+ i k 1) pts) (nth j pts))
(command "slice" "l" "" (nth (+ j k 1) pts) (nth (+ i k 1) pts) (nth (+ j k) pts) (nth i pts))
))
(setq k (1+ k))
)
(setq i j))
(command "union" solid "")
(command "zoom" "P")
(setvar "osmode" o_snap)
(princ "\nTo change the smotness: delete the cone, adjust SURFTAB1 and/or SURFTAB2, than run again")
(command "undo" "end")
(princ)
)
(progn
(princ "Program loaded. Type \"CUCONE\" at the command prompt")
(princ)
)```

2. fuccaro,

That looks pretty cool! I'm not much of solids kinda guy. I prefer 3dmeshes ( even with all of their short comings. )

I think that there is a command that will adjust the smothness after the solid is made. I saw it on one the NGs I read.

-David

The lisp routine is about 20KB and does some pretty wierd stuff. I've worked on it for 7 or 8 years now.

R12 DWG File

3. Here is an image I tried to upload yesterday, but at that time CADTutor was working on the site.

Code:
`I'm not much of solids kinda guy. I prefer 3dmeshes`
Solids are easy to manipulate. Can you make a hole in your 3D Mesh?

4. How about if the extrude path is a 3DPoly line instead of arc segment ???

5. Registered forum members do not see this ad.

Code:
`Can you make a hole in your 3D Mesh?`
You can but it is a royal pain!....

Code:
`How about if the extrude path is a 3DPoly line instead of arc segment ???`
I don't think ACAD's EXTRUDE can handle it. -David

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts