box()#

A box is an extruded rectangle.

Examples#

example picture for box()
1def setup():
2    py5.size(100, 100, py5.P3D)
3    py5.translate(58, 48, 0)
4    py5.rotate_y(0.5)
5    py5.no_fill()
6    py5.box(40)
example picture for box()
1def setup():
2    py5.size(100, 100, py5.P3D)
3    py5.translate(58, 48, 0)
4    py5.rotate_y(0.5)
5    py5.no_fill()
6    py5.box(40, 20, 50)

Description#

A box is an extruded rectangle. A box with equal dimensions on all sides is a cube.

Underlying Processing method: box

Syntax#

box(size: float, /) -> None
box(w: float, h: float, d: float, /) -> None

Parameters#

  • d: float - dimension of the box in the z-dimension

  • h: float - dimension of the box in the y-dimension

  • size: float - dimension of the box in all dimensions (creates a cube)

  • w: float - dimension of the box in the x-dimension

Updated on November 12, 2021 11:30:58am UTC