1.1.0 • Published 7 years ago

random-volume-points v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

random-volume-points

npm.io

Generate random points inside a geometry.

Installation

npm i -S random-volume-points

Usage

const torus = require('primitive-torus')()
const randomVolumePoints = require('random-volume-points')
const numPoints = 1337
const result = randomVolumePoints(torus.positions, torus.cells, numPoints)
// input:
// - positions of the geometry. in format [x, y, z]
// - cells of the geometry. in format [i, j, k]
// - number of points to be generated. optional, defaults to 500
// output:
// - resulting points. array of [x, y, z]

See example.js for full example in regl.

License

MIT