Re: Some questions regarding transformations in SVG

On Fri, Nov 14, 2014 at 3:55 AM, Juergen Roethig
<roethig@dhbw-karlsruhe.de> wrote:
> as I try to code some applications realized with SVG where I need
> transformations, several questions arised:
>
> 1. Currently, only affine transformations are achievable in SVG. This seems
> not to be changed for SVG2. Were there ever any discussions, or efforts, to
> allow non-affine transformations in SVG?

Affine transforms are fast and easy to do on modern graphics hardware
with simple matrix math.  Non-affine transforms don't have this
property, unfortunately.

> 2. When scaling (parts of) a presentation, all the strokes, patterns,
> markers, ... are also scaled. In SVG Tiny 1.2, a "non-scaling-stroke" value
> for an attribute "vector-effect" was introduced, and I read happily that
> this is intended to be part of SVG2, as well. But as far as I understand,
> this refers only to the stroke property (this is what its name says) - is
> something similar intended for fill patterns, markers, whatever? And even
> further - may I have non-scaling annotations (textual or graphical) as part
> of a scaled object? The usecase might be just the same as the one which is
> described in SVG2 for the "non-scaling-stroke" - scalable maps with roads
> realized via a non-scaling stroke, the roads keeping their size when scaling
> the map, and I would additionally like to annotate those roads with their
> names, I would like to mark them and fill them with special patterns (in
> order to present them as highways, footpaths, railroads, ...).

Yes, at the last F2F a few weeks ago, we discussed non-scaling patterns as well.

> 3. And last, but not least, when I have several transformation contexts, may
> I have elements using coordinates from both contexts at the same time (e.g.
> a line from a special coordinate in one context leading to another special
> coordinate in the other context)? The usecase might be the same as before -
> this time I would like to have a fixed-positioned map legend and a scaling
> and moving sector of the map. Or I might have two sectors of the same map in
> different scales, and references (lines, curves, ...) from coordinates
> within the one sector to coordinates in the other sector. The "reference
> points" (or "ports") discussed within the "connector proposals for SVG"
> might help for that, but in all proposals discussed so far within the
> working group, only a special "connector" element may use such reference
> points, and this might not help if I would like to have graphical shapes
> which are not part of the shapes available for a connector, e.g. a rectangle
> with one corner point in one context, and the other corner point in the
> other context. So, what should be the solution for that in SVG[2]? Or is it
> and will it just be impossible, even in SVG2?

For the general case, you'll need script.  The line has to be all in
one context, so you'll have to do at least one conversion, from a
point in one context to the line's context.  Luckily this has been
specified in <http://dev.w3.org/csswg/cssom-view/#the-geometryutils-interface>,
currently implemented in Firefox, so it's pretty easy to use.

~TJ

Received on Friday, 14 November 2014 16:45:26 UTC