Skip to content

Graphics3D ​

Wolfram's own Graphics3D, held inert -- the expression is what a worksheet or REPL draws, not something this library computes (see @enumeratio/formats/src/graphics.ts).

Wolfram LanguageGraphics3D
Graphics3D(primitives..., options...)Wolfram's own Graphics3D, held inert -- the expression is what a worksheet or REPL draws, not something this library computes (see @enumeratio/formats/src/graphics.ts).
Typed signatures
TypePackageApplies
(any*) -> anyformatsalways

Domain: Graphics·Drawn as Graphics3D

Details

Graphics3D(Line(KnotCurve(TorusKnot(2, 3))), Closed -> True) draws a curve in space: the nearer strand passes in front of the farther, and color runs along the parameter (ColorFunction -> "Viridis" changes the gradient). Torus -> (2, 1) draws the tube the curve lies on, faintly behind it, and Clock -> True sends a marker along the curve with the page's clock.

Only a Line of points is drawn so far. Azimuth, Elevation and Zoom are ours, where Wolfram has ViewPoint; Closed is ours too, as a knot is a loop and Wolfram repeats the first point.

Examples

Basic #

A polyline through points in space

live ↗
InGraphics3D(Line([[0,0,0],[1,0,1],[1,1,2],[0,1,3]]))\mathrm{Graphics3D}(\mathrm{Line}(\bigl\lbrack\bigl\lbrack0, 0, 0\bigr\rbrack, \bigl\lbrack1, 0, 1\bigr\rbrack, \bigl\lbrack1, 1, 2\bigr\rbrack, \bigl\lbrack0, 1, 3\bigr\rbrack\bigr\rbrack))OutGraphics3D(Line([[0,0,0],[1,0,1],[1,1,2],[0,1,3]]))\mathrm{Graphics3D}(\mathrm{Line}(\bigl\lbrack\bigl\lbrack0, 0, 0\bigr\rbrack, \bigl\lbrack1, 0, 1\bigr\rbrack, \bigl\lbrack1, 1, 2\bigr\rbrack, \bigl\lbrack0, 1, 3\bigr\rbrack\bigr\rbrack))
Options #

A loop on the tube it lies on: the tube is a second primitive, drawn behind it

live ↗
InGraphics3D(Line([[2,0,1],[0,2,1],[−2,0,1],[0,−2,1]]),(Closed,True),(Torus,(2,1)))\mathrm{Graphics3D}(\mathrm{Line}(\bigl\lbrack\bigl\lbrack2, 0, 1\bigr\rbrack, \bigl\lbrack0, 2, 1\bigr\rbrack, \bigl\lbrack-2, 0, 1\bigr\rbrack, \bigl\lbrack0, -2, 1\bigr\rbrack\bigr\rbrack), (\mathrm{Closed},\mathrm{True}), (\mathrm{Torus},(2,1)))OutGraphics3D(Line([[2,0,1],[0,2,1],[−2,0,1],[0,−2,1]]),(Closed,True),(Torus,(2,1)))\mathrm{Graphics3D}(\mathrm{Line}(\bigl\lbrack\bigl\lbrack2, 0, 1\bigr\rbrack, \bigl\lbrack0, 2, 1\bigr\rbrack, \bigl\lbrack-2, 0, 1\bigr\rbrack, \bigl\lbrack0, -2, 1\bigr\rbrack\bigr\rbrack), (\mathrm{Closed},\mathrm{True}), (\mathrm{Torus},(2,1)))
About
Examples2
CrosswalkWolfram Language

See also: Line, Plot3D