Display full version of the post: Help with 3DPlot

joefromhersey
24.06.2012, 02:37
Hi I am pretty new to AutoCad and need some help plotting 3D surfaces from mathematical functions. I downloaded the 3DPlot utility and followed the instructions from this site: http://www.cadstudio.cz/en/apps/3dplot/.I defined a shape myFunc using:(defun myFunc (x y) (list x y (cos(x)+cos(y))))However when I try to plot using:(3DPlot myFunc -1.0 1.0 0.1 -1.0 1.0 0.1)I get this error:error: bad function: -1.0What am I doing wrong? Also would it be possible for me to get repeating units of the function cos(x)+cos(y)?


Vladimir Michl
17.07.2012, 09:36
Hi, your function definition is not properly formated in AutoLISP syntax. Assuming you want to draw Z = cos(x) + sin(x), the proper syntax is:
 
[CODE](defun myFunc (x y) (list x y (+ (cos x) (cos y))))[/CODE]
 
This will draw a part of a 3D sphere.