Design of footprints using Fusion 360 and/ or Inkscape with svg2shenzhen extension

I am trying to develop a workflow whereby a footprint can be designed using Fusion 360 with, for example, a 3D step model as the starting point.
This presumably involves (as I have done) then using Inkscape together with its associated svg2shenzhen extension to generate the Kicad-format footprint file.

Depending on the starting point, an alternative workflow would be to design the footprint in Inkscape (as an SVG file), again using the associated svg2shenzhen extension to generate the Kicad-format footprint (.kicad_mod) file.

Although I have achieved an end-result, for practical purposes, it seems pretty much useless as a result of apparent limitations of import/ export performance of the tools!

I shall document my efforts to-date based on the Fusion 360 starting point and provide the set of files so that anybody interested could follow along and, hopefully, define an improved workflow with an end-result that is satisfactory.

The question could be asked: “Why would one want to design a footprint outside of Kicad using Fusion 360?”

Two examples address that question.

  1. If a 3D step model is available, then using Fusion 360, a projected sketch can be used to easily define the footprint.
    This could be a useful approach especially where the footprint is of a complex shape.
    I shall describe the example based on a connector in the following.
    I accept that this particular relatively simple example could easily be done directly within Kicad - but it serves as a means to define a possible workflow that could be useful for more complex footprints.

  2. I shall shortly need to define a complex heatsink which includes 6x IGBTs, 2x bridge rectifiers and temperature sensors mounted on it.
    The heatsink will be a custom design to be CNC machined.
    Consequently, a 3D (Fusion 360) model is required.

The 3D model can also define where the 7 or more devices are to be mounted on it, together with their mounting holes on the heatsink.
It will be desirable to generate a footprint of the complex heatsink + mounted devices.
Ideally, the Kicad composite footprint would be produced directly from the Fusion 360 model.
After importing into Kicad, the footprint (i.e., heatsink plus 7 devices as a single composite footprint) could be moved about to the preferred position on the PCB.
In that way, there would be no risk of the device locations becoming separated from where they are to mount on the heatsink.

During routing within Kicad, it may be found desirable to change the position of one or more of the devices.
The intention is that such changes could easily be made within Fusion 360 followed by repetition of the workflow to generate an updated footprint for Kicad.
In this way, consistency between the 3D model and the footprint would be maintained.
[This methodology only makes sense if the workflow is simple and involves a minimal need for tweaking during each step - which, unfortunately, does not currently appear to be the case :frowning: ]

Other reasons to favour the approach is that Fusion 360 provides the benefits of parametric modelling; if I should decide to change a dimension of the heatsink, everything else would be updated in the model.

Returning to the example of the connector which I have been using, the starting point is:
07JQ-BT.step (348.6 KB)

eJQ.pdf (398.7 KB)

I imported the step model into Fusion 360 and created a projected sketch, refer graphic:

This includes an offset outline (as would be used for the courtyard of the footprint) which is very easy to do in Fusion.
The PCB pin positions are shown - the sketch defines points corresponding to the pin centres.
My thinking was that it would be simplest to add the pads themselves after the conversions and import into Kicad.
[Hopefully, the pads could also be done in Fusion 360 or Inkscape in the future - at this stage I didn’t want to complicate matters during testing of the basic workflow!]

I added a rectangle of 30 x 15mm for the purpose of being able to check for accuracy of conversions after the export/ import operations.
The sketch can be easily exported from Fusion 360 as a DXF file.
07JQ-BT.dxf (13.0 KB)

There are no options for the export (so aspects such as the particular version of DXF file or how scaling/ dimensioning is managed by Fusion 360 are unknown).

The svg2shenzhen extension for Inkscape needs to be downloaded and added to Inkscape, as documented at

