Star Maker: Stars and Regular Polygons
A demonstration of how a 'star' shape primative might work in SVG.
'star' element
'cx' : [float] x coordinate of centerpoint
'cy' : [float] y coordinate of centerpoint
'r' : [float] outer radius of shape; circumradius
'r2' : [float] radius of inner points of the star; inradius (optional; if omitted, shape will be a regular polygon); if this value is larger than 'r', 'r' acts as the inradius; if this number is negative, kaleidoscopic effects will be seen
'points' : [integer] number of points reside along the outer radius; the number of acute angles
'orient' : [point | edge] flag to determine if the top of the shape is convex or concave/flat
'radial-shift' : [float] a value that rotates the inner radius to produce spiraling shapes
'fill-rule' might also be appropriate, as would a new attribute, 'line-rule' which would control the rendering of lines that cross the shape.
Additionally, there might be a curvature attribute to allow for rounded stars.
Written by Doug Schepers, August 2005.
cx
-
+
300
cy
-
+
250
points
-
+
5
r
-
+
80
r2
-
+
40
outerOffset
-
+
1.4
outerCurve
-
+
80
innerOffset
-
+
1.4
innerCurve
-
+
60
radialShift
-
+
0
polygon
false
Make Me a Star!
Copy
Clear Canvas
Reset
orient
point
edge
point
STAR MAKER!
STAR MAKER!