Rotating rectangles to align with vectors along curve

I divided a curve and moved a rectangle to each point and tried to rotate the rectangles so the align perpendicular to the curve. My problem is that some of the rotation angles need to be negative for the orientation to be correct. You can see the problem along the first and last turn of the curve. I can’t seem to figure out how to call out the specific angles and make them negative while still keeping the script parametric. Please help!

Rotating (19.7 KB)

There are many other ways and this is one way.

Rotating (8.4 KB)

1 Like (6.7 KB)


Thanks! This is exactly what I needed.