Fritzing-Schematic an Inkscape extension

Hi all!

So I created an extension for Inkscape that generates a schematic symbol based on user input. Once you start this extension in Inkscape, a window opens for user input and has a couple of tabs.

The Schematic Symbol tab sets the size of the symbol, it only creates rectangular shapes. Input the size of the schematic symbol and desired name for the label.

The Schematic Connector tab handles the connectors/pins for the schematic symbol:

This tab allows you to set the number of connectors on each side to the symbol, and some options. Once the settings are made, clicking the ‘Apply’ button starts the extension. If any ‘User Defined’ option is checked, as the extension creates the symbol, it’ll open a new window to get the user to enter pin numbers\labels. These windows open for each side of the symbol that has connector pins. Once finished, this extension will create a schematic symbol that can be used in fritzing. I hope…

Using the above screenshot settings, I created a voltage regulator schematic symbol with three pins. I entered the labels for the pins as prompted, and done. Took me less than a minute to generate that symbol. The final .svg I uploaded here:
https://drive.google.com/file/d/1eAzaouX3YPTpSiiQ2IBaeL8x3R-UrYqQ/view?usp=sharing
Because .svg and .zip files don’t work here.

I would love for someone to look at that .svg file and tell me if it will work in fritzing. I used it and it worked in parts editor.

It doesn’t create terminal ID’s, but it could…

Is there any interest in this type of tool?

Randy

1 Like

Both svgs although you do need to zip them, as the forum will detect and try (usually unsuccessfully) to render the svg and zip files can be uploaded as either .fzp (preferred!) or .fzpz files (undesirable because they aren’t parts!) then tell us that it is really a svg or zip file.

I’m certainly interested, is the Inkscape extension available somewhere? I’d like to try it out.

Peter

This looks interesting.

Not at this moment, it needs a bit more work before it’s ready for that. Right now, I want to make sure the .svg it generates will work with fritzing. The main thing I am curious about is the way the text labels (both symbol label and pin labels) are created. Will they cause any problems with fritzing? I mean, I tested it out and didn’t see any problem with it, does anyone else see a problem with it?

Thanks,
Randy

Sure!

Let us know when we can test it :slight_smile:

Regards

It should work fine as is, but here are some improvements. Starting from the original svg

FritzingCheckPart.py (an as yet unreleased development version) has this warning

Warning 32: File
‘voltreg.svg’
At line 12

Scale is not the desirable 1/1000 ratio from width/height to
viewBox width/height.

to fix that

edit->select all

edit->resize page to selection

select group schematic in xml editor

Object->ungroup

to resize the view box to start at 0 0

then lock width to height (to keep circles circles instead of an ellipse due to floating point roundoff), enable “when scaling objects scale stroke-width proportionally”

FritzingCheckPart.py (an as yet unreleased development version) has this warning

Warning 32: File
‘voltreg.svg’
At line 12

Scale is not the desirable 1/1000 ratio from width/height to
viewBox width/height.

to fix that

edit->select all

edit->resize page to selection

select group schematic in xml editor

Object->ungroup

to resize the view box to start at 0 0

then lock width to height (to keep circles circles instead of an ellipse due to floating point roundoff), enable “when scaling objects scale stroke-width proportionally”

now in the tool bar set width back to 116.160px to retore the image to the correct size then unlock the width/height and disable scale stroke-width (my usual setting)

Now on to the elements of the svg. First here is the grid settings I use. The x and y origins are offset 0.005in, so with the standard 10thou stroke width the grid lines are in the center of the 10thou line and lines should be on an even 0.1in boundary.

Here I have selected the label text field. The font-size is currently 78.7402px, that should change to 60px (as specified in the graphic-standards document here

https://fritzing.org/fritzings-graphic-standards

the part file format document here is also useful for this

The rest of the setup looks fine. The fill is #000000 as it should be.

On to the pin label. Again it is mostly good, the font size should change from 39.3701px to 35px (and desirably lose the px, but I don’t think Inkscape will do that!) The fill is the correct #555555 value called for by the graphic standards.

The pin number needs to drop to 25px to match the graphic standard.

the ground pin (and top/bottom row pins in general) are more of a problem. I prefer to have all the text readable the same way, but with long pin labels your current method is probably better. I added a text-anchor:start to the label (so more text will start at the correct place and grow upwards and centered the text on the middle of the pin. For text on the top, the anchor needs to be end (so the text grows down.) I rotated the pin number 90 degrees to match the rest of them (as pin numbers are typically small enough to not be a problem.

The pins are correctly aligned on even 0.1in boundaries, I usually use a pin width of 0.105in rather than 0.110in but either will do. All that results in this svg (trying to upload the svg directly got

capture8

so I zippeed the file as voltreg-improved.fzp (you need to zip it because otherwise the forum discovers that it is an svg and tries to render it with the failure above) and then upload the fzp

voltreg-improved.fzp (1.1 KB)

If you download and unzip this you should get my modified svg file.

Peter

[edit] Stay tuned, more info to follow[edit]

While staying tuned I grabbed voltreg_2.svg and fixed it up. I think you may have correct the problems but just in case here is what I would do:

Initial state of voltreg_2.svg

the start x and y are not 0 0 (and the scale is wrong)

To fix it, ungroup everything then edit->select all then edit–>resize page to selection which moves the origin to 0 0 as desired. Then lock width to height, and save the current width in px (116.160). Now change the scale to 10.41667

then change the width back to 116.160 which gets the drawing back and sets the view box to the correct values (100 x the width and height to within fp roundoff.) I think from the comments you already know there is a problem here, but I wanted to get the svg to the standard scale.

Now I need to add terminalIds on all the pins. At present a wire will connect to the center of the pin (i.e. 0.05in from either end.) Setting a height/width 10 10 (.01in .01in) rectangle on the end of the pin and calling it connecorxterminal will do that like this:

Then edit->select all Edit->resize page to selection Object->group and set the id to schematic which gives us the desired final svg

voltreg-improved.fzp (1.1 KB)

which is the zipped svg file.

Peter

Great!

Can you publish your add-on so I can extend this @Inkscape - or is this just for you?

Kind regards
Chris