Hi,
I have a grid of maybe 1000 triangles which are coloured black. I colour a few points white and use a point cloud and solver to spread the white colour throughout the grid. My intention is that once the triangle primitive turns white it flips 180 degrees. The rotation of the triangle should be such that triangle appears to be rotating away from the white colour. The tricky part is that I can't be sure on which way (and therefore which axis) the triangle will need to flip. My thinking so far is this:
Iterate over all black triangles (in vop sop or point wrangle) and find the nearest white point
Find the two points within that triangle that are furthest from my found white point
Set the vector of those two points as my rotation axis
Flip triangle
It seems fairly simple but i'm struggling a little bit, and its an interesting topic finding the nearest point with an attribute above a certain value. I've attached a simple hip file to illustrate what I mean (and a vop sop with a half baked idea!)
Cheers,
Mike
flip_test_v1.hip