d3ru / eggbotcode

Automatically exported from code.google.com/p/eggbotcode
0 stars 0 forks source link

Problem with plotting Inkscape's tiled clones #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Create an object
2. Select the object; reproduce it with Edit > Clone > Create Tiled Clones....
3. Plot the drawing with Eggbot Control; each clone of the object will be drawn 
atop the original

eggbot.py has support for the SVG "use" element.  This support has previously 
been tested by plotting some of the "use" examples from the SVG specification.  
However, it seems that this support in eggbot.py does not work correctly with 
the use of "use" generated by Inkscape when Inkscape generates clones.

Original issue reported on code.google.com by newman.d...@gmail.com on 26 Nov 2010 at 5:02

GoogleCodeExporter commented 9 years ago
I believe the issue to be with simpletransform.parseTransform().  It appears to 
only parse the *first* transform in the transform string.  I've made a 
parseTransforms() which handles all the transforms in the string.  How's this 
an issue?  In some cases, Inkscape puts in both an explicit transform and an 
implicit transform when it uses <use>.  For example,

<use x="123" y="345" transform="translate(10,100)" ... />

Those x and y coordinates are an implicit transform and the resulting combined 
transform is

   translate(10,100) translate(123,345)

But simpletransform.parseTransform() only parses the first translate out of 
that transform.

I have a code fix which I will test later today.

Original comment by newman.d...@gmail.com on 26 Nov 2010 at 9:28

GoogleCodeExporter commented 9 years ago
Fixed, but the problem was somewhat different than I first surmised.  Yes, 
parseTransform() only saw the first transform in the list of two transforms.  
However, the explicit transform had already been done by code elsewhere in 
recursivelyTraverseSvg().  So, the implicit transform was not being seen and 
the explicit transform was being done twice.

Anyhow, I believe I've fixed this and tested it as well.

Original comment by newman.d...@gmail.com on 27 Nov 2010 at 1:06