Segment - exact Distance Function

This component takes two points in a UV space and returns the Distance Function of the segment line between the points - is a translation of the glsl code for 'Segment - exact' by Inigo Quilez.

2D distance functions
The SDF of a Line Segment

...I did a tutorial about this on my Patreon back on September 23, 2020 *. If you want to get into more details or just support me with my research, come join me there, you'll get access to nearly 100 tutorials.

* line segment SDF in Touchdesigner (Patreon exclusive):


Asset Downloads