-
Notifications
You must be signed in to change notification settings - Fork 151
Open
Description
https://gist.github.com/soraphis/eca47b2fcce35fb891a2e79ceb25bcc7
I'd do a minor change so you can replace this switch-case monster.
- Square class, put Control Nodes and Nodes into arrays.
rule: they are filled clockwise. and node[i] is between cnode[i] and cnode[(i+1)%4] - replace the TriangluateSquare method with what you see in the link above.
the logic behind this:
for each corner who can be active, we fill the corner and its adjacent nodes into a list. (also in clockwise order)
(so for each corner we would add 3 nodes)
if the first node we want to add is equal the last node in the list, we have adjacent control nodes which we want to add, so we don't need to add the node in between -> remove it from the list.
after processing all 4 cornerns, we need to make the same check for the first and the last node in the list. if they are the same, remove them.
gocs
Metadata
Metadata
Assignees
Labels
No labels