KiCad StepUp: The Sketcher for Footprint generation

Hi @Rene_Poschl
I updated the WB adding REF and Value font size as suffix in the FC file

I should have also fixed the REF & Value text exporting to kicad fp …
ref-label-text
please have a try
M

1 Like

With 1mm text size it might be better to set the text width to 0.15 (or in general text size * 0.15 rounded to two digits)


Also it would be really helpful to have the courtyard rounded to some grid. But to be honest i have no idea how the interface for that could look like. Does freecad support custom fields in sketches somehow? (Maybe a first step could be to round to 0.01mm grid by default.)

ATM it is text size * 0.2 but I can arrange it to 0.15

The origin for sketch is placed to the anchor of the fp … So if you constrain the sketch relatively to the center (0,0) you should be fine.

Great writeup. You are to be commended for your effort. Three comments:

  1. I think that Molex is one (the only?) manufacturer showing footprints in the STEP models. Many other manufacturers don’t.

  2. In order for the footprints to be visible (at least in the Molex-supplied STEP files), don’t you have to check “Enable STEP Compound merge,” accessed in Edit→Preferences→Import-Export→STEP?

  3. I think it may be a good idea, especially newbies, to mention that the footprint-3D alignment procedure, lucidly described after “1. The 3D model now,” applies regardless of how the footprint has been generated.

@cflin,
if the manufacturer will not offer footprint outline as STEP model, a DXF or a pdf should be available… then the route is a bit more complex, but similar.

@rdtsc
I’ve added your doc to the Demo files of the latest update… Thx for your contribution :smiley:
Maurice

1 Like

I get some python error when generating footprint. I have one complex pad and it seems that if I delete it footprint is generated, but with it, there is error. Could you look if I’m doing something wrong?
SKY13323-378LF.fcstd (10.9 KB)

Edit: I can’t get error text because it shows briefly in freecad window bottom line, and only part of it.

  1. your fp has Pads_TH_SMD with a polyline included
  2. your polyline has arcs inside
  3. your polyline miss the circle reference pad (as it is in kicad polylines)

I’ve updated your FC file:

  1. added a Pads_Poly sketch (copying from Pads_TH_SMD sketch)
  2. removed the ‘arcs’ in poly substituting them with lines
  3. removed polylines from TH_SMD sketch and rectangles from Poly sketch
  4. added a reference circular Pad to Polyline sketch

(You can open the example footprint-template-roundrect-polylines.FCStd in the Demo Menu to have a look in which way Poly are generated)

ATM StepUp doesn’t support ‘custom’ pads with primitive geometry as in latest updates … polyline pads accept only line segments.

Attached the FC file with the correction and the fp for Kicad.
You would need to play with pad numbering and clearance.
SKY13323-378LF.kicad_mod (2.9 KB)
SKY13323-378LF-Lines.fcstd (21.3 KB)

you need to enable the view of ‘Report panel’ in FC through the FC View menu.

Maurice

1 Like

After finally getting a hang of FreeCAD so I can make my own gorgeous 3D models, I’ve been trying to play around with KiCad StepUp to generate footprints in FreeCAD aswell because, to be honest, doing the geometry in KiCad is just a pain when you’re used to the constraints-based sketcher in FreeCAD.

Anyway - when I try to convert a simple fully constrained sketch for a SMD resistor (consisting of two rectangles, with symmetry and appropriate dimensions applied) to a footprint, the footprint pad sizes generated via KiCad StepUp are incorrect.

The footprint shows the following for the pads:

