Socket
Socket
Sign inDemoInstall

@mapbox/martini

Package Overview
Dependencies
0
Maintainers
14
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @mapbox/martini

A JavaScript library for real-time terrain mesh generation


Version published
Weekly downloads
159K
increased by3.62%
Maintainers
14
Install size
18.4 kB
Created
Weekly downloads
 

Readme

Source

MARTINI

Build Status Simply Awesome

MARTINI stands for Mapbox's Awesome Right-Triangulated Irregular Networks, Improved.

It's an experimental JavaScript library for real-time terrain mesh generation from height data. Given a (2k+1) × (2k+1) terrain grid, it generates a hierarchy of triangular meshes of varying level of detail in milliseconds. A work in progress.

See the algorithm in action and read more about how it works in this interactive Observable notebook.

Based on the paper "Right-Triangulated Irregular Networks" by Will Evans et. al. (1997).

MARTINI terrain demo

Example

// set up mesh generator for a certain 2^k+1 grid size
const martini = new Martini(257);

// generate RTIN hierarchy from terrain data (an array of size^2 length)
const tile = martini.createTile(terrain);

// get a mesh (vertices and triangles indices) for a 10m error
const mesh = tile.getMesh(10);

Install

npm install @mapbox/martini

Keywords

FAQs

Last updated on 31 Jan 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc