34 releases (8 breaking)

0.9.3 Apr 9, 2024
0.9.2 Mar 12, 2024
0.9.1 Feb 28, 2024
0.9.0 Nov 25, 2023
0.1.0 Dec 31, 2022

#148 in Math

Download history 1/week @ 2024-02-15 155/week @ 2024-02-22 74/week @ 2024-02-29 146/week @ 2024-03-07 32/week @ 2024-03-14 4/week @ 2024-03-21 11/week @ 2024-03-28 115/week @ 2024-04-04 29/week @ 2024-04-11

162 downloads per month
Used in d3_geo_voronoi_rs

MIT license

58KB
1.5K SLoC

rust d3 delaunay

2021 Edition.

crates.io Documentation Download

About

This is a library for computing the Voronoi diagram of a set of two-dimensional points.

This is a port of d3-delaunay. It is in a very early development phase.

It is part of a collection d3 modules ported into RUST

Currently the code coverage, as reported by Cargo tarpaulin is 80%.

Examples

Three example web pages are provided in the git repository associated with crate

examples/500_points

This demo renders the meshes associated with a set of 500 points. The points are created at random.

to run the application

cd examples/500_points
cargo run

This produces a file "mesh.svg"

500 points

  • The delaunay mesh is in blue.

  • The voronoi mesh is in green.

examples/stippling

Using this library - I have port this example into RUST

https://observablehq.com/@mbostock/voronoi-stippling

eye

to run the example

cd examples/stippling
npm install
npm run build
npm run serve

Currently the RUST port of this example runs in javascrtipt's main event loop. This needs to be refactored so that the main computation run in parallel, runs in a web worker.

examples/cross_pattern

This is a confidence building exercise With only 5 points in a symmetric pattern the meshes can be predicted.

cross_pattern

Next steps

API finalization. There maybe optimization in the area of generics.

We need a profile taget based on the stippling example. To profile and identify bottlenecks.

Unimplemented generators

Functions that use the generator crate are now availble only when the "generator" feature is enabled.

The following functions are under going rapid development.

The following generators functions are missing.

delaunay voronoi
neighbors() cellPolygons()

update()

d3-geo-delaunay has a dependency on this npm package delauantor the function update() allow for rapid retriangulation - in a memory efficient mannor.

This module has a parallel depenecy on delaunator-rs unfortunatly this is missing from the rust port.

There is an open issue to add a update function https://github.com/mourner/delaunator-rs/issues/30

Dependencies

~14–42MB
~628K SLoC