(pad # smd rect (at -0.7250002654420882 -2.2880947525560913e-08) (size 0.6499999307480184 0.900000006403322) (layers F.Cu F.Paste F.Mask))

(pad # smd rect (at 1.0499997586708563 -0.4500001526022491) (size 8.514926053138083e-08 3.952026736975256e-07) (layers F.Cu F.Paste F.Mask))

Not only are the coordinates ‘rounded’, but some are also simply too small - I could only see one pad in the footprint viewer.

Can anyone shed some light on this? I was hoping to have a productive library day :smiley:

Panasonic ERJ Footprint.FCStd (4.6 KB)

That’s true. The first iteration is often pretty easy, but when you have to modify something, you have to move and edit several graphic items instead of just one item or one value. However, this may change in the future - the graphics system will probably be changed for 6.0 and will have some kind of constraints.

That said, FreeCAD will always be better for complicated designs, and StepUp is a fantastic help.

1 Like

Which release of FC are you using?
Which release of StepUp?

What I get from your FC file is:
Panasonic_ERJ-3EKF.kicad_mod (944 Bytes)

  (pad # smd rect (at -0.7249999999999999 -0.0) (size 0.6499999999999998 0.9)  (layers F.Cu F.Paste F.Mask))
  (pad # smd rect (at 0.7249999999999999 -0.0) (size 0.6499999999999998 0.9)  (layers F.Cu F.Paste F.Mask))

which is pretty correct and can be checked importing it back in FC

1 Like

Sorry about that lack of info, I should’ve known better… I will try some other simple shapes and sketches to see if I can pinpoint it a little bit.

EDIT- I remember noticing I was 1 commit behind on StepUp, let me update that aswell…

Application: kicad
Version: (5.1.2)-2, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.68.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.61.1
Compiler: GCC 8.2.0 with C++ ABI 1013

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16945 (Git)
Build type: Release
Branch: master
Hash: d818a9638424a934bd9da74d187a1af4cb773f05
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)

EDIT 2 - Guess I have to fix something else first, bloody windows…

PermissionError: [WinError 5] Access is denied: ‘C:\Users\jules\AppData\Roaming\FreeCAD\\Mod\kicadStepUpMod’ -> ‘C:\Users\jules\AppData\Roaming\FreeCAD\\Mod\kicadStepUpMod.bak’

This sometimes may happen using the FC Addons Tool…
Just close FreeCAD and manually delete the folders:
C:\Users\jules\AppData\Roaming\FreeCAD\\Mod\kicadStepUpMod
and
C:\Users\jules\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod.bak
Then open FC ad install StepUp WB as usual

2 Likes

Hi, i’m new to the StepUp-Tools and for the start i want to modify existing footprint.
Unfortunately I get an error message during import and the footprint is not displayed correctly.

My FC Version:
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4 (GitTag)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)

The error message:
kicad StepUp version 9.1.0.7
tolerance on vertex applied
KISYS3DMOD=C:\Program Files\KiCad\share\kicad\modules\packages3d
module_3D_dir=C:\Program Files\KiCad\share\kicad\modules\packages3d/…/
FC Version 018
VBO status False
FootPrint Loader C:/Program Files/KiCad/share/kicad/modules/LED_THT.pretty/LED_D1.8mm_W3.3mm_H2.4mm.kicad_mod
LED_D1_8mm_W3_3mm_H2_4mm_fp
Unhandled Base::Exception caught in GUIApplication::notify.
The error message is: Access violation
Unhandled Base::Exception caught in GUIApplication::notify.
The error message is: Access violation

Does anyone have any idea why?

Best regards
Juergen

Unhandled Base::Exception caught in GUIApplication::notify.

This seems an error on your graphic drivers as reported on FC forum

But it also depends how good the graphic driver works and supports the offered OpenGL version. I think it’s worth to check if there are updates available for your graphic driver.

An other option would be to use the FC 0.19 dev release to handle this task.

Thank you for your immediate response. On my other computer it works.
I’l check the drivers on my first computer.

Best regards
Juergen

Updating the graphics card drivers didn’t solve the problem.
After installation of the 32Bit FC 0.18.4 Version it works.

Thanks for reporting…
That is definitely a Qt5 or driver issue …
FC0.18.4 32b is based on Qt4

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 32-bit
Version: 0.18.4 (GitTag)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0

Hi @maui I can confirm the error seen by JSt, after updating to the last version I receive it too:

Working version:

PoM not present
using 'Part' container
FC Version 018-16131
kicad StepUp version 9.0.2.5
tolerance on vertex applied
applying Materials to Shapes
your home path is ++++++++
export to STEP False
Tabified done !
done!
KISYS3DMOD=/
module_3D_dir=//../
FC Version 018
VBO status False
FootPrint Loader D:/Program Files/KiCad_v5_1_4/share/kicad/modules/Inductor_SMD.pretty/L_Taiyo-Yuden_NR-50xx.kicad_mod
L_Taiyo_Yuden_NR_50xx_fp 

Version after update (in another computer, before the update it was working correctly):

PoM not present
using 'Part' container
FC Version 018-4
kicad StepUp version 9.1.0.7
tolerance on vertex applied
applying Materials to Shapes
your home path is 
export to STEP False
Tabified done !
done!
KISYS3DMOD=/
module_3D_dir=//../
FC Version 018
VBO status False
FootPrint Loader C:/Program Files/KiCad_5_1_4/share/kicad/modules/Inductor_SMD.pretty/L_6.3x6.3_H3.kicad_mod
L_6_3x6_3_H3_fp
Unhandled Base::Exception caught in GUIApplication::notify.
The error message is: Access violation
Unhandled Base::Exception caught in GUIApplication::notify.

I hope this help, i was in the process of registering in GitHub to report this.

1 Like

This should be reported to FC forum, related to Qt5 & driver issues… it is not related to KSU code, but to pc drivers & Qt5 compatibilities.
I don’t know what has changed between FC 0.18.3 and 0.18.4, but on my PCs StepUp does work correctly with both releases.
Even FC0.19 is fine too.

duckduckgo search for ‘Unhandled Base::Exception caught in GUIApplication::notify.’

Both installations were working correctly with the previous StepUp version, only when I updated (today) to the latest version of StepUp in this computer, i started getting this error, I haven’t updated FreeCAD in the last weeks.

I’m copying StepUp from the MOD directory of FreeCAD of my other PC (v9.0.2.5) to downgrade in my current PC (v9.1.0.7 -> v9.0.2.5).

I will keep you post it.

Let me know if I can somehow help.