Only numbers without units are allowed, list items are to be separated with exactly ',' just for the PHP script. In general there is no good check for nonsense values, take care yourself!
Describes a graphical element or a symmetry group in polar coordinates, in the following called polar. Simplest useful application is a regular polygon or in general to explore two dimensional discrete rotation groups. Another application is to create a hole inside a regular polygon. Due to the choice of attribute value semantics and the interpretation of not noted attributes, it is possible to create simple objects with only a few attributes or items in an attribute value. More complex objects can be defined using the complete set of attributes and attribute value semantics by advanced authors.
cx
= "<coordinate>"
The x-axis coordinate of the center of the polar.
If the attribute is not specified, the effect is as if a value of "0" were specified.
Animatable: yes.
cy
= "<coordinate>"
The y-axis coordinate of the center of the polar.
If the attribute is not specified, the effect is as if a value of "0" were specified.
Animatable: yes.
n
= "<integer>"
The number of corners of the polar. For a negative or zero n the polar is not
displayed.
For n="1" the polar might degenerate to a point, for n="2" the polar might
degenerate to a line with to trivial values for other attributes.
If the attribute is not specified, the effect is as if a value of "3" is
specified.
If accidently not an integer is specified, ceil(n) is taken as value.
Animatable: yes, only discrete animation, not additive.
turns
= "<number>"
The number of turns used to arrange the corners.
For details see description below.
If the attribute is not specified, the effect is as if a value of "1" were
specified.
Note that for turns="0" the polar degenerates to a line or a point. The sign
determines the direction of progress from one corner to the next.
Animatable: yes, not additive or paced.
offset
= "<number>"
Angular Offset for rendering.
The offset turn relative to the x-axis of the current user
coordinate system for the points.
One unit of a number equals to a rotation of 360/n degrees.
For details see description below.
If the attribute is not specified, the effect is as if a value of "0" were
specified.
Animatable: yes, not additive or paced.
z
= 0|1 or <integer>?
Path closed or not.
0 not closed, else closed.
If the attribute is not specified, the effect is as if a value of "1" were
specified.
(If something different from 0 or 1 is specified, 1 is assumed for the 0|1 variant; currently the
other variant is implemented, see below.)
Animatable: yes, only discrete, not additive or paced.
Discussion: The functionality of z can be extended to the number of separated path fragments (M/m commands), closed or open (z positive/negative). Implementation currently not completely tested and not further explained on this page. If n is not a multiple of abs(z)>0 currently the last values are repeated to fill up the lists.
r
= "<list of number>"
List of radii for the related corners of the polar. Radii can be positive,
negative or zero.
If the number of items is larger than n, the last superfluous items are
ignored.
If the number of items is less than n, the list is repeated from the beginning.
If the attribute is not specified, the effect is as if a value of "0" were
specified.
Animatable: yes, not additive or paced. If the number of list items is varied within the animation, the rule for ignoring and repeating list item applies for each animation value.
r1
= "<list of number>"
r2
= "<list of number>"
List of radii for the related control points of the polar. Radii can be
positive, negative or zero. If the number of items is larger than n, the last
superfluous items are ignored.
If the number of items is less than n, the list is repeated from the beginning.
If the attribute is not specified, the same radius list as from the attribute
r is assumed.
Animatable: yes, not additive or paced. If the number of list items is varied within the animation, the rule for ignoring and repeating list item applies for each animation value.
dr
= "<list of number>"
List for point to point deltas for the radius, first for points,
second and third for control points. For details see below.
If the number of items is larger than 3, the last superfluous
items are ignored.
If the attribute is not specified or less than three numbers are
specified, the unspecified numbers are assumed to be zero.
This attribute might be useful to define (discrete) spiralic structures.
Animatable: yes, not additive or paced.
fractions
= "<list of number>"
List of fractional turn deviations for the related corners of the polar.
The fraction is taken relative to the angular position of the corner point
of a regular polygon. The unit of fractions is turns/n
(if n is not a positive number, the polar is not displayed).
If the number of items is larger than n, the last superfluous items are
ignored.
If the number of items is less than n, the list is repeated from the beginning.
If the attribute is not specified, the effect is as if a value of "0" were
specified.
Animatable: yes, not additive or paced. If the number of list items is varied within the animation, the rule for ignoring and repeating list item applies for each animation value.
f1
= "<list of number>"
f2
= "<list of number>"
List of fractional turn deviation for the related control points of the polar.
The fraction is taken relative to the angular position to the corner point.
The unit of fractions is turns/n (if n is not a positive number, the polar
is not displayed).
If the number of items is larger than n, the last superfluous items are
ignored.
If the number of items is less than n, the list is repeated from the
beginning.
If the attribute is not specified, the same fraction list as from the
attribute fractions is assumed.
Animatable: yes, not additive or paced. If the number of list items is varied within the animation, the rule for ignoring and repeating list item applies for each animation value.
df
= "<list of number>"
List for point to point deltas for the angle in turns/n, first for points,
second and third for control points. For details see below.
If the number of items is larger than 3, the last superfluous
items are ignored.
If the attribute is not specified or less than three numbers are
specified, the unspecified numbers are assumed to be 1.
Animatable: yes, not additive or paced.
i
= "<number>"
The number of corners of an additional regular polygon (called invertor).
This is intended to be able to create a hole within a shape.
For an i smaller than 3 this path fragment is not displayed.
If the attribute is not specified, the effect is as if a value of "4" is
specified.
If accidently not an integer is specified, ceil(i) is taken as value.
Animatable: yes, only discrete animation, not additive.
ir
= "<number>"
Radius for the additional invertor. The radius can be positive, negative or
zero. If the attribute is not specified, the effect is that this additional
path fragment invertor is not displayed.
Especially if i is larger than 2 and the absolute value of ir is about 2
times larger than the largest value of the r list, the polar is completely
inside this invertor, this means, depending on the fill-rule and the
directions of the polar and the invertor the polar can create holes in the
invertor.
Animatable: yes, not additive or paced.
First the lists for r and fractions are completed related to the rules for ignoring and repeating list items.
The result are lists r(j), r1(j), r2(j) with j from 0 to n-1 and lists fractions(j), f1(j), f2(j), with j from 0 to n-1. dr0,dr1,dr2 are the list items of dr, df0, df1,df2 are the list items of df.
Note, that the formulas below can be simplified to straight lines (L instead of C with the following cx/y), if none of f1, f2, r1, r2, dr1, dr2, df1, df2 is specified.
x(j) and y(j) coordinates for each corner j are determined as follows
Angles: o0 = offset*2*Pi/n * turns a(j) = o0 + (j*df0+fractions(j))*2*Pi/n *turns b(j) = o0 + (j*df1+f1(j))*2*Pi/n *turns c(j) = o0 + (j*df2+f2(j))*2*Pi/n *turns Radii: (list items of dr are noted as dr0,dr1,dr2) ra(j)=r(j)+j*dr0 rb(j)=r1(j)+j*dr1 rc(j)=r2(j)+j*dr2 Points: x(j) = cx + ra(j)*cos(a(j)) y(j) = cy + ra(j)*sin(a(j)) cx1(j) = cx + rb(j)*cos(b(j)) cy1(j) = cy + rb(j)*sin(b(j)) cx2(j) = cx + rc(j)*cos(c(j)) cy2(j) = cy + rc(j)*sin(c(j))
Determination of an equivalent path d attribute:
for j=0 to n-1 if (z) { if(j==0) { path ="M x(j) y(j) C cx1(j) cy1(j) cx2(j) cy2(j) " } else { path .="x(j) y(j) cx1(j) cy1(j) cx2(j) cy2(j) " } } else { if ((j==0) AND (n>1)){ path ="M x(j) y(j) C cx1(j) cy1(j) cx2(j) cy2(j) " } else if (j==0) { path ="M x(j) y(j)" } else if (j <(n-1)) { path .="x(j) y(j) cx1(j) cy1(j) cx2(j) cy2(j) " } else { path .="x(j) y(j) " } } endfor if !z pd = path else pd = path . "x(0) y(0)Z" endif
Path for the additional path fragment polygon invertor:
a = j*2*Pi/i x(j) = cx + ir*cos(Pi/i - a) y(j) = cy + ir*sin(Pi/i - a) invertor="M x(0) y(0) L" for j=1 to i-1 invertor .="x(j) y(j) " endfor invertor .="x(0) y(0)Z"
if the invertor is not displayed (ir unspecified or i smaller than 3): value of attribute d = pd else d .= invertor
a) simple regular polygon, konvex
turns="1"
z="1"
fractions="1"
cy, cy some useful values
r exactly one useful value, for example 100
n some useful value larger than 2
b) simple symmetric polygon, konkav, 'star'
turns="1"
z="1"
fractions="1"
cy, cy some useful values
r exactly two different values with the same sign
n some useful even value larger than 2
c) symmetric polygon, complex 'star' with intersections
turns="1"
z="1"
fractions="1"
cy, cy some useful values
r exactly two different values with different signs
n some useful even value larger than 2
d) regular polygon, possibly with intersections, another kind of 'star'
z="1"
fractions="1"
cy, cy, n some useful values
r exactly one value
n some number larger than 4
turns an integer without a common factor with n
(turns can be always choosen not bigger than n without any
loss of figure types).
e) symmetric polygon, more complex with good combination of n and turns
z="1" fractions="1"
cy, cy, n some useful values
r: k values
n = k * j with j larger than 2,
turns an integer without a common factor with n
(turns can be always choosen not bigger than n without any
loss of figure types).