I have this SVG
Now, when I import this document into QCAD (Pro 3.24.2.0, Win10) with 96 "pixels per inch", the three boxes are sized 10.000005x4.000001mm. Admittedly, it's not a large error, but still.
By chance, I also own Affinity Designer, so I tried to export an SVG directly from there with a 96dpi setting.
Again, when I open this in Inkscape, the three boxes are scaled correctly and Inkscape shows 96dpi under document properties.
Now, when importing this file with the 96dpi setting into QCAD, the 10mm lines become 1.259437mm which is a weird factor of about 7.94 (*). So I need to set the "pixels per inch" to roughly 12.0905952 to get the (somewhat) correct scale.
I guess the SVG import filter doesn't support all possible tags and I'd consider post-processing in Inkscape to be OKish but I'm concerned that even then the scale is slightly off.
(*) Don't know if this is by chance, but 300/96*2.54 = 7.9375. So the weird factor could result from a DPI mix-up combined with using millimeters instead of inches and some rounding errors. Or something like that.
which was obviously exported from Affinity designer (the AF document was included) and then post-processed with Inkscape. When I open this file in Inkscape, it's correctly scaled. I.e. the three rectangles above the "MiSTer FPGA" logo are exactly 10x4mm. Looking at the document properties, this document uses a resolution of 96dpi.DPI setting during SVG import results in small (or big) error
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
-
- Active Member
- Posts: 31
- Joined: Sun Aug 10, 2014 11:58 am
Re: DPI setting during SVG import results in small (or big) error
Let's have a look at one of those rectangles. After isolating and ungrouping it in Inkscape, it's stored in SVG as:
96 dpi means:
or:
Now, you can easily deduce that:
SVG / Inkscape are not more accurate than that I'm afraid.
The second file uses a notation that is not recognised by QCAD (width in %).
Code: Select all
<rect
x="541.56116"
y="518.22217"
width="15.118115"
height="37.795292"
style="fill:#5a7cba;stroke-width:0.12288976"
id="rect36" />
Code: Select all
96 units (pixels) equal 1 inch
Code: Select all
96 pixels = 25.4 mm
Code: Select all
15.118115 pixels -> 4.000001260416667 mm
37.795292 pixels -> 10.000004341666667 mm
The second file uses a notation that is not recognised by QCAD (width in %).
-
- Active Member
- Posts: 31
- Joined: Sun Aug 10, 2014 11:58 am
Re: DPI setting during SVG import results in small (or big) error
OK, thanks for having a look.