Graphite icon indicating copy to clipboard operation
Graphite copied to clipboard

Node for calculating the "medial axis transform and "straight skeleton"

Open j-jasz opened this issue 10 months ago • 2 comments

https://en.wikipedia.org/wiki/Topological_skeleton?useskin=vector#/media/File:Skel.png https://scikit-image.org/docs/stable/auto_examples/edges/plot_skeleton.html

Vector straight skeletons can be used as efficient rigs for animating more complex 2D shapes. Skeleton rig will automatically have the most efficient amount of control points per shape.

In raster graphics MAT in a form of gradients are a great way of making various masks that are either very time consuming or impractical to do by hand. MAT-based masks are also very useful in making textures for 3D. An example of how this could work is Distance Map in GIMP: Filters -> Generic -> Distance Map

j-jasz avatar Mar 08 '25 15:03 j-jasz

This is also useful for turning hand-drawn strokes into paths that can be given a stroke.

Keavon avatar Apr 28 '25 08:04 Keavon

A good algorithm for a vector implementation (would need to be ported from TS to Rust):

  • https://florissteenkamp.github.io/MAT-Demo/
  • https://github.com/FlorisSteenkamp/MAT
  • https://stackoverflow.com/questions/29921826/how-do-i-calculate-the-medial-axis-for-a-2d-vector-shape

Another cool thing:

  • https://journals.sagepub.com/doi/10.1177/14780771241254636

Keavon avatar Apr 28 '25 09:04 Keavon