@bitheral/marching-cubes
TypeScript icon, indicating that this package has built-in type declarations

1.4.7 • Public • Published

A Marching Cubes algorithm package for Three.js

Version License Dependencies Size

This package is in part a port of Paul Bourke's marching cubes algorithm, to help create an environment using the Three.js library.

This package was developed in concurrence with my dissertation project, which is a procedural environment generator using WebGL. It is recommended to check out the project for a more complete example.

Installation

npm install @bitheral/marching-cubes

Usage

import { VolumeNew: Volume } from '@bitheral/marching-cubes';
import { Vector3, Mesh, MeshBasicMaterial } from 'three';

// Create Marching Cubes volume
const volume = new Volume(32, new Vector3(), new Vector3());
volume.March();

// Create Three.js mesh
const geometry = volume.geometry;
const material = new MeshBasicMaterial({ color: 0x00ff00 });
const mesh = new Mesh(geometry, material);

// Add mesh to scene...

Readme

Keywords

none

Package Sidebar

Install

npm i @bitheral/marching-cubes

Weekly Downloads

3

Version

1.4.7

License

MIT

Unpacked Size

55.2 kB

Total Files

15

Last publish

Collaborators

  • bitheral