Using the svg2shenzhen extension, the process within Inkscape involves first using the extension’s “Prepare Document”, which defines the area onto which the imported dxf is to be placed; I don’t think the size is important as long as it is sufficiently large. The preparation process also involves defining the particular layers that the drawings will relate to in Kicad.
[Subsequently, elements of the drawing need to be relocated to the layers - either within Inkscape or could be relocated between Kicad layers after importation of the generated footprint into Kicad).

The next step is to import the dxf into Inkscape, refer graphic:
Inkscape_DXF_Input

I found that with “Method of Scaling” set to “Read from file” the imported sketch was much too large (so apparently Fusion 360 doesn’t properly provide the units and/ or dimensions).
However, by using “Manual scale” as shown on the graphic, the imported dimensions were correct.

Within Inkscape, it is also worth checking the “File … Document Properties” which includes unit value (mm) and scaling options that would likely also influence the result, refer

The imported sketch needs to be tweaked in various ways within Inkscape, including at least:

a) Reducing the line width to, for example 0.1mm.
Following the import of the dxf file, the lines were excessively thick.

b) Relocating to layers, such as F.SilkS, which are subsequently to be used in the export to Kicad process.
[I kept things ‘simple’ by moving everything to that single layer, with the thinking that it would be simpler for an Inkscape beginner such as myself to subsequently do duplications/ deletion of elements and their relocations between layers from within Kicad).

c) Everything needs to be converted to a path.
In prior tests, if for example a simple rectangle is drawn within Inkscape, it doesn’t show up in the generated Kicad footprint.
The process involves converting that rectangle to a path.
As an aside, I don’t understand why clever people write complex software such as svg2shenzhen, which presumably involves a lot of time and effort, make it publicly available, yet make minimal attempt to properly document it!!!

Inkscape SVG file:
07JQ-BT

[Why does that file show only as an image, rather than an uploaded file?!]

At this stage, the result within Inkscape is as follows:

This is then “Export[ed] to Kicad” using the second facility of the svg2shenzhen extension.
07JQ-BT.kicad_mod (19.6 KB)

The resulting file 07JQ-BT.kicad_mod is then added to Kicad and appears as follows:

The first impression is that everything is fine!
However, by clicking on elements of the footprint, it is apparent that most aspects involve excessive smaller elements, refer:

Even the simple rectangle that was used for the purpose of checking dimensions seems to comprise double lines, apparently involving the inside and outside of the strokes, refer

Consequently, much rework will be required to produce a footprint in which all the excesses and issues are resolved!
The conclusion is that despite all the effort, the workflow/ toolset appear to be of little or no use!!

Looking on the web, I investigated the svg2shenzhen extension in more detail.
Reading the “issues” on its github page, one learns that the process involves “vector to bitmap to vector” conversions.
Consequently, it is hardly surprising that numerous artifacts are being introduced in the conversion process.
Obviously, it makes little sense to involve bitmaps!!!
It would be useful if the author of a tool would clearly define its limitations and issues, thereby avoiding wastage of time and effort by potential users!

There is a more recent fork of this Inkscape extension by drayde

I haven’t tried that version.
It appears to be based on the same “vector to bitmap to vector” conversions although may resolve some of the other issues for a practical usage?

There is also svg2mod
[Maybe svg2shenzhen is partly based on or depends on this?]

The latest (forked) maintainedversion seems to be at

[The original/ now un-maintained version is at GitHub - mtl/svg2mod: Convert Inkscape SVG drawings to KiCad footprint modules ]

This svg2mod appears to offer the potential for being more useable than the svg2shenzhen extension.
Apparently, svg2mod does not involve going through a bitmap stage in the conversion process so hopefully doesn’t introduce the resulting artifacts in the result of the conversion.

Has anybody tried this svg2mod ?

Changing the subject somewhat (probably deserves a separate forum topic?), I am also interested in the workflow for producing the best quality graphics.
I need to design a PCB-based front panel for which the highest resolution achievable for the silkscreen text is desirable.

