Hello, World!
I'm trying to make an extension that will create some shapes and paths and arrange them in specific order. All objects have dimensions specified in millimeters.
Creating square, for example, in millimeters is no problem just by adding + 'mm' to it's parameters. However this trick is not working with paths and translate attribute.
I'm sorry for maybe a silly question, but I'm not an experienced programmer, and any examples will be really helpful
Coordinate system in millimeters
Re: Coordinate system in millimeters
Hi coper,
I'd suggest you take a look at a couple of other extensions first, and also at the 'simpletransform' and 'simplepath' python modules that come with Inkscape, to find out how to do it. You don't need to reinvent everything from scratch, just take some time to investigate. Select an extension that does something similar like the one you want to write and start from there.
For unit conversion, you could also use the built-in one (something like self.unittouu and the other way around). You can find that used in many of the extensions that Inkscape ships with, and the method lives in inkex.py.
I'd suggest you take a look at a couple of other extensions first, and also at the 'simpletransform' and 'simplepath' python modules that come with Inkscape, to find out how to do it. You don't need to reinvent everything from scratch, just take some time to investigate. Select an extension that does something similar like the one you want to write and start from there.
For unit conversion, you could also use the built-in one (something like self.unittouu and the other way around). You can find that used in many of the extensions that Inkscape ships with, and the method lives in inkex.py.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: Coordinate system in millimeters
In Inkscape you can set default units per document, I expect transforms and other relevant operations would follow that setting, although I haven't checked. There is probably a guideline in Inkscape programming how to handle units.
You'll probably get an answer here, but just in case you don't try emailing the dev mailing list, or asking in #inkscape-devel room on IRC.
You'll probably get an answer here, but just in case you don't try emailing the dev mailing list, or asking in #inkscape-devel room on IRC.
just hand over the chocolate and nobody gets hurt
Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download
Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download