JSPM

rectangular-prism

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q29657F
  • License MIT

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

Package Exports

  • rectangular-prism

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rectangular-prism) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.