Forum

Swap dim "rotation"

halli hallo,
i am looking for a node (or patch) similar to swap dim which should “rotate” lets say a 4x4 spread with (to) 45, 90, 135, 180, etc. degree. i played around with swap dim, circular spread, cross2d, etc. but nothing worked the way i need it. any ideas how to do that? any patch around? found a older thread where somebody suggested a rotate pin on the swap dim node. this would be great.
amicalement, armin

I don’t see how you can rotate a spread 45%, but perhaps the Node applytransform (transform) and a rotate (transform) can rotate spreads for you, more likely XY coordinates. You can also scale and translate with it, very powerful node.

thanks west, it works with the nodes you mentioned. also used gridpick, gridsplit…

attached is a patch which rotates the ids of a spread. the example shows a grid 4x22. somehow the rotation does not work correct in some directions e.g. when direction is set to 2, which should be 90 degree, the first row gets one value wrong, also when rotating further there are some points a bit nasty.
when changing the xy reso from 4x22 to 7x8 it is not possible to get a nice rotation in every direction.
how can i avoid “odd distribution” here? any help would be great.
thanks
armin

rotateSpread.v4p (23.7 kB)

i would say that you experience rounding errors. try setting the width and height of the GridPick to 1.01 or so. this should solve the off-by-one error. does the other problem still remain?

thanks, it works. rounding is solved when i use 1.01.
and oh yes, there is one more thing: lets say there’s a grid of 4(rows) x 3(columns) with direction of 2(90deg) the column in the middle is split into two different values. how can a nicer distribution (middle column all points same value resp. color) be achieved in this case?

height correction of 1.01 and 0.72 for the rotations and a phase of 0.01 on the LinearSpreads makes it work. patch attached.

rotateSpread2.v4p (26.4 kB)