Print Page | Close Window

Help with 3DPlot

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DXF formats, Design Review, AutoCAD web, Drive, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=8020
Printed Date: 10.Jun.2026 at 08:47


Topic: Help with 3DPlot
Posted By: joefromhersey
Subject: Help with 3DPlot
Date Posted: 24.Jun.2012 at 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.0

What am I doing wrong? Also would it be possible for me to get repeating units of the function cos(x)+cos(y)?




Replies:
Posted By: Vladimir Michl
Date Posted: 17.Jul.2012 at 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:
 
(defun myFunc (x y) (list x y (+ (cos x) (cos y))))
 
This will draw a part of a 3D sphere.


-------------
Vladimir Michl (moderator)
ARKANCE - https://arkance.world" rel="nofollow - https://arkance.world - Autodesk Platinum Partner



Print Page | Close Window