Original author: b...@processing.org (June 07, 2010 01:07:39)
This bug automatically added from:
http://dev.processing.org/bugs/show_bug.cgi?id=996
Comment from cprudhom, 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.(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!
Original issue: http://code.google.com/p/processing/issues/detail?id=130
Original author: b...@processing.org (June 07, 2010 01:07:39)
This bug automatically added from:
http://dev.processing.org/bugs/show_bug.cgi?id=996
Comment from cprudhom, 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.(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!
Original issue: http://code.google.com/p/processing/issues/detail?id=130