Hi:
I have ready the SVGOMPathElement.getNormalizedPathSegList()
implementation to be submitted to the Batik project.
I have mailed a CLA. Have not received any notification as to how to
proceed.
This is the way i implemented it:
Created a new Class: AbstractSVGNormPathSegList, that extends
AbstractSVGPathSegList, in which, while parsing, the path is
normalized.
Also, I added a new inner class to SVGOMAnimatedPathData:
SVGOMNormalizedPathSegList, and modified the attrRemoved, attrModified
and attrAdded to have both lists synchronized.
The Normalization procedure is implemented as follows:
M ---> M No change is done
m ---> M Relative Coordinates transformed to Absolute
L ---> L No change is done
l ---> L Relative Coordinates transformed to Absolute
H ---> L Converted to Generic Lineto
h ---> L Converted to Absolute Generic Lineto
V ---> L Converted to Generic Lineto
v ---> L Converted to Absolute Generic Lineto
C ---> C No change is done
c ---> C Relative Coordinates transformed to Absolute
S ---> C Converted to a full Cubic Curve
s ---> C Converted to a Absolute Full Cubic Curve
Q ---> C Promoted to Cubic Curve
q ---> C Promoted to Absolute Cubic Curve
T ---> C Promoted to Cubic Curve
t ---> C Promoted to Absolute Cubic Curve
A ---> C+ Promoted to one or more Cubic Curves (one for each quadrant)
a ---> C+ Promoted to one or more Absolute Cubic Curves (one for each
quadrant)
The normalized path does not have any loss of quality or precision,
since no flattening is being applied. The resulting path describes the
same exact shape as the original, but using only the approved subset by
the SVG 1.1 spec.
I still do not understand fully the Animated versions of these
PathSegList's, so they remain still not implemented.
Please inform me what follows in order to be able to contrib. this code.
Regards,
Andres.
On Jul 19, 2005, at 7:59 AM, Thomas DeWeese wrote:
Hi,
Sorry silly math typo:
Thomas DeWeese wrote:
Quadradic = (1-t)^2*Pq1 + 2*t(1-t)*Pq2 + t^2Pq3
Cubic = (1-t)^3*Pc1 + 3*t(1-t)^2*Pc2 + 3*t^2*(1-t)Pc3 + t^3Pc4
Pc1 = Pq1
Pc2 =(Pq1 + 2*(Pq2-Pq1)/3)
Pc3 =(Pq3 + 2*(Pq2-Pq3)/2)
^ should be '3':
Pc3 =(Pq3 + 2*(Pq2-Pq3)/3)
Pc4 = Pq3
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]