How to rotate an entire layer: simple, in xml editor

Share your Inkscape tricks and tutorials here.
Tom Telos
Posts: 2
Joined: Mon Jun 16, 2014 8:46 pm

How to rotate an entire layer: simple, in xml editor

Postby Tom Telos » Tue Jun 17, 2014 12:46 am

Currently I’m designing a sunken garden (public park, actually) in a futuristic eco-city.
The design involves a series of nested contours, starting with the outermost one,
that represents the border of the highest elevation, an esplanade, 60m above a lake.
Here is a WIP:
SVG Image
As I fuss over this topmost contour, I want to adjust the width of each lobe-like projection,
and I do that with the node editor.
The lobes that, in this WIP, stack up vertically on your screen, can easily be width-adjusted;
not so the ones that go diagonally along the viewer’s right.
Wouldn’t it be neat if I could reversibly rotate the entire layer that I’m working on?
For example:
SVG Image
The actual file I’m working on has many layers, each with a lot of stuff.
To illustrate how this was done (and, can be undone), I’ve reduced my layers to only three:

Image

The top one holds (for this discussion, just one) contour of GardenNE;
the next one holds paths derived from a Gimp analysis of Google Earth imagery at [-5.36,20.57] degrees (go see!);
the third layer holds a map (image and paths) of the peninsula (on a lake) where the city is to be located.
When rotating the garden I’m working on, I want to rotate all the objects associated with that garden
  —that’s why I want to rotate the whole layer—
but I do not want to rotate any objects in the other layers,
and later I shall want to leave my garden layer at rotation 0 again.

So, here goes:

A.- Get into the XML editor, and find the layer you’re interested in. E.g.

Image

B.- The trick! In that long narrow field in front of (grayed-out) Set, write: transform;
   then, in the field below that, write something like rotate(48 400 400):geek:
   [48 is degrees, 400 400 is the center of rotation]:

Image

Now press control enter, and InkScape will accept the attribute you just added.   However!
The attribute shows up as an obscure matrix transformation.   :cry:

Image

The good news is, you can go back and delete the blessed transform attribute, matrix an’ all.
The bad news is, you have to be careful regarding translations.
When you start a new layer, it has no transforms at all. That’s excellent.
But if you decide to change the size of your document (as I did, in order to show you these diagrams),
then nasty translations appear out of nowhere, and you may lose visual feedback of the objects you’re interested in!

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: How to rotate an entire layer: simple, in xml editor

Postby Lazur » Tue Jun 17, 2014 1:13 am

Welcome aboard!

Is this the mentioned position?:
http://binged.it/1vtep6E
https://goo.gl/maps/MLUIo


By resizing the document you probably changed the origo's position as well, so that all objects than had to be translated in order to not appear moved any bit.

Tom Telos
Posts: 2
Joined: Mon Jun 16, 2014 8:46 pm

Re: How to rotate an entire layer: simple, in xml editor

Postby Tom Telos » Tue Jun 17, 2014 2:58 am

Your second link: https://goo.gl/maps/MLUIo
is probably the better one, if you want to extract Bézier curves,
but you have to zoom out to see the shapes!   :mrgreen:


Return to “Tricks & Tutorials”