The text and graphics could be designed in Inkscape as an SVG file.
In theory, the svg2shenzhen extension could be used to produce a Kicad file.
In practice, the “vector to bitmap to vector” conversion process of that tool may degrade the quality?
Of course, the actual silkscreen will be screen-printed or sprayed so is a bitmap so the quality may be okay?
My question here is: "Can anybody recommend the best methodology/ tools to achieve optimal resolution of a Kicad silkscreen? (Probably starting with an SVG file.)

I have only now realised that it is possible to directly import a DXF file into a Kicad footprint.

I attach a screenshot and the associated kicad_mod file.

TestDXF_Import.kicad_mod (17.5 KB)

This has the potential to offer a simple/ workable solution …

In theory, the svg2shenzhen extension offers the benefit of being able to import an SVG drawing which includes full definition of each layer.
However, in practice, the artifacts introduced (even for simple lines or rectangles!) appear to make the tool have little or no practical utility?!

I am still interested if others can provide a practicable workflow, maybe using svg2mod or other utilities.

It’s meant for PCB art (freehand shapes), not for technical drawing.

By ‘freehand shapes’ I assume you mean things like Bezier spline curves generated in Inkscape?

Surely, ‘technical drawing’ (generally involving straight lines) is a much simpler use-case compared to PCB art?

Based on the svg2shenzhen tool’s inability to cope with even a simple rectangle, I am highly doubtful if it could do a reasonable job in dealing with a complex curve.

The process by which a line or curve is split into multiple small straight line segments or pixels (or whatever the tool does …) needs to be documented.
With the benefit of basic documentation, one could identify whether or not it has any utility for particular application.

How would, for example, a circle be processed? i.e., would it be converted to multiple small straight line segments or pixels?
What would be the number of segments or pixel density?
How would it deal with vector-based text?
One could experiment with each of numerous such objects - but it will be understood that the process of evaluation without having the benefit of proper documentation is very time consuming.

I already spent (some would say ‘wasted’) a weekend being frustrated with the example usage which I have described.

Does anybody know whether the svg2mod extension (also undocumented) is worth spending time with?

Instead of svg2mod route, have you explored doing your design in Fusion360 (which you are apparently comfortable with) and then using FreeCAD with the KiCadStepUp plugin to transfer your footprint design (presumably STEP) into KiCad? See GitHub - easyw/kicadStepUpMod: kicadStepUp: ECAD to MCAD FreeCAD WorkBench for info about StepUp. You may need to experiment with how to configure your model in Fusion360 so it loads into FreeCAD already configured for StepUp.

I, personally, haven’t done this so I may be way off base with this suggestion. But it may be worth a weekend to evaluate.

I haven’t investigated FreeCAD - I was assuming that Fusion 360 (which, as you assumed, I am rather familiar with) would be a more powerful 3D modelling solution - so why learn yet another 3D tool?!

Equally, I haven’t considered kicadStepUp.

Too many tools to learn :frowning:
I am spending my time at the moment on learning Inkscape - a knowledge of generating drawings based on vector-based SVP files seems to be generally very useful.

I shall follow up the link you provided.

Another route yet to be fully explored is the generation of a DXF file from Inkscape with subsequent importation into a Kicad footprint.
(Or multiple DXF files corresponding to the various layers of a Kicad footprint?)
The starting point for the DXF file(s) could be Fusion 360/ it could be subsequently worked on in Inkscape/ then imported to Kicad.

I am doubtful that svg2shenzhen adds any value compared to a direct importation of a DXF file into Kicad.
{The conversion of simple lines or rectangles to multiple small elements is of concern …)

svg2mod may offer some benefits since I believe it does not involve conversion to a bitmap in its process.
Yet to be investigated … or advised on by others that may have used it.

I think that I need to start an additional thread entitled something like:
“How to generate high quality text for silkscreen”

That thread could encompass aspects such as optimal fonts to use, optimal conversion process from SVG (Inkscape) file (or a LaTex Postscript file) to a Kicad bitmap.

