Re: Fwd: SVG Path, Polyline, and Polygon data coordinates

Dugan Knoll:
> I think David and I are seeing the same thing, which is specifically
> when "sometimes one wants part of the content to adapt to screen size,
> but not all."  In my experience the one path data unit that really
> doesn't play well with others is the % unit. There have been a few
> cases where I would like to mix fixed units and percents within the
> same path.  I see how supporting all of the css units would greatly
> complicate parsing and rendering of path data, but maybe it wouldn't
> be so bad to only allow percents.

Parts of this is covered with constrained transformations in SVG tiny 1.2.
The general idea is pretty useful, but maybe for a full version one may
want to be able to address each element to some specific scaling behaviour
or base unit definition to be able to put everything in arbitrary rendering 
order and not everything with the same sizing behaviour in one group.

Another advantage of such referencable base unit definitions would be, 
that one can avoid some implementation bugs or problems, that may appear
with constrained transformation, because some implementations seem
to try to invert some transformation matrices, even those, that are
not invertible ;o)

>
> In fact, it may not be necessary to even add percents to polylines and
> polygons. These use cases can already be accomplished using a series
> of line elements, which support percent for its x1,x2,y1, and y2
> attributes.  Adding percent units to path elements could allow greater
> flexibility for curved lines and shapes. It should only introduce
> minimal parsing and rendering issues, since the percent units could
> just be converted to a fixed data point before rendering.
>
> One simple example: a curved arrow that expands based upon the size of
> the root svg.  For this curved arrow, you wouldn't want the pointed
> end to distort as the svg graphic grows horizontally or vertically,
> but the rest of the curve would expand appropriately.
>
> For example's sake, lets draw an arrow starting at the bottom right
> corner of an SVG that curves around the bottom up to the pointed end
> in the top left corner.  This is how the arrow might ideally be coded:
> <path d="M100%,100% C10,100% 10,100% 10,5 L5,10 M10,5 L15,10"/>
>
> Currently, you could roughly accomplish this same graphic using nested
> svg elements and coordinate system transformations. As David
> mentioned, this solution is messy and does not always work properly.
> I think it would be simpler and more effective to allow percents
> within the path data.
>

My idea would be in general to do the arrow head with a marker.
In your example the line has another function than the head -
not a good idea to mix this up in one path, if one wants to size
this independently.
With an option or vector effect to keep the size of such markers constant
relative to a pixel size might be useful. 
This is in parts already available for the stroke in SVG tiny 1.2 with a
vector effect. Because SVG 2 will have such vector effects as well,
one needs to clarify as a first step, that one has a vector effect for
markers as well, maybe even independent or dependent from the
vector effect for the stroke on authors choice to cover a wider range
of use cases.

Olaf

Received on Wednesday, 9 October 2013 17:31:32 UTC