Unfortunately the tutorials are mostly a mess. Many of them (other than mine and Old_Grey’s) are for older versions of Fritzing and only somewhat apply any more. I learned to make parts by asking questions here, and am now paying that previous assistance forward
. If we can manage to rekindle interest in Fritzing (by restarting development which I’m slowly working on) maybe we can find someone to improve the tutorials situation.
That is fairly ugly, but good to know! I may add that to the Inkscape tips page. Is there a way to convert all the stroke widths from px back to in or do you have to change them individually? I haven’t seen any problems with Inkscape reading Illustrator svgs so far. Unfortunately leaving the svgs dimensioned in px is a bad idea. Fritzing tries to guess what the DPI value for px is based on something in the svg and often gets it wrong. So dimensions in in or mm are a far safer bet (as the svg looks fine in the svg editor but is the wrong scale in Fritzing if it guesses wrong). It is preferable to have a scale that makes 1px = 1 thousandth of an inch (although that isn’t consistent even in the core parts so far, one of my projects is to fix that …). I know how to rescale the drawing in Inkscape to get the drawing to the desired scale, but not how to do it in Illustrator. Using the pcb svg from this part as an example, Inkscape sees the scale as 0.75000 when the desirable scale is 10.41667 (why this odd number I’m not sure, but this is what produces the desired result in the view box definition
). This produces this xml in your svg:
xmlns=“http://www.w3.org/2000/svg”
height=“0.541639in”
xml:space=“preserve”
y=“0px”
width=“0.433431in”
x=“0px”
version=“1.1”
viewBox=“0 0 31.207 38.998”
whereas the pcb svg from my BME280_improved part has the desired (as specified in the parts file format document at:
which is a useful reference document!) 1/1000 ratio and looks like this:
xmlns=“http://www.w3.org/2000/svg”
viewBox=“0 0 427.27806 535.54202”
y=“0px”
height=“0.53554183in”
gorn=“0”
xml:space=“preserve”
version=“1.1”
width=“0.42727792in”
The difference is the ratio of the height/width here is the desired 1/1000 ratio (which sets 1 px to be 1 thousandth of an inch and thus 100 drawing units (after translates which complicate things) is .1 in. Having this ratio makes it possible or the part checking script to check pin spacing on connectors for instance (although it doesn’t yet do that). Worse, some of the parts generated by Fritzing don’t use this scale (I think ICs are one example) if I can get a development environment working again (which is close) I’l make a code change to make generated parts consistent and hopefully fix up those in the parts repository.
Yep that appears to be correct. In Inkscape hole diameter would be 0.078in with a stroke-width of 0.02in and the generated hole is 0.038 (from hole diam - (2 * stroke-width) = hole size). It looks like in Illustrator it is hole diam - stroke width (in inches) which is good to know. Coral Draw has a third way of setting the hole diameter (which is documented in an older forum post somewhere). This part looks fine. This part generates two hole sizes according to the gerber drill.txt file:
T100C0.037972
T101C0.038000
The hole with the square pad is slightly smaller (but the board houses typically round up to the next standard drill size which will be 0.038in).
The check script generates only warnings (which don’t affect the operation of the part.) Usually the layerIds (breadboard, icon, pcb schematic) are groups rather than drawing constructs with labels like this (from the pcb svg):
usual:
<g
id=“copper0”
<g
id=“copper1”
<rect
fill=“none”
…
not usual (and generates a warning):
<polyline
id="silkscreen"
...
I don’t know if Fritzing will find the layerId if it isn’t a group and if the layerId is missing the part won’t export as an image (such as a pdf or a png file) but works in all other respects (such as making boards, the gerber export works fine). It is desirable to have the first group in pcb be Silkscreen. If silkscreen is the last group (as in your part) Fritzing tends to select the silkscreen object first (which is rarely what you want) when editing in pcb view in Fritzing.
Peter