My mistake. I meant svg2shenzhen when I said “svg2mod”.

I understand the resistance to having to learn another CAD package (FreeCAD in this case), but the StepUp plugin is so powerful (and originally designed for your exact issue) that you shouldn’t need to learn more than the basics in FreeCAD (which can be a struggle in itself) to use the StepUp plugin. Search this forum for StepUp to find some demonstration videos of footprint generation. There is one that I can think of showing how to go from a STEP file downloaded from a manufacturer to a footprint in KiCad. Found it, see this post: Kicad StepUp: The Sketcher for Footprint generation - #18 by maui

I’m not advocating you abandon Fusion360 for FreeCAD, simply using it as glue in your workflow. :wink:

1 Like

As @SembazuruCDE mentioned, @maui’s KicadStepUp handles this workflow for you in FreeCAD. I have Fusion360, but use StepUp to generate the 3D step/wrl fitted to the Kicad footprints. You can also draw the footprint in FreeCad from the vendor drawing, pull in the vendor step (or modified version you make) and have StepUp export the footprint+step+wrl directly into your Kicad library.

I do this in FreeCAD, then export the board assembly step (again using StepUP) to pull the assembly back into Fusion360 or Inventor.

The next question would be why FreeCAD vs Fusion? @maui can answer better, but FreeCAD is open source and has a nice workbench plugin architecture available to pass data between the MCAD (FreeCAD) and ECAD (Kicad) fairly seamlessly. KicadStepUp has gotten pretty powerful, I would recommend checking it out before reinventing the workflow wheel.

EDIT: @SembazuruCDE and I were responding at the same time :wink:

2 Likes

Well, you would be correct, but …

Fusion 360 doesn’t offer a Linux version. And a lot of people using KiCad are on Linux.

That having been said, FreeCAD is infuriating on quite a few fronts. The biggest one is that it regularly renames objects and reattaches them wrong when the geometry recomputes.

As long as you are staying inside an “established workflow” (a la KiCadStepUp) FreeCAD is fine–it just functions as an engine that is driven by the flow. However, the moment you step outside of that you are in for pain.

I simply can not accept the eula of that software.
Also, autodesk has a long history of buyin up small companies, maybe extracting or re-using some of their ip and then letting the old software die.

FreeCAD has it’s issues, but it’s mostly usable, and because it’s an Open Source program just like KiCad, it fits much better with KiCad. I am also running Linux. And because KiCad is pretty much the only good EDA/PCB program that runs on linux natively, you 'll find that a relatively lare portion of Linux users on this KiCad forum.

But that said. the KiCad StepUp workbench for FreeCAD is not designed by the “KiCad team” but by one (or a few?) of it’s users. It’s not even part of KiCad, but a plugin in FreeCAD itself. If someone is interested enough to make something similar for one of the commercial mechanical CAD packaged, then that can probably be done.

1 Like

That is why I chose FreeCAD:

  1. Open source (I mostly use only open source sw in my job)
  2. fully scrip-table with extremely power and versatility
  3. dev environment fully open to improve functions following user’s need
  4. extremely reliable (particularly since 0.17 release) on STEP import/export
  5. it will not change abruptly its API because developers are really user care
  6. it will never block its API because of the open source structure
  7. open source (again :smiley: )

Please note that all (most) of the KiCAD 3D libraries are based on FreeCAD scripts.
Here you can also add an other point:
7) everyone can use FreeCAD at any time (without the risk of suffering a change in functionality/license) and contribute to the libraries.

that may depends on your workflow…
There are many FreeCAD users who achieve excellent results without suffering any problems.


V0.20/Assembly4 Challenge–Creo Motorbike

I haven’t yet had time to investigate FreeCAD and KicadStepUp.

Do these tools have a ‘knowledge’ of layers, i.e., can the drawing in FreeCAD encompass several of the Kicad layers (F and B copper, silkscreens, courtyards, etc.)?

