Graphics3D¶
3D analog of Graphics. Primitives include Cuboid, Sphere,
Cylinder, Cone, Line, Polygon, Tube, Point.
Options: ImageSize, PlotRange, BoxRatios, Boxed, Axes,
AxesLabel, Lighting, ViewPoint, ViewVertical, Background,
SphericalRegion.
SphericalRegion -> True scales the picture so a sphere centered on the
3D bounding box and enclosing the contents (or the box of an explicit
PlotRange) fits the display area, which keeps the scale fixed as the
view turns:
PlotLabel -> label sets a title above the picture, the same way it does
for a 2-D Graphics. Any expression can be the label; it is typeset
rather than printed, so the drawn label reads Torus Knot:
$ wo 'StringContainsQ[ExportString[Graphics3D[Sphere[], PlotLabel -> Style[Row[{"Torus ", "Knot"}], FontSize -> 18]], "SVG"], "<svg"]'
True
BSplineCurve[{p1, p2, …}] draws the B-spline its control points define,
and Tube[BSplineCurve[…], r] runs a tube of radius r along that same
curve — how a knot is given its thickness:
The tube is a solid, so it is drawn as a surface rather than as the bare curve:
$ wo 'StringContainsQ[ExportString[Graphics3D[Tube[BSplineCurve[{{0, 0, 0}, {1, 2, 0}, {2, 0, 1}}], 0.2]], "SVG"], "<svg"]'
True
The unbounded primitives InfiniteLine, HalfLine, InfinitePlane and
HalfPlane draw the part of themselves that lies inside the picture's
box, so an infinite line clipped to PlotRange -> 10 is the same drawing
as the segment between its two exit points:
Sphere[{p1, p2, …}, r] is a whole set of spheres of radius r, one per
center — how a scene marks several points at once, and the same drawing as
one Sphere per center: