polyhedron

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

polyhedronNode
Only withxyzplane
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. Points inside the hull are left out of it. Not with shape:.
yAnimatable
The vertices' y coordinates.
zAnimatable
The vertices' z coordinates.
shapeImplicit
Which regular solid it is, by name: tetrahedron, cube, octahedron, dodecahedron or icosahedron. Not with x:, y: and z:.
tetrahedroncubeoctahedrondodecahedronicosahedron
Can be written as shorthand: polyhedron:value
atAnimatable
Where a regular solid is centred, (x, y, z) — the origin when not given. Only with shape:.
Also written: centre, center
sizeAnimatable
How far a regular solid's vertices are from its centre.
Also written: radius
Default1
meshAnimatable
The hairline along every edge; !mesh leaves the faces to meet on their shading alone.
Defaulttrue
colourAnimatable
Its colour — teal when not given. Faces are shaded in steps of the hue by how squarely they face a light fixed to the camera.
colour
Also written: color
Defaultteal
opacityAnimatable
How solid it is, 0 to 1.
Default0.85
label
Words drawn beside it, over everything.
hiddenAnimatable
Declared but not drawn — animatable, so hidden: true !cue.to{false}(at: 2) is its reveal.
Defaultfalse
lock
A reader may not edit it.
Also written: locked
Defaultfalse
layerAnimatable
Accepted for parity with the flat marks; in space the paint order is depth.
group
The groups this mark belongs to, comma-separated: group: Early sown, Projected. It is drawn in the colour of the first that has one and the stroke of the first the graph's key: gives one, over its own colour: and dashed, and the footer's key names every group.

#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.
facesDerived
How many faces, a flat face counted once however many vertices it has.

#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); size: 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); size: 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