All Projects → mapbox → Delatin

mapbox / Delatin

Licence: isc
A fast JavaScript terrain mesh generation tool based on Delaunay triangulation

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Delatin

Explorer
WorldWindExplorer: A 3D virtual globe geo-browser app framework based on WorldWindJS, Bootstrap and KnockoutJS. Includes 3D globe and 2D map projections, imagery, terrain, markers, plus solar and celestial data.
Stars: ✭ 59 (-71.5%)
Mutual labels:  3d, terrain
Assetkit
🎨 Modern 2D/3D - Importer • Exporter • Util - Library, also called (AssetIO)
Stars: ✭ 97 (-53.14%)
Mutual labels:  3d, mesh
Unity Plane Mesh Splitter
Unity Plane Mesh Splitter
Stars: ✭ 71 (-65.7%)
Mutual labels:  3d, mesh
Pts
Quantized Mesh Terrain Data Generator and Server for CesiumJS Library
Stars: ✭ 36 (-82.61%)
Mutual labels:  mesh, terrain
Hole fixer
Demo implementation of smoothly filling holes in 3D meshes using surface fairing
Stars: ✭ 165 (-20.29%)
Mutual labels:  3d, mesh
Pixel2mesh
Pixel2Mesh: Generating 3D Mesh Models from Single RGB Images. In ECCV2018.
Stars: ✭ 997 (+381.64%)
Mutual labels:  3d, mesh
3dhop
3D Heritage Online Presenter
Stars: ✭ 89 (-57%)
Mutual labels:  3d, mesh
Pyvista
3D plotting and mesh analysis through a streamlined interface for the Visualization Toolkit (VTK)
Stars: ✭ 734 (+254.59%)
Mutual labels:  3d, mesh
Mundus
A 3D world/level editor built with Java, Kotlin & libGDX.
Stars: ✭ 164 (-20.77%)
Mutual labels:  3d, terrain
Building Blocks
A voxel library for real-time applications.
Stars: ✭ 140 (-32.37%)
Mutual labels:  3d, mesh
Veloren
[Mirror] An open world, open source voxel RPG inspired by Dwarf Fortress and Cube World
Stars: ✭ 868 (+319.32%)
Mutual labels:  3d, terrain
Pixel2meshplusplus
Pixel2Mesh++: Multi-View 3D Mesh Generation via Deformation. In ICCV2019.
Stars: ✭ 188 (-9.18%)
Mutual labels:  3d, mesh
3d Machine Learning
A resource repository for 3D machine learning
Stars: ✭ 7,405 (+3477.29%)
Mutual labels:  3d, mesh
Meshcnn
Convolutional Neural Network for 3D meshes in PyTorch
Stars: ✭ 1,032 (+398.55%)
Mutual labels:  3d, mesh
Vedo
A python module for scientific analysis of 3D objects based on VTK and numpy
Stars: ✭ 741 (+257.97%)
Mutual labels:  3d, mesh
Pymeshfix
Python Wrapper for MeshFix: easily repair holes in PyVista surface meshes
Stars: ✭ 75 (-63.77%)
Mutual labels:  3d, mesh
Webworldwind
The NASA WorldWind Javascript SDK (WebWW) includes the library and examples for creating geo-browser web applications and for embedding a 3D globe in HTML5 web pages.
Stars: ✭ 628 (+203.38%)
Mutual labels:  3d, terrain
Sdf
Simple SDF mesh generation in Python
Stars: ✭ 683 (+229.95%)
Mutual labels:  3d, mesh
Quantized Mesh Viewer
Render custom quantized mesh tiles in Cesium.js and debug individual tiles using THREE.js renderer.
Stars: ✭ 130 (-37.2%)
Mutual labels:  3d, terrain
Meshlab
The open source mesh processing system
Stars: ✭ 2,619 (+1165.22%)
Mutual labels:  3d, mesh

delatin Build Status Vlad's projects

A fast JavaScript 3D terrain mesh generation tool. Approximates a height field with a Delaunay triangulation, minimizing the amount of points and triangles for a given maximum error.

Delatin is a port of Michael Fogleman's hmm (C++), which is in turn based on the paper Fast Polygonal Approximation of Terrains and Height Fields (1995) by Michael Garland and Paul Heckbert.

Live Demo

Example

const tin = new Delatin(heightValues, width, height);

tin.run(0.3); // run mesh refinement until max error is less than 0.3
const {coords, triangles} = tin; // get vertices and triangles of the mesh

API

new Delatin(heightValues, width, height)

Creates a new Delatin instance given a height field in the form of a flat array of numbers (with width * height length).

tin.run(maxError = 1)

Performs mesh refinement until maximum error reaches below the given maxError. You can do this multiple times with successively smaller maxError.

tin.refine()

Runs a single iteration of mesh refinement, adding a single point to the mesh. Useful when generating the mesh with custom stop conditions (e.g. maximum number of points or triangles).

tin.getMaxError()

Returns the current maximum error of the mesh, defined by the maximum vertical distance between a point in the original height field and its triangular approximation.

tin.getRMSD()

Returns the current root-mean-square deviation of the mesh.

tin.heightAt(x, y)

Returns the height value at a given position, with x, y being integer coordinates that reference the original height field.

tin.coords

After running mesh refinement, this will be an array of x, y vertex coordinates of the final mesh (note: without z, but you can use tin.heightAt(x, y) to get the height for each vertex).

tin.triangles

After running mesh refinement, this will be an an array of triangle indices of the final mesh. Each triple of numbers defines a triangle and references vertices in the tin.coords array.

Install

Run npm install delatin or yarn add delatin. Delatin is exposed as a ES module, so you can use it like this in modern browsers:

<script type="module">
import Delatin from 'https://unpkg.com/delatin';

To use ES modules in Node, either use esm (node -r esm app.js), or node --experimental-modules app.js for Node v12+.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].