Simplify inkscape transforms
Hi there,
I'm new to this list which I found after failing to get onto inkscapeforum.com (which seems to be dead).
I've been looking at inkscape/svg for a while now and I'm considering using it in application development using Python/Javascript.
I find inkscape very useful for setting up the graphics and editing them but it leaves translation and other transforms in place on groups etc. after you move them about. This has two issues:
i) It slows things down as the transforms must be applied every time the svg is presented even though they always yield the same result.
ii) It makes it hard for code manipulating the SVG DOM because the transformations add a layer of obfuscation.
Furthermore, browser implementations (chrome & firefox) seem to be buggy regarding SMIL animations on paths if these transforms are left in - they honour the transforms for the path itself but do not honour them for the associated animation posititions.
I need to simplify these transforms out of the SVG.
To rephrase: I create a rectangle in Inkscape and move it around - the x and y attributes update as expected. I stick a text object over the rectangle and group them together. Now I move the group and I get a "transform = translate(188.98349, -58.129834)" attribute associated with the group rather than the x,y positions being updated as I want.
I need to be able to click a button (or set a preference) so that these static transforms (which accumulate) are applied to the attributes and then removed such that the svg is left in a simpler but graphically identical state.
Is there some 'standard' or known way to achieve this simplification that I am missing? I will happily RTFM if pointed in the right direction - 'I've tried googling to no avail.
TIA, Paul Whipp
Office: 07 3103 2894 Mobile: 0410 545 357
Do more business with your website! http://www.paulwhippconsulting.com.au
Joomla, Python, PHP and MySQL web application developerhttp://www.paulwhippconsulting.com.au/
On 22-11-11 08:29, Paul Whipp wrote:
... I need to be able to click a button (or set a preference) so that these static transforms (which accumulate) are applied to the attributes and then removed such that the svg is left in a simpler but graphically identical state.
Is there some 'standard' or known way to achieve this simplification that I am missing? I will happily RTFM if pointed in the right direction
- 'I've tried googling to no avail.
There is an option in the Inkscape preferences (under Transforms), called "Store transformation", set it to "Optimized". This will only affect shapes that you change afterwards, but it might even be enough to scale everything to 100% (so nothing should change) to make this happen, or move everything to the right and back again, or something equally trivial.
On 22/11/11 11:11, Jasper van de Gronde wrote:
On 22-11-11 08:29, Paul Whipp wrote:
... I need to be able to click a button (or set a preference) so that these static transforms (which accumulate) are applied to the attributes and then removed such that the svg is left in a simpler but graphically identical state.
Is there some 'standard' or known way to achieve this simplification that I am missing? I will happily RTFM if pointed in the right direction
- 'I've tried googling to no avail.
There is an option in the Inkscape preferences (under Transforms), called "Store transformation", set it to "Optimized". This will only affect shapes that you change afterwards, but it might even be enough to scale everything to 100% (so nothing should change) to make this happen, or move everything to the right and back again, or something equally trivial.
But AFAIU this setting [1] does not affect moving of groups (or shapes like ellipses/circles and stars/polygons): these types of objects always use a preserved 'translate' transform attribute. The original question was related to a group:
I stick a text object over the rectangle and group them together. Now I move the group and I get a "transform = translate(188.98349, -58.129834)" attribute associated with the group rather than the x,y positions being updated as I want.
For groups, to flatten the transform, ungroup the moved group, and regroup it (keep the same selection) - it's done rather quickly with keyboard shortcuts Ctrl+U, Ctrl+G. Watch out for transforms of parent groups (if nested), though and transforms on parent layers (after resizing the page or changing its orientation).
Note: inkscape shapes (ellipse/circle, star/polygon) inside the group will inherit the transform attribute from the parent group when ungrouping: to use optimized transforms for all objects (the group and its members), convert the shapes to path (menu 'Path > Object to Path') and nudge them with the arrow keys up and down again to trigger a rewrite of the path information with optimized transforms, before grouping them again.
hth, ~suv
[1] 'Optimized' is the default setting BTW (affects regular paths & rectangles).
On 22/11/11 08:29, Paul Whipp wrote:
I'm new to this list which I found after failing to get onto inkscapeforum.com (which seems to be dead).
The forum is alive and well - there have been reports though by several users that they can't access the site without turning off the firewall of their router.
You could try to access the forum using a web proxy like e.g. http://www.webproxy.ca/ http://anonymouse.org/
The forum topic about this issue is: Problem with router firewall -- DNS misconfiguration?? http://www.inkscapeforum.com/viewtopic.php?f=19&t=5097
hth, ~suv
participants (3)
-
Jasper van de Gronde
-
Paul Whipp
-
~suv