svg to js

Discussion about writing code for Inkscape.
gabdab
Posts: 3
Joined: Fri Jan 17, 2014 7:54 am

svg to js

Postby gabdab » Fri Jan 17, 2014 8:04 am

I have several images in an inkscape file to export as js .
How do you get from axis aligned bounding box upper left corner to image position /rotation ?
Rotation is available as matrix : math.degrees(math.atan2(m2 , m0)) gives angle of rotation .
I am trying to adapt code from this website for the pourpose , but not sure how to invert the process :
http://abdiassoftware.com/blog/2013/10/get-bounding-box-of-a-rotated-rectangle/

larscwallin
Posts: 1
Joined: Tue Jan 28, 2014 4:30 am

Re: svg to js

Postby larscwallin » Tue Jan 28, 2014 4:39 am

hi :)

I coded an extension which exports Inkscape SVG to JSON.
It has a lot of really handy utility functions.

https://github.com/larscwallin/bansai

Hope you will have fun with it!

gabdab
Posts: 3
Joined: Fri Jan 17, 2014 7:54 am

Re: svg to js

Postby gabdab » Thu Jan 30, 2014 7:59 pm

thanks , checking it :)


Return to “Programming”