My current workflow using Fusion 360/ export of its sketch to DXF and importation from within the Kicad footprint of that DXF works okay.

The single sketch in Fusion includes lines for each of the layers within the same sketch - but the sketch has no knowledge of ‘layers’!
That results in the need to reallocate the lines to the actual layers by editing within the Kicad footprint after importation of the DXF file.
Although this reassignment process is somewhat tedious, it doesn’t compromise the dimensional accuracy, i.e., errors between the 3D model and the final footprint appear to be unlikely to be made.

The alternative would be to make separate sketches in Fusion for each layer, then export each sketch as a separate DXF and input each DXF, directing it to the appropriate Kicad layer.
That would result in less rework in Kicad but more initial work in Fusion.

For either variant, there doesn’t seem any obvious way in which a plated through-hole pad could be defined in Fusion and find its way into the Kicad footprint.
It is easy enough to add the pads from within the Kicad footprint editor as a subsequent process - since they are usually on a simple grid it only involves a few clicks after defining the grid …

The subject of ‘layers’ was the potential benefit of introducing Inkscape into the workflow.
SVG files support layers and, after importing the DXF from Fusion, the single layer DXF can be fairly easily split into the named Kicad layers of the SVG file.

In theory (but apparently rather badly in practice!), svg2shenzhen can then directly convert the Inkscape SVG as a multi-layer Kicad footprint.

In the example of the connector which I worked through, the starting point was the 3D step model.
The step file was available but no footprint could be found.
So I simply projected relevant edges of the step model onto a planar sketch in Fusion 360.

People are writing about designing footprints using FreeCAD and KicadStepUp.
How well/ easily would it cope with determining the footprint from the starting point of a 3D model?

We need to investigate the svg2mod utility!
Maybe it has a part to play …

I am also interested in finding the optimal process for getting high quality text and graphics - what is referred to as “PCB art” but is also required for things like PCB-based panels.
For “PCB art” text and graphics may be defined to appear on various layers - copper, silkscreen, “negative silkscreen” (in which the text appears in the mask colour rather than as the white silkscreen).
The process presumably can best involve Inkscape with the SVG files having the benefit of a proper knowledge of layers (in contrast with Fusion 360, which doesn’t!).

I am much more familiar with LaTex than Inkscape so could more easily define the text and graphics within LaTex, which results in a Postscript (.ps or .eps) vector file.
Presumably Postscript doesn’t support layers so the .ps file (in which layer intentions would be defined using colours) would need to be input to Inkscape, from where the colour-coded graphics could be assigned to relevant layers.
Again, there is then the need to get from the SVG file into Kicad …

Is everything in Kicad based on bitmaps rather than vectors?
I understand that Kicad deals with graphics (and presumably also text?) as bitmaps?
Is a routed copper track also a bitmap? Or is it a vector?

@Douglas777, I would recommend watching the video in the link @SembazuruCDE provided above for Sketcher footprint generation. In the video @maui walks through exactly what you are asking (I think), downloading the 3D model of a part with surface and through-hole pads and creating the derived footprint with all the layers in FreeCAD, then exporting to the Kicad library.

Also, the Kicad tracks are all vectors, not bitmaps. If you open a pcb file, you can see this.

I just bumped into: M2.3 Freecad is the preferred design tool - Library Conventions | KiCad EDA and then thought of this thread.

M2.3 Freecad is the preferred design tool

The goal of the KiCad 3d model library is to provide a free open library of 3d models. The use of open source design tools is preferred for this very reason.

Freecad is chosen as the preferred tool to be used. Especially in combination with the kicad-stepup extension.

Good alternatives are open scripting options like OpenSCAD or CadQuery. For the latter consider contributing to KiCad / KiCad Libraries / KiCad Packages3D Generator · GitLab

