项目作者: vanruesc

项目描述 :
A Hermite data visualization tool for rabbit-hole and three.
高级语言: JavaScript
项目地址: git://github.com/vanruesc/hermite-data-helper.git
创建时间: 2017-12-06T21:31:55Z
项目社区:https://github.com/vanruesc/hermite-data-helper

开源协议:zlib License

下载


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.

  1. npm install three hermite-data-helper

Usage

  1. import { Scene, Vector3 } from "three";
  2. import { HermiteData } from "rabbit-hole";
  3. import { HermiteDataHelper } from "hermite-data-helper";
  4. const scene = new Scene();
  5. const data = new HermiteData();
  6. const cellPosition = new Vector3();
  7. const cellSize = 1;
  8. const hermiteDataHelper = new HermiteDataHelper(cellPosition, cellSize, data);
  9. // Render the helper.
  10. scene.add(hermiteDataHelper);
  11. // Access special geometry subgroups.
  12. console.log(hermiteDataHelper.gridPoints);
  13. console.log(hermiteDataHelper.edges);
  14. console.log(hermiteDataHelper.normals);
  15. // Use a different cell size, position and data set.
  16. hermiteDataHelper.set(otherPosition, otherSize, otherData);
  17. try {
  18. // Destroy the helper geometry and rebuild grid points and edges.
  19. hermiteDataHelper.update(true, true);
  20. } catch(e) {
  21. // The provided position, size or data is invalid.
  22. }
  23. // Destroy the helper geometry.
  24. 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.