Declarative reflection transformation through a given axis

Hi SVG people

I am working on prototyping code for a proposal for a SVG-based vector graphics library with reusable and replaceable components. This would include many objects with bilateral symmetry (humans, natural objects and artefacts).

To simplify authoring and editing, I was hoping that a SVG-based graphical editor tool would be able to define one side of an object (say, the left arm of a person) and have the other side generated automatically (in my case, via an XSLT transformation pipeline).

It would be a lot simpler if I could use a declarative reflection-through-an-axis transformation <https://en.wikipedia.org/wiki/Reflection_(mathematics)>; a bit like the existing rotation-around-a-point transformation.

This is a common requirement in vector graphics creation (in my experience) and typically has its own Reflect tool or operation (sometimes called mirroring, reflexion or flipping).

I am aware that scale using a -1 value in one dimension is available, but that does not really meet the common use case. I can actually derive the axis of symmetry from the components (there’s a cx and cy in the circles used for neck and torso connectors in my articulated human designs, for example), and pass this to my XSLT which can create the appropriate SVG <use> elements.

I have searched and not really found any solution or even workaround for SVG 1.1 (which Adobe Illustrator exports), so I wondered if either I had missed something or maybe reflection will feature in SVG 2?


Tavis Reddick
developer@sleepingdog.org.uk
https://github.com/sleepingdog

Received on Saturday, 25 June 2016 02:01:55 UTC