JSPM

random-volume-points

1.1.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 4
    • Score
      100M100P100Q15905F
    • License MIT

    generate random 3d points inside a given geometry

    Package Exports

    • random-volume-points

    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 (random-volume-points) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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