Bug 996 : implement support for elliptical arc ('a' and 'A') for SVG files
Last modified: 2008-11-04 10:53




Status:
ASSIGNED
Resolution:
-
Priority:
P3
Severity:
normal

 

Reporter:
cprudhom
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2008-11-04 07:20
Hi all,
I'm trying to read the follwing SVG file
(http://commons.wikimedia.org/wiki/Image:AAA_SVG_Chessboard_and_chess_pieces_06.svg)
using Processing 0154 BETA.
Here is the code:
PShape board;
void setup() {
size(640, 360);
board = loadShape("AAA_SVG_Chessboard_and_chess_pieces_06.svg");
smooth(); // Improves the drawing quality of the SVG
noLoop();
}

It provides me the follwing error:
Exception in thread "Animation Thread"
java.lang.ArrayIndexOutOfBoundsException: 2
at processing.core.PShapeSVG.parseMatrix(PShapeSVG.java:764)
at processing.core.PShapeSVG.<init>(PShapeSVG.java:250)
...

When I look at the source, it seems that there are 2 things wrong:
1/ parseMatrix(String matrixStr) => float[] m =
PApplet.parseFloat(PApplet.splitTokens(pieces[2]));
The splitTokens method split depending on the white space (String
WHITESPACE = " \t\n\r\f\u00A0") but not on coma and point
2/parsePath() => the 'A' or 'a' case (A = elliptical Arc) doesn't exist.

Hope it helps,

Charles
PS: once again, Processing rocks ! It is really awesome!
Additional Comment #1 From fry 2008-11-04 10:53
the first issue has been fixed along with bug #982, so i'll change this
into a feature request for elliptical arc support. it's been on the todo
list but didn't have a bug assigned for it yet.

thanks for the reports.
This bug is now being tracked here.