Rotate multiple shapes, can't find error

I’m making a script that puts wooden facade cladding of different sizes (rectangles) on curves. So I duplicated the different rectangles, calculated where the begin and endpoints of the rectangles are on the curve, moved the rectangles there.

With pipe variable I tested the clockwise direction, start- and endpoints. All seem ok.


Here is what it should look like.

The rotation works most of the time, it seems alright on non-vertical and non-horizontal shapes. I have tried two methods to make ik work in alle cases, but no luck.

I’ve attached the script with internalised input. Any advise?

rotate-multiple-Q.gh (38.3 KB)

I’d use the orient component to move the rectangles from the origin to their locations on the large rectangle.

The plane Z axis goes upwards on all planes.

rotate-multiple-Q_mrtn.gh (35.3 KB)

1 Like

Works, thanks! Here’s a view of what it means to the whole script:

Solved for the use of this project. Yet, I would like to know why the rotate method didn’t work. If anyone knows, it would help others too.

If you provide a plane and calculate the angle between the x vector and the vector you created, the angle is correct.

The 2D angle is calculated counter clockwise from the x axis.

Furthermore if you would rotate first on the XY plane and then move, you don’t need to provide a plane for the rotations…

rotate-multiple-Q_mrtn.gh (32.8 KB)

Thanks. I see the need for the plane has been discussed elsewhere too. For others: some insight in the necessity of the plane can be found here: