SVG processing

Julien Bayle's icon

hi there,

I need to process svg files.
I mean, to extracts shapes & meshes, to play with them.

I would load dynamically a bunch of svg, but just one at the beginning and then probably collecting storing all in jitter matrices, THEN play with them.

Is there a way to import svg and parse them using JS for instance ?

Prototyping in processing, that would prepare well the points for further use :p

saadh's icon

Why dont you try Pac-n-zoom.com and make animations from there and then add the link

Julien Bayle's icon

I ended up with making that in Processing for prototyping then I'll go to Max.
Here is one result with a drawing by Shantell Martin:

Totally unfinished but working on that...

mirrorboy's icon

Hello, JULIEN BAYLE

Max Patch
Copy patch and select New From Clipboard in Max.

This is svg processing sample code.You can process path shape through dict object.sadam.rapidXML is used in this patch.

-2014-08-02-17.41.09.jpeg
jpeg
pry's icon

Hi Mirrorboy & Julien,

I'm trying to play with SVG files too, but when I read a SVG file with Mirrorboy's patch, I get these errors :

dict: no dictionary named svg, cannot get value
dict: index out of range for key svg::@viewBox

and dict.view remains empty.

Do you know why ?
Do you have any other suggestion about processing SVG file ?

Thanks.

Pry

Abao's icon

Hi, the sadam library site is offline, any other suggestion for SVG file reading? thanks.

Abao's icon
Yoann's icon

Hi,
I have the same problem as Pry: the dict is empty.

Any idea why and how to fix it

Thanks

klaus filip's icon

hi,
i wanted to paste my continuation with the above patch of Julien (thanks!!) before it becomes too complex...

Max Patch
Copy patch and select New From Clipboard in Max.