Files created in closed source tools are permitted. If a certain model is available designed in both an open and closed tool then the one from the open tool is preferred and will replace the other one.

And this makes sense to me.
Step models are a usable format for exchanging data between programs, but they are not easy to edit, and a part of the maintenance work on the libraries is to correct errors in existing 3D models, and also variations of 3D models can be made by starting with an existing 3D model.

In addition to this 3Dmodels can have copyright issues. This does not matter much for personal use, but 3D models that do not have an explicit compatible license or for which the history is not clear probably can not be added to the default KiCad libraries. In KiCad V6 all icons were redesigned (for the 3rd time or so) just because there were a lot of icons for which the history was not clear, and apparently some had known copyright violations.

I watched with interest the video of @maui provided in the link from @SembazuruCDE

This appears to be a good workflow and as @paulvdh indicates it makes a lot of sense to have a standardised approach/ custom toolset for generation of footprints for use in the public domain Kicad libraries.

Being already fluent in the use of Fusion 360 and currently having only a need for some special custom footprints, from my perspective it makes more sense to keep to my method which works well enough for my own needs.
A lot of studying/ learning would be involved to become fluent in these other tools (and I am currently busy learning Inkscape - which is a challenge in itself!).

I previously mentioned that I had the need to design a heatsink with various mounted devices.
I attach an illustration of this:

I can easily project this 3D model onto a planar sketch to obtain the corresponding ‘composite-component’ footprint.

The same 3D model can be used to ensure that the design ‘fits in the enclosure’!

A good feature of Fusion 360 is that it enables parametric design.
I attach a graphic of the parameters:

I find this to be much better compared to having ‘magic numbers’ in a design - if I look at this again a year from now I shall understand what is happening!

Since everything is inter-related and parametric, if I change some of the parameters, everything should update automatically (assuming that my design process has been properly done to achieve that objective!).

Does FreeCAD offer such parametric-based design functionality?

The process demonstrated by @maui in the video shows that everything including Kicad layers and pads is designed in FreeCAD/ using KiCadStepUp.
My approach is more simplistic in that I make no attempt to define the layers or copper pads in the Fusion model.
I simply generate a single dxf file, import that into the Kicad footprint (selecting a particular line thickness such as 0.12mm).
From within the Kicad footprint editor I then sort out, i.e., reallocate between layers and change line thicknesses based on the Kicad recommendations.

This takes a little effort but at least I don’t have to work out dimensions for the various elements.
I only need to do a “Move exactly” for everything after importing the dxf into the footprint editor if the Fusion origin was different from that of the required footprint.
(I could, of course, instead do that in Fusion 360 - i.e., redefine the origin and orientation - before generating the dxf, if I wanted.)

Fusion has no knowledge of appropriate pad sizes/ hole sizes/ plated through holes, etc for a Kicad footprint.
In theory, these aspects could be added to the Fusion model.
However, it seems simpler to just add the pads of appropriate type from within the Kicad footprint editor after importing the dxf file.

I need to find the Kicad information relating to recommended pad sizes and drill holes!
If a datasheet shows a pin diameter of, for example 0.9mm, I have no clear idea at the moment as to how much clearance is appropriate to include in the pad hole!

Whilst there will be Kicad-recommended pad sizes for the various categories of components, for customised components the pad sizes could vary depending on the specific needs of a particular project.
For example, I may use larger-than-normal pads for the IGBTs if I find there is no need to pass tracks between them.

Yep. I often try to use parametric design when making widgets that I 3D print. Really makes tweaking a design during the iteration process easier. But the process isn’t as intuitive as it looks like in F360 as it uses the Spread Sheet WB and you have to build the structure yourself. But then FreeCAD doesn’t cost nearly as much as F360. :wink:

But, again, I’m not trying to encourage you to learn how to use FreeCAD as well as you know F360. If you follow @maui’s tutorial videos you really don’t need to learn much more of FreeCAD than those specific workflows.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.