https://paste.pythondiscord.com/4BUA
Im trying to use numpy to create a polygon splitting algorithm that works like so:
- Rectangle
- For each side of the shape:
take the midpoint of the ab edge
extend the midpoint perpendicularly
draw triangle from 3 points - Recurse until reached set recursion depth
My problem is that this is my first time using numpy and i find the dimension stuff super confusing, id love for someone to explain it to me based on what i already have written and this problem.
The error im getting now is in the pastebin, but i think the entire way im doing this has to be refactored i just dont know how.
Also the algorithm is flawed right now in terms of the math but i can change that myself after i understand how this triangle array should be done
py5 is a drawing library, the triangle function in it takes 3 xy points as arguments:
triangle(x1: float, y1: float, x2: float, y2: float, x3: float, y3: float, /) -> None