rectangular-prism

1.0.0 • Public • Published

rectangular-prism stable

Quickly generate an indexed mesh for a rectangular prism, because triangles.

cube

Usage

NPM

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 to 1.
  • position: an array containing the [x, y, z] position of the mesh. Defaults to [0, 0, 0].

License

MIT. See LICENSE.md for details.

Package Sidebar

Install

npm i rectangular-prism

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • hughsk