Hi everybody, new at the forum and to KiCAD. I had been watching/reading some tutorials and decided to go for a simple Witty Cloud board mimic; almost everything was there except for a Right Angle Tactile Switch. Instead of substituting it by a different horizontal model I decided it was a good opportunity to create my first component. Not willing to spend too much time on it either I looked for an ‘already made’ step file for such a component, which I found on grabcad:
https://grabcad.com/library/it-1188e-kls7-ts3606-smt-right-angle-tactile-switch-1
alas, also with datasheets and dimensional drawings. This looked promising. Unfortunately, as cflin comments, no footprints were included in the step. No problem, I have dimensions, so ahead with creating it.
I opened the step file with FC (version info below):
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16117 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: dbb4cc6415bac848a294f03b80f65e888d531742
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Spanish/Spain (es_ES)
It opened nicely. Good. Now to KiCAD (info below):
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
and opened the Footprint editor, created a new project library and edited it by hand. Saved it as a kicad_mod file and tried to import it with the latest build of Stepup WB (keeping it updated to date) on FC. Loaded the step file (OK), imported the footprint … nothing’s showing up.
Error report:
KISYS3DMOD=/
module_3D_dir=//…/
FC Version 018
VBO status False
FootPrint Loader C:/Users/juanm/Documents/Arduino/leds/shoeled_pcb/shoeled.pretty/Right Angle Tactile Switch.kicad_mod
Running the Python command ‘ksuToolsLoadFootprint’ failed:
Traceback (most recent call last):
File "C:\Users\juanm\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUpCMD.py", line 543, in Activated
kicadStepUptools.onLoadFootprint()
File "C:\Users\juanm\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUptools.py", line 7345, in onLoadFootprint
routineDrawFootPrint(content,name)
File "C:\Users\juanm\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUptools.py", line 11285, in routineDrawFootPrint
for pad in getPadsList(content):
File "C:\Users\juanm\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUptools.py", line 9764, in getPadsList
drill_x = float(data[1]) #/ 2.0
could not convert string to float: ‘(offset 0.45’
Though it says KISYS3DMOD=/, the KISYS3DMOD path is setup as D:/KiCAD/share/kicad/modules/packages3d/ in the KiCAD Stepup GUI General Preferencies at the Stepup WB in FC.
I don’t know which string is trying to convert (I suppose it is expecting to find a floating point number and finding text or an integer… and crashes)…
Tried to look for similar errors but found none… dead end…
So, I changed to following maui’s steps for converting the datasheet drawing into a footprint together with the 3D to generate the footprint from FC using Stepup:
- Part DN Copy (flattened model)
- Hide Original elements
- Hide all parts of the copy except the pads (that’s elements 001 and 002 plus fillets at the bottom)
- Select pads (first element (no numbering) plus 003 and 004)
- 3D object to 2D projection (Shape2DView, Shape2DView001 and Shape2DView002 created)
- Hide 3D pads (first element (no numbering) plus 003 and 004)
- Select Shape2DViews (the three of them) and use 2DObject (or DXF) to sketch (sketch_converted created)
- Select sketch_converted and use Discretize a shape/outline to a sketch (sketch001 created)
NB: this step I have added it in the last tries as previously I was following a different maui tutorial which did not use it - in either of the two - using it or not - I get errors afterwards). I have also realized that maui says in one of his comments: “I have PMed the file with my 3D model projected and converted to sketch. It seems your 3D model has some geometry issue that will make the discretization fail… I repaired mine with some tricks before projecting it…” but he doesn’t explain either what was wrong nor what he did to repair the 3D file. - Hide sketch_converted
- Rename sketch001 to Pads_TH_SMD
- Repeat steps 3-10 with the fillets (rest of 3d shapes hidden) - get Shape2DView003 and Shape2DView004, Sketch_converted001, sketch003, rename to Pads_NPTH
- Repeat steps 3-10 with switch body (elements 001 and 002, rest of 3d shapes hidden) - get Shape2DView005 and Shape2DView006, Sketch_converted002, sketch005, rename to F_Silks_0.16
- Create group, rename to RATSW (Right Angle Tactile SW) and move the three pads to the group folder
- Open ksu tools->demo->footprint_template.FCStd and copy the Ref#_1.0mm and Value#_0.8mm labels to the RATSW folder in my project. Close footprint_template.
NB: I don’t like copying this (well, what I really don’t like is not knowing where these come from), how can I create the labels myself? Shortcuts are good for productivity but not good for learning… - Modify font size on both labels to 1,00, change [REF**] to [SW**] and reposition close to the sketch [0,00 1,25 0,00], reposition Value also close to the sketch (no text change here) [0,00 0,25 0,00]
- No everything looks ready to export… select the RATSW group folder and click on Footprint editor and exporter. It asks for a path and name to save the file (RATSW.kicad_mod). This is the report:
[‘SW**’]
['Value ']
exporting new footprint
saving to C:/Users/juanm/Documents/Arduino/leds/shoeled_pcb/shoeled.pretty/RATSW.kicad_mod
Group
Sketch001
Sketch003
Sketch005
Text
Text001
2d closed path
2d closed path
Running the Python command ‘ksuToolsFootprintGen’ failed:
Traceback (most recent call last):
File “C:\Users\juanm\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUpCMD.py”, line 1623, in Activated
kicadStepUptools.PushFootprint()
File “C:\Users\juanm\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUptools.py”, line 16182, in PushFootprint
export_footprint(name)
File “C:\Users\juanm\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUptools.py”, line 16805, in export_footprint
drl_found=collect_drl(pth_ordered)
File “C:\Users\juanm\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUptools.py”, line 17420, in collect_drl
r2=p[2][1]; cx2=p[2][2]; cy2=p[2][3]
list index out of range
I also tried the tool to fix and autoconstrain the sketches without luck…
Reading on, I got to the footprint from dxf/image/pdf part… if I open the Image addon and use create a flat image on the 3d space (use it-1188e-large.jpg for example or do a pdf cutout of the footprint image and save it as png with windows paint), select XY plane, click OK, reports:
Unhandled Base::Exception caught in GUIApplication::notify.
The error message is: Access violation
FC enters in a loop and keeps sputting these two lines on the report window every now and then and the 3D view becomes unresponsive.
So I can’t follow maui steps about using images as footprint templates either.
Any hints on why all these errors are coming up? Thank you.