hermite-data-helper
v1.0.7
Published
A Hermite data visualization tool for rabbit-hole and three.
Downloads
43
Maintainers
Readme
Hermite Data Helper
A Hermite data visualization tool for rabbit-hole and three.js.
Installation
This library requires the peer dependency three.
npm install three hermite-data-helper
Usage
import { Scene, Vector3 } from "three";
import { HermiteData } from "rabbit-hole";
import { HermiteDataHelper } from "hermite-data-helper";
const scene = new Scene();
const data = new HermiteData();
const cellPosition = new Vector3();
const cellSize = 1;
const hermiteDataHelper = new HermiteDataHelper(cellPosition, cellSize, data);
// Render the helper.
scene.add(hermiteDataHelper);
// Access special geometry subgroups.
console.log(hermiteDataHelper.gridPoints);
console.log(hermiteDataHelper.edges);
console.log(hermiteDataHelper.normals);
// Use a different cell size, position and data set.
hermiteDataHelper.set(otherPosition, otherSize, otherData);
try {
// Destroy the helper geometry and rebuild grid points and edges.
hermiteDataHelper.update(true, true);
} catch(e) {
// The provided position, size or data is invalid.
}
// Destroy the helper geometry.
hermiteDataHelper.dispose();
A full example can be found here.
Contributing
Maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.