PCB - Size & DPI problem

Fritzing 0.93 (for Mac)
Mac OSX Sierra
5k Retina display
32G memory

Graphic problem with Custom PCB designed in EZDraw (but, that’s not the problem; the same problem if designed in Inkscape). Note; EZDraw has selectable design/export dpi setting.

Having graphics scaling problem with a custom PCB. Designed it with 90dpi and exported with 90dpi setting.

In effort to solve this, I created a vanilla (Square) pcb - It loads into Fritzing with the Correct dimensions of 50mm X 50mm.

However, parts outside of 40mm X 40mm zone yields DRC errors. Why 40mm? Because: ( 50mm ) X ( 72dpi/90dpi ) = 40mm.

If I design and export the PCB at 72dpi setting, the board imports with that (40 x 40) size and produces No errors. Of course, 40x40 is not what I want.

Other info: The XML files are correct (and include the layers with correct names/ID’s and correct Height/Width and ViewBox size… not an issue).

Left-side of image shows Fritzing with the EZDraw pcb and Right-side is Inkscape…

Any Recommendations, Helpful info…?

Thanks

Yes very possibly issue. If you have the height and width set to px (and no dimensions is px), then Fritzing will guess at the dpi (and old Illustrator used 72dpi). The cure is to set height/ width in in or mm so the dpi and scale are specified and Fritzing won’t have to guess. You can also upload the problem sketch / svg (for the svg you may need to rename it to fzpz as the forum sometimes has problems with svgs) using the 7th icon from the left in the tool bar and one of us will have a look at it.

Peter

Thank you for quick response.
Fritzing is set to ‘mm’

Files attached - DPI_Test1.fzz (1.7 KB)
screenshot, SVG (renamed extension) and actual fzz file

90dpi_Test_RENAME.fzpz (1.5 KB)

Just to complete the info, though it has nothing to do with the issue aside from having started this investigation… Attached is image of the actual PCB design

As usual I was insufficiently clear. Your svg is indeed set to px which will cause Fritzing to guess. I recall from someone earlier, I think also using EazyDraw that it may not be able to set the parameters but Inkscape can.
<?xml version="1.0" encoding="UTF-8"?>

<svg
    version="1.1"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:cc="http://creativecommons.org/ns#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:svg="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns="http://www.w3.org/2000/svg"
    width="178.415354331"
    height="178.415354331"
    viewBox="0, 0, 142.732283465, 142.732283465"
    preserveAspectRatio="none"

is incorrect (the forum preformatted text function is also as usual mangling the xml on me somewhat). The lines

width="178.415354331"
height=“178.415354331”

need to be

width="1.858in"
height-“1.858in”

and viewbox is preferably

0 0 1858 1858

to make 1px be 1 thousandth of an inch (although only the in’s are required to make it work correctly). The height and width in px (or unit less) is what causes Fritzing to guess at what the dpi was (and in this case apparently getting it wrong).

Peter

Thanks.
Unfortunately, it didn’t work out:

Adding any units causes Fritzing to not like the file upon loading it.
Changing values, either with or without units also causes loading problem.
In fact, changing the them in text editor causes the Mac to not like the file… display error.

Perhaps it’s my interpretation of your suggested values but, I simply did as suggested. image of one attempt attached. Note: the original file does show correct units and correct 50 x 50 mm values.

Assuming that is the svg you loaded, it needs to be

width=“1.858in”

the “in” is needed to set inches, 1.858 is px. You should also do it in an svg editor such as Inkscape as it may need to adjust the scale of the image (especially if you are trying to also change the viewbox as I did in this one). This one should be correct (rescaled in Inkscape but not loaded to fritzing):

90dpi_Test_RENAME_fixed.fzpz (1.5 KB)

Peter

Thanks.

You saw one image without the ‘in’ units before I posted the one with them.

Yes, I could fool with it in Inkscape but, I don’t like Inkscape but, may have no choice…

Interesting…

Your fixed file works. Looking at mine with “1.858in” Versus your’s with “1.8587239in” (ie, more decimal places)… Does it matter? (guess I could try…) The Curious thing is the rest of the values (in the section regarding the <rect are in px for your corrected file as well as in mine. Logic suggest those would also need changing… go figure.

They can, that’s why Inkscape did the rescale and why the values are a little odd (I normally adjust the viewbow and height / width to be the same but didn’t bother in this case). When you change those values in the xml editor in Inkscape it rescales the entire drawing to the new settings if required. In this case since I rescaled the drawing from somwhere around .75 to 10.41667 to get the 1px = 1thou it, had to rescale the entire drawing and I had to move it after the rescale. The CSS standard insists that some fields (font-size for one) be in px which is probably why some of them are px, as well Inkscape is very configurable (if not easily) so almost anything is likely possible (much of the time when I don’t want it). As long as your svg editor of choice can set the height/width to “in” it should work as well (or probably better unless you are an Inkscape expert which I’m not :slight_smile: ) as Inkscape

Peter

Thank You.

The Answer is… to Use Inkscape!

I setup my default pref’s (units, doc/page size and layers/ID’s).

Made a 2inch by 2inch graphic, saved as Plain SVG. Did not edit the file (just looked at it). Units are correct (inch) except for the ViewBox and actual graphic (they use px).
Fritzing opens the file with correct dimensions and no DRC errors.

This is from the XML:

" viewBox="0 0 51.8 51.8"
height="2.0393701in"
width=“2.0393701in”> "

Thanks again for your help :joy:

That’s unfortunate :slight_smile: . The only thing I’d add (and I don’t know how to do it except manually) is set the scale in

file->document properties->Page to 10.41667 by default. That sets the view box to be 1000*height/width in inches which sets the desired 1px to 1 thou scale in the drawing that the fritzing parts format document calls for. Changing it once the document is made is a number of manual steps which are a pain, so setting it by default would be desirable (when correcting submitted parts I do it manually,
so it is more or less muscle memory for me :slight_smile: )

Peter

I’m not sure if this is relavent but it could be. Fritzing SVGs are SVG Tiny1.2 compliant and when I checked EasyDraws website it says.

Which looks like it may not support Tiny1.2. But it also makes it look like there may be a way to specify saving as Tiny which is likely better than a standard SVG similar to how a Plain SVG is better than a Inkscape SVG when saving in Inkscape.

Thank you, all!

SOLVED!! First: After simply editing the values and re-saving, it didn’t work. I narrowed it down to the Mac’s “TextEditor”. After changing it’s pref’s for encoding/open/export…etc, still no luck.

So, I used OpenOffice and “Bingo!” No problems, all is well with opening/using in Fritzing :grinning:

Regarding EZDraw: For, my needs, the Free version (3.10) works great. It’s easy to use and it does have user switchable export DPI (72 or 90). Also, it exports SVG file types (and, it’s Help feature has a good write-up on SVG for clearer understanding: File types shown in image…

14 AM