RE: New path primitive

On 2013-11-16 honyk wrote:
> On 2013-09-21 honyk wrote:
> > in my svg files I use lot of circles and render a text on them. As
> > the circle itself cannot be used as the textPath target, the final 
> > code is quite complicated.
> >
> > By that new primitive I mean the simple circle. With the center in
> > the last coord, with the specified diameter and starting at Ymin.
> > The direction (clockwise/ccw) would be defined by diameter sign.
> > 
> > I propose 'D' symbol as 'd'iameter. It would be case insensitive
> > (relative/absolute doesn't matter here).
> >
> > Please compare:
> > <circle cx="200" cy="200" r="150"/>
> > <path d="M200 50A150 150 0 1 1 200 350A150 150 0 1 1 200 50"/>
> > <path d="M200 200D300"/>
> >
> > donut:
> > <path d="M200 50A150 150 0 1 1 200 350A150 150 0 1 1 200 50M200
> > 100A100 100 0 1 0 200 300A100 100 0 1 0 200 100"/>
> > <path d="M200 200D300 D-200"/>
> >
> > The main difference between A and D is the final coord, which in case
> > of D stays in the center.
> 
> I've noticed a discussion around a new 'B'earing path primitive so I am
> refreshing this topic again.
> 
> I went a bit further and 'implemented' an optional angle parameter.
> 
> M0 0D5 - circle with the center at 0,0 with a diameter of 5 rendered
> clock-wise
> M0 0D5 90 - circular arc starting at 0,0 with a diameter of 5 rendered
> clock-wise, but only first 90 degrees. Rendering is performed in the I.
> quadrant.
> 
> Both modes differs in the way of connecting to prev/next path segments.
> 
> The direction is specified by the sign of diameter (D5 vs. D-5).
> The quadrant is defined with doubled signs, but it could be simplified
> (I):   ++ <=> + <=> null
> (II):  -+
> (III): --
> (IV):  +- <=> -
> 
> Several examples:
> (1) Donut
> http://drifted.in/other/donut.png
> M0 0D16D-8
> 
> (2) Arcs
> http://drifted.in/other/arcs.png
> 
> (3) Button - rounded rectangle with a cut out
> http://drifted.in/other/button.png
> 

For some cases defining % instead of degrees would be handy. See this pie
chart example using the proposed syntax:
http://drifted.in/other/pie.png

Jan

Received on Saturday, 16 November 2013 00:37:46 UTC