Skip to content

nicknikolov/random-volume-points

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

random-volume-points

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

About

generate random 3d points inside a given geometry

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published