Sunday, January 19, 2025

Acute Angle Detection : Geometrical, Mechanical or Kernel

The corners in our Dynamic Foam are like gates in an electronic circuit or valves in a 'classical' flow system. When the angle is Acute, smaller then 90 degrees (< 90°), the flow is cut-off. 

This is the main rule that regulates our system and generates structure (closed-knots) like Leonardo's bridge.



So in our Foam, Voronoi-mesh, we need to detect the Acute angles ... 


... were the angles pass the 90° mark:

I have been investigating 3 methods to solve our Acute Angle Detection:

I. Geometric

There are 3 geometrical methods to calculate the angles when you have the 3 reference points, you can check it all here: https://www.wikihow.com/Calculate-Angles



II. Mechanical

The mechanical method uses a perpendicular placed marker with:
length = distance from pivot-point.

You can test it with the Shadertoy example:
Instead of a perpendicular-stripe you can also use a circle and do a boolean cut ...


... and for 3D use a Sphere with a plane to do the cut.

Technically in the program we can:
A. Implement the calculation at each edge-end.
B. Do the calculation once and use it as a stencil to 'print' it at each edge-end.

III. Kernel

A pixel 'kernel' that does a 'numbers' match-check.

IXIXIXIXIXI
IXIXIOIXIXI
IXIOIXIOIXI
IOIXIXIXIOI
IXIXIXIXIXI

Although I haven't throught this through yet. 😁

To be continued ...