delatin 0.1.1

Fast TIN generation using Delaunay triangulation.
Documentation

delatin-rs

Simple and fast TIN generation library, written in Rust. Uses Delaunay triangulation.

Result of triangulation

Delatin is a port of Volodymyr Agafonkin's delatin (JavaScript) and 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.

Example

use delatin::triangulate;

let heights = vec![100.1, 123.4, 111.5, 121.4];
let width = 2;
let height = 2;
let max_error = 1.0;
// triangles is a vector of tuples containing three indices to original height data 
// every tuple forms a triangle
let triangles = triangulate(&heights, width, height, max_error)?;

Installation

cargo add delatin

Plot triangulation result

Align your data in plot/src/main.rs and run:

cargo run --bin plot

Benchmark test

cargo run --bin test --release

TODO

  • Add tests
  • Add benchmarks
  • Add more comments and docs