Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Drawing Sine wave ?

1,373 views
Skip to first unread message

Robert Orf

unread,
Dec 1, 2000, 2:09:37 AM12/1/00
to
Does anybody know how I can draw a perfect sine wave, or other lines based
on trig functions in ACAD ?

Thanks

Rob


TomD

unread,
Dec 1, 2000, 3:00:00 AM12/1/00
to
I think I've seen that on a web site somehwhere, but I have no idea where.
Have you tried a search, something like "autocad sine wave"?

Robert Orf <rob_...@hotmail.com> wrote in message
news:R8IV5.21631$II2.2...@newsread2.prod.itd.earthlink.net...

Joseph Agro

unread,
Dec 1, 2000, 10:18:54 PM12/1/00
to
I would suggest using Excel to generate the X & Y values. These can then be
pasted to a text file and an AutoCAD script file generated by adding

SPLINE;
X1,Y1;
X2,Y2;
etc
Then run the script in ACAD to generate the curve.

....Joe


Robert Orf <rob_...@hotmail.com> wrote in message
news:R8IV5.21631$II2.2...@newsread2.prod.itd.earthlink.net...

Mark Robertson

unread,
Dec 2, 2000, 3:00:00 AM12/2/00
to

"Robert Orf" <rob_...@hotmail.com> wrote in message
news:R8IV5.21631$II2.2...@newsread2.prod.itd.earthlink.net...

(defun plot (fx x1 x2 step window clr / pt n p1 p2)
(if (not step) (setq step 0.1))
(if (not Window) (setq window '((-10 0 0)(10 0 0)(0 -10 0) (0 10 0))))
(if (not clr) (setq clr 1))

(setvar "expert" 4)
(setvar "cmdecho" 0)
(setvar "blipmode" 0)
(command "undo" "g")

(setq p1 (car window)
p2 p1)
(foreach it window
(setq p1 (mapcar 'max it p1)
p2 (mapcar 'min it p2)))
(command "zoom" "w" p1 p2)

(command "color" 7)
(setq p1 (nth 0 window)
p2 (nth 1 window))
(command "pline" p1 p2 "")
(setq p1 (nth 2 window)
p2 (nth 3 window))
(command "pline" p1 p2 "")

(command "color" clr)
(setq n x1)
(setq pt (list n (fx n)))
(command "pline" pt)
(while (< n x2)
(setq n (+ n step))
(setq pt (list n (fx n)))
(command pt)
)
(command "")

(command "undo" "e")
(princ)
)

(defun c:test ()
(plot
(lambda (x) (* 2 (sin x))) ;function to plot
-4 ;start plot
4 ;end plot
0.1 ;step rate
(list '(-4 0 0) '(4 0 0) '(0 -4 0) '(0 20 0)) ;display window
3 ;color for graph
)
)


Robert Orf

unread,
Dec 6, 2000, 3:00:00 AM12/6/00
to
Thanks for the I/P.

The Excel way seems to be the easiest way to make the sine wave.

Thanks
Rob

"Mark Robertson" <mark...@earthlink.net> wrote in message
news:7z3W5.24911$II2.2...@newsread2.prod.itd.earthlink.net...


>
> "Robert Orf" <rob_...@hotmail.com> wrote in message
> news:R8IV5.21631$II2.2...@newsread2.prod.itd.earthlink.net...

0 new messages