rectangular-prism
v1.0.0
Published
Quickly generate an indexed mesh for a rectangular prism, because triangles.
Downloads
7
Maintainers
Readme
rectangular-prism
Quickly generate an indexed mesh for a rectangular prism, because triangles.
Usage
mesh = prism([size], [position])
Returns a simplicial-complex-style mesh, i.e. an object with two properties:
mesh.positions
: the prism's vertices.mesh.cells
: the prism's faces.
If you don't pass the function any arguments, you'll simply get a unit (1x1x1) cube mesh in return. You can optionally pass in the following arguments for your convenience:
size
: the size of the prism. May either be a number (if you just want a cube), or an array with the[x, y, z]
dimensions of your new mesh. Defaults to1
.position
: an array containing the[x, y, z]
position of the mesh. Defaults to[0, 0, 0]
.
License
MIT. See LICENSE.md for details.