polyhedron

A solid with flat faces: the convex hull of its vertices, or one of the five regular solids by name.

polyhedronNode
Only withxyzplane
On this page
A cube with its dual inside it: the octahedron whose six vertices are the centres of the cube's faces.A cube with its dual inside it: the octahedron whose six vertices are the centres of the cube's faces.

#Attributes

xAnimatable
The vertices' x coordinates, paired with y and z by position.
yAnimatable
The vertices' y coordinates.
zAnimatable
The vertices' z coordinates.
shapeImplicit
Which regular solid it is, by name.
tetrahedroncubeoctahedrondodecahedronicosahedron
Can be written as shorthand: polyhedron:value
atAnimatable
Where a regular solid is centred, as (x, y, z).
Also written: centre, center
radiusAnimatable
How far a regular solid's vertices are from its centre.
Default1
meshAnimatable
The hairline along every edge.
Defaulttrue
colourAnimatable
The solid's colour; faces are shaded in steps of it by how squarely they face the camera's light.
paint
Also written: color
Defaultteal
opacityAnimatable
How solid it is.
Default0.85
label
Words drawn beside it, over everything.
hiddenAnimatable
Declared but not drawn.
Defaultfalse
lock
Stops a reader editing it.
Also written: locked
Defaultfalse
layerAnimatable
Accepted for parity with the flat marks; in space the paint order is depth.
group
The comma-separated groups this mark belongs to, which set its colour and style from the graph's key:.

#Derived attributes

Computed while the element renders — read one with #id.name in attribute position or {{#id.name}} in prose, never set.

volumeDerived
The volume it encloses.
areaDerived
The total area of its faces.
verticesDerived
How many vertices its hull has.
edgesDerived
How many edges it has.
facesDerived
How many faces it has, a flat face counted once.

#Allowed in

#Examples

The corner of the first octant cut off by the plane x + y + z = 2: a tetrahedron given by its four vertices.The corner of the first octant cut off by the plane x + y + z = 2: a tetrahedron given by its four vertices.
graph:xyz{
    polyhedron(x: 0, 2, 0, 0; y: 0, 0, 2, 0; z: 0, 0, 0, 2)
}(
    x domain: [0, 2]
    y domain: [0, 2]
    z domain: [0, 2]
    aspect: equal
)
A regular dodecahedron by name, centred at the origin with its vertices 2 from the centre.A regular dodecahedron by name, centred at the origin with its vertices 2 from the centre.
graph:xyz{
    polyhedron:dodecahedron(at: (0, 0, 0); radius: 2; colour: orange)
}(
    aspect: equal
)

#Notes

  • Vertices, one list per axis: polyhedron(x: 0, 2, 0, 0; y: 0, 0, 2, 0; z: 0, 0, 0, 2). A regular solid by name: polyhedron:dodecahedron(at: (0, 0, 0); radius: 2).
  • Faces are shaded, and the ones turned away are hidden.
  • It is drawn in the data's own units, so a regular solid looks regular only under aspect: equal.
  • Space only (graph:xyz).

Last updated