Terrain
ExportSTL
export STL files for the terrain
Calling Sequence
Parameters
Options
Description
Examples
ExportSTL(T, filedir, opts)
T:-ExportSTL(filedir, opts)
T
-
Terrain; the Terrain object
filedir
string; the directory into which to write the STL files
opts
(optional) equation(s) of the form option = value; specify options for the ExportSTL command
checkered = truefalse
Specifies whether the terrain is checkered. The default is true.
overwrite = truefalse
Specifies whether existing STL files are overwritten. The default is true.
The ExportSTL method creates and exports the STL files representing the terrain visualization. Before using this procedure, a normal or checkered plot should have been previously generated.
with⁡Tires:
Define the terrain equation.
eq≔0.1⁢tanh⁡x−5−tanh⁡x−30:
Generate a Terrain object using the defined equation. Select the z-axis as the up direction. The order of the two independent variables is [x,y]. Assign the range for x to be -10 to 100, and for y to be -10 to 10. Also, assign 50 grid points for the x-axis and 10 for the y-axis. Finally, set the title to myTerrain.
terrain≔GenerateTerrain⁡eq,−10..100,−10..10,50,10,up_direction=z,title=myTerrain:
Create a checkered plot of the terrain.
terrain:-CheckeredPlot⁡size=2,2,res_size=2,2
Export the STL files for the checkered plot.
terrain:-ExportSTL⁡FileTools:-TemporaryDirectory⁡
true,/tmp/mpldoc3/myTerrain_1.stl,/tmp/mpldoc3/myTerrain_2.stl
See Also
Tires
Download Help Document