how to get x y coordinate in mm ?
Hi,
I have one problem related to coordinates. i want to save d attributes in mm unit. for that with the help of google . i have changed default unit "mm" in Document Properties Option. After that i am going to draw 50x50 mm rectangle for that i need to change mm from px in "control tool bar " . now i got attributes like
d="M 222.47117,285.53205 L 398.65476,285.53205 L 398.65476,461.71565 L 222.47117,461.71565 L 222.47117,285.53205 L 222.47117,285.53205 L 222.47117,285.53205 z"
But when i changed mm to px then also got same attributes
d="M 222.47117,285.53205 L 398.65476,285.53205 L 398.65476,461.71565 L 222.47117,461.71565 L 222.47117,285.53205 L 222.47117,285.53205 L 222.47117,285.53205 z"
How to distinguish between mm and px .
i am really stuck in this
Let me know solution...!!!
On 23/10/11 13:52, perry-dev wrote:
I have one problem related to coordinates. i want to save d attributes in mm unit. for that with the help of google . i have changed default unit "mm" in Document Properties Option. After that i am going to draw 50x50 mm rectangle for that i need to change mm from px in "control tool bar " . now i got attributes like
d="M 222.47117,285.53205 L 398.65476,285.53205 L 398.65476,461.71565 L 222.47117,461.71565 L 222.47117,285.53205 L 222.47117,285.53205 L 222.47117,285.53205 z"
But when i changed mm to px then also got same attributes
d="M 222.47117,285.53205 L 398.65476,285.53205 L 398.65476,461.71565 L 222.47117,461.71565 L 222.47117,285.53205 L 222.47117,285.53205 L 222.47117,285.53205 z"
How to distinguish between mm and px .
This question (as well as several others related to custom modifications of Inkscape) has been asked in the 'Answers' section of Launchpad, where I lately had added these comments:
The SVG specification does not allow units to be used in the 'd' attribute of path definitions.
The coordinates in the path data 'd' attribute can only be specified in SVG user units: http://www.w3.org/TR/SVG/paths.html#PathDataBNF
and
Inkscape itself converts between SVG user units (px, 90dpi) and the document-specific units displayed in the GUI. The values stored in the SVG source have to conform to the SVG specification.
For details which parts of the code base handle this units conversion, please ask on the developers' mailing list.
@all - please clarify in case this summary is not correct.
Based on the earlier questions [1] I assumed that this question is also related to adding some custom features (including a tool to automate some tasks) to Inkscape and recommended to ask for advice here on the mailing list.
~suv
[1] related questions at Launchpad by the same author:
175825 - how to get x y coordinate in mm ? https://answers.launchpad.net/inkscape/+question/175825 174237 How to Get All item attributes value when Open SVG file in inkscape ? https://answers.launchpad.net/inkscape/+question/174237 173535 how to write svg file from inkscape ..?? https://answers.launchpad.net/inkscape/+question/173535 173263 how to read svg file in inkscape https://answers.launchpad.net/inkscape/+question/173263 172894 How to save svg file In ascending order ...!! https://answers.launchpad.net/inkscape/+question/172894 172184 save svg file automatically with out click on save button..!! https://answers.launchpad.net/inkscape/+question/172184 171875 how to add new tool button on Toolbox in inkscape https://answers.launchpad.net/inkscape/+question/171875 171785 i want open object properties dialog bydefault https://answers.launchpad.net/inkscape/+question/171785
On 2011-10-23 5:16, ~suv wrote:
On 23/10/11 13:52, perry-dev wrote:
I have one problem related to coordinates. i want to save d attributes in mm unit. ...
This question (as well as several others related to custom modifications of Inkscape) has been asked in the 'Answers' section of Launchpad, where I lately had added these comments:
The SVG specification does not allow units to be used in the 'd' attribute of path definitions.
@all - please clarify in case this summary is not correct.
It's partly correct, the SVG specification indeed does not allow mm's to be used in the d attribute. However, by setting both the width and height, as well as the viewBox attribute on the <svg> tag you can essentially create a coordinate system that coincides with (real) mm's.
Note that if you do this (use width/height + viewBox) you should most definitely NOT use mm's in your document itself, just use pixels. This is because mm in the SVG specification is simply defined as a multiple of px (so if px in your document corresponds to mm in the "real world", then mm in your document no longer corresponds to mm in the real world).
participants (3)
-
Jasper van de Gronde
-
perry-dev
-
~suv