solid
Creates a new instance of a named 3D solid.
Syntax
-
solid(s, [a[, f[, d[, α]]]])
-
s is a string
-
a is a three-dimensional real vector
-
f is a three-dimensional real vector
-
d is a three-dimensional real vector
-
α is a real number
-
Description
solid(s)
creates a new instance of the named 3D solid s
.
solid(s, a, f, d, α)
translates the object by a
, scales it by diag(f)
, aligns its axis with d
, and rotates it an amount α
about its axis.
If omitted, a
defaults to ❨0, 0, 0❩
, f
to ❨1, 1, 1❩
, d
to ❨0, 0, 1❩
, and α
to 0
.
The object is shown in the current scene and a reference to the object is returned.
The AdjustVisual
function can be used to adjust the appearance of the solid. See Visual settings for a list of applicable settings.
Available solids
At least the following solids are available:
-
cone
-
cube
-
cylinder
-
dodecahedron
-
icosahedron
-
octahedron
-
pyramid
-
teapot
-
tetrahedron
Some of these may offer parameters that can be set using AdjustVisual
. For instance, the cylinder can be customised with a positive inner radius (producing a hollow, solid tube with a finite wall thickness) and a sector angle.
Examples
solid("cube")
solid("icosahedron")
s ≔ solid("teapot"); AdjustVisual(s, "color": "coral")