hermite-data-helper

1.0.7 • Public • Published

Hermite Data Helper

Build status npm version Peer dependencies

A Hermite data visualization tool for rabbit-hole and three.js.

API Reference

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.

Dependents (0)

Package Sidebar

Install

npm i hermite-data-helper

Weekly Downloads

3

Version

1.0.7

License

Zlib

Unpacked Size

35.9 kB

Total Files

6

Last publish

Collaborators

  • vanruesc