PGA2D Sketches


inspired by this post and trying to learn PGA2D I set out to implement it using the excellent ganja.js


Sketches

I created simple test cases for each ingredient. They can be found here.

Side of line
Convex polygon - point collision
Concave polygon - point collision
Concave polygon - point collision Push point out
Line - Linesegment collision
Nearest point on linesegment
Ray - Linesegment collision
Nearest collision
Angle
Dist to nearest edge of polygon
Sort rays clockwise

Progress

Using the ingredients to combine into a proof of concept

Sight 1
Sight 2
Sight 3
Sight 4
Sight 5

I am far from an expert in these things. But the process of creating this gave me some insights into the power of PGA and it was also a lot of fun!