JSPM

edge-split

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 149
  • Score
    100M100P100Q80234F
  • License MIT

Iteratively split edges to get a more uniform tessellation

Package Exports

  • edge-split

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

Readme

edge-split

experimental

Mesh refinement via edge-splitting. Does not change the surface normals. This package is useful if you want to refine your tessellation in order to more finely sample some field, but still preserve sharp corners in your mesh.

Usage

NPM

var bunny          = require('bunny')
var split          = require('./index');
var refined        = split(bunny.positions, bunny.cells, 0.01, 1000);
console.log(refined) # <- {positions: [[0.5,0.2,0.1], ...], cells: [[0,1,2],...]}

require("edge-split")(cells, positions[, edgeThreshold, maxIterations])

This returns a simplicial complex that has maximum edge length less than edgeThreshold. By default, edgeThreshold is set to the mean edge length. By default it will split indefinitely, which can be customized by the maxIterations argument. Note: this function modifies cells and positions in-place, so create a copy before using if needed.

Contributing

See stackgl/contributing for details.

License

MIT. See LICENSE.md for details.