You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
https://gist.github.com/soraphis/eca47b2fcce35fb891a2e79ceb25bcc7
I'd do a minor change so you can replace this switch-case monster.
rule: they are filled clockwise. and node[i] is between cnode[i] and cnode[(i+1)%4]
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.
The text was updated successfully, but these errors were encountered: