Skip to content

Visualises geodesic distance fields for 2D shapes

Notifications You must be signed in to change notification settings

micycle1/DistanceField

Repository files navigation

DistanceField

🚧Repo & code under construction🚧

Visualises distance fields for 2D shapes (in Processing).

In this library a distance field defines, for every point (pixel) in a shape, the euclidean distance between it and a single origin point. Note this is unlike a signed distance function, which defines for every point the shortest distance to the shape's boundary.

Example

image

Technique

  • Triangulate the shape (with refinement) using the shape's (x, y) vertices.
  • Model the triangulation as a graph; compute the shortest path distance from a given origin vertex to every other vertex.
  • Retriangulate the vertices (now (x, y, z), where z is the corresponding shortest path distance).
  • Apply an interpolator to the new triangulation, which produces an interpolated distance value for each pixel. 3 different interpolators are provided (offering a speed-quality tradeoff).

About

Visualises geodesic distance fields for 2D shapes

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages