It looks like you're new here. If you want to get involved, click one of these buttons!
Hi all,
I am looking for a way to rotate polygons by 45° on a dedicated layer but they should stay in place.
Practically saying I want to rotate tons of diamond shapes into orthogonal shapes, but the shape itself should remain in its position.
If I am using the rotate function while having multiple shapes selected, the origin of the shapes is also changed.
The array is shown in the screenshot while the regular rotation (having 2 shapes selected) is changing the origin and if I am rotating shape by shape the result is good... Any ideas Many thanks, Martin
Comments
Hello,
First of all, if you have a shape that is repeated a lot of times, it is way better to work hierarchically: create the shape in a new cell, and instantiate that cell in the original cell (multiple times). If the shape changes, you have to do that only once inside that new cell and it will change everywhere. Your file size will also get much smaller if you have a huge number of repetitions.
I tried the "Selection > Rotation By Angle" menu entry and it seems to rotate the selected shapes around the center of the Bbox of all the selected shapes combined.
To rotate each structure around the center of its own Bbox you can write a small script and add it as a new menu entry like "Rotate Each Shape Individually By Angle".
Cheers,
Tomas
Hi @mpee,
Here is a sample for a script like the one @thomas2004 mentioned (Ruby):
Note that the rotation comes with a small rounding error due to the finite resolution of the database. Hence the rotated edges may not be precisely 45 degree edges.
Matthias
Hi Matthias,
Many thanks for your code, it perfectly worked at the first attempt.
@thomas2004: Thanks for your feedback, of course we are using hierarchical layout and viadefs, but I do have a very special case here...
Best Regards,
Martin
Hello,
You could also replace the boxes/polygons by instances using the search and replace utility and put the desired shape in that instantiated cell... It makes your layout easier to update (again) later if needed...
Cheers,
Tomas