# CAD tip # 8479:

Question CAD
%  platform  category

## How to generate 3D surface with a mathematic expression?

AutoCAD 3D surfaces can be created also parametrically - generated automatically using a math expression (equation). For this you can use the free application CADstudio 3DPlot.

In your current DWG drawing, 3DPlot generates a 3D surface of the type polyface mesh by applying your custom defined expression, entered as [X,Y,Z] = f(U,V). So you can generate eny mathematic surfaces. The 3DPLOT command contains several sample objects.

To use your own math functions (after you load 3DPlot), you need to perform two steps:

1. define your function;
2. call the tool (3DPlot) to plot it.

For an example, a 3D surface defined by the expression Z = sin (2 * x * y) will need these two steps in the following form - enter the LISP commands in your AutoCAD command line:

```
(defun mySaddle (x y) (list x y (sin (* 2 x y))))
(3DPlot mySaddle -1.0 1.0 0.1 -1.0 1.0 0.1)
```

The first line defines your math expression to a LISP function "mySaddle" (must return a list of coordinates X Y Z). The second line then calls the plot engine for points in the interval (-1;1) in both directions, in a step of 0.1. The result will be a nice 3D "saddle".

The top right image in the DWG format - see Boy surface.

See more information and download on CADstudio 3DPlot

 ACAD *  CAD 20.2.2012    5961× Comments   Tell a friend
applies to: AutoCAD ·

 See also: Tip 11868: Open just a part of a DWG drawing - layers, views. Tip 11847: Automatic UCS aligned with the current View (UCSauto switch). Tip 11845: What is the difference between ShareDesignView (2017) and ShareView (2019) in AutoCAD? Tip 11721: A handy calculator - expression evaluator in 3ds Max. Tip 11545: How to export a sliced 3D model from Slicer for Fusion 360?

Back   All CAD Tips

How to convert CUI file to MNU or CUIX to CUI? « | » How to sort DWG layouts numerically?

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link:
 CAD: -all- AutoCAD-2008-2010-2012-2013-2014-2015-2016-2017-2018-2019AutoCAD LT-LT2008-LT2010-LT2012-LT2013-LT2014-LT2015-LT2016-LT2017-LT2018-LT2019Inventor-Inv.ProfessionalRevitACAD MechanicalACAD ElectricalACAD ECSCADArchitecture/ADTMap 3DCivil 3DPlant 3D/P&IDTopobase/MapSrvRaster DesignACAD/Revit MEP3ds MaxMayaVaultFusion360AutoSketchReCapInfraworksNavisworksAdvance SteelRobot StructuralShowcaseSimulationFabricationBIM360/Fusion TeamA360 cloudDWFTrueView/VoloEnscapeVREDCollection    OS:  -all-Windows-Win10-Win8-Win7-Vista-WinXP-Win2000-NT4-Win98-Win95-WinCE/PPCLinuxMacOSNovell    Categ:  -all-CADPlottersHP (other) Text: FAQ glossary

 Featuring:Link your AutoCAD block attributes with Excel tables/sheets. Automatically. Dynamically. Bidirectionally.Try Excellink 2015

Please use these tips at your own risk.
CAD Studio (Xanadu) is not responsible for possible problems that may occur as a result of using any of these tips.