W3C home > Mailing lists > Public > www-svg@w3.org > April 2004

SuperFormula in SVG

From: Jan-Klaas Kollhof <keyjaque@yahoo.com>
Date: Sat, 3 Apr 2004 08:28:22 -0800 (PST)
Message-ID: <20040403162822.38948.qmail@web60109.mail.yahoo.com>
To: www-svg@w3.org


I was reading about the superformula:

The algorithm is quite simple so I thought I implement
it in SVG:

I added some functionality to use a superformula path
element in the svg document. This is just a namespaced
element which gets replaced with a path element that
shows a path for the superformula values using the
parameters given as attributes.

<sf:path x="150" y="50"
a="1" b="1" m="0.16666667" n1="0.5" n2="0.5" n3="0.5" 
phi-start="0" phi-end="12"
r="50" steps="500" 
fill="red" stroke="black" />

where m, n1, n2, n3, a, b are parameters to the
phi-start and phi-end are the range for the formula.
They are multiplied by Py. r is the scaling of the
path and steps is the calculation steps to use to
calculate the points of the resulting path. x and y
are just the offsets for the center. the rest of the
attributes are just copied to the resulting path

What would be realy nice is to have the SVG path
extended to use the superformula.
<path d="S 0.16667 0.5 0.5 0.5 1 1 0 12 50" ... />

or a new element :)


Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
Received on Saturday, 3 April 2004 11:28:58 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:46:58 UTC