KiCadStepUp workbench says a model is wrong

I hope this is the right category.
For the first time I’m trying the FreeCAD KiCadStepUp workbench, and I loaded this PCB:

but the loading fails with the following errors:

18:07:10 3D STEP model usb_micro_4p is WRONG
18:07:22 Running the Python command ‘ksuToolsOpenBoard’ failed:
Traceback (most recent call last):
File “/home/as/.FreeCAD/Mod/kicadStepUpMod/kicadStepUpCMD.py”, line 656, in Activated
kicadStepUptools.onLoadBoard()
File “/home/as/.FreeCAD/Mod/kicadStepUpMod/kicadStepUptools.py”, line 8067, in onLoadBoard
Load_models(pcbThickness,modules)
File “/home/as/.FreeCAD/Mod/kicadStepUpMod/kicadStepUptools.py”, line 5646, in Load_models
stop

name ‘stop’ is not defined

It says: “3D STEP model usb_micro_4p is WRONG”, but if I import the model into FreeCAD is loaded without any problem.

How to understand why it says the STEP model is wrong?

There is an XKCD for that:

I’m very sorry but I don’t understand what you’re trying to say.
Is my question stupid? is there already an answer in other threads?

I did a search without finding anything relevant, but perhaps I used the wrong keywords.
I mean, the 3D model is imported correctly into FreeCAD (so I assume it is NOT wrong) but the kicad plugin says it is wrong…

Please, be patient but it’s not clear to me what I have to do to fix the “error”.
Thanks,

I’m sorry for confusing you.
It has not much to do with your post, it’s a result of the weird ways my brain sometimes works. XKCD is supposed to be funny.

There are many complications which make this question difficult to answer. One of them is that the KiCadStepUp workbench is a part of FreeCAD, and not of KiCad. Those are separate projects.

One of the first steps in narrowing it down could be to isolate the offending 3D model and use some program to validate if the file is correct.
You could also start reading the kicadStepUptools.py file, or follow it’s execution path through those lines mentioned. With Python, the most important line of an error message is ofthen the last. So in this case: “name ‘stop’ is not defined”. But it would be quite involved to dive this deep into it, and when you’ve found the problem, what then?

Does the error go away if you replace the “offending step model” with for example a simple resistor? (This can confirm or exclude if the problem is with the file, or with the stuff surrounding it).

If you export the model to STEP from FreeCAD, and then read the PCB with the freshly exported model, what happens then?

How important is this? How much time do you want to spend on it?

This may help…

You May Already Know:
In a general sense, the only important aspects are:
• Overall Size and Shape (can be actual or approximate)
• Connection Pads - layout (Pitch and Row Spacing)
• Mounting features (if relevant)
(the rest is just Graphics (Silk, Courtyard…etc) per your preference and are optional)

Some Quick-Simple steps to build the Model for Footprint (without using FreeCad or StepUp). Four Steps… Of course, there are other approaches, including FreeCad/StepUp… But, a foundational basis won’t hurt. Thus:

In PCBnew:
TIP [Optional] - For an ‘Aid’ for Ease of laying it out, place your Cursor at a sensible reference point, such as the Middle of the PCB window, Press Spacebar. That will set the dx/dy Ref for the info presented at window’s bottom.

  1. [optional] At the new ref (0,0) Click the Auxiliary and Grid Icons

  2. Click the Edge-Cuts in Layer Tree

  3. Draw the Shape, add any holes/etc

  4. Place some parts on it (suggest only two or three parts and No traces until you get you Sea-Legs, so-to-speak).
    Note: Example below with two PinHeaders and a SMD chip.

Use the 3D Viewer as a viewing aid

When satisfied, File>Export>Step

You now have a Model to use in Building a Footprint.
Refer to documentation/tutorials on completing the footprint.

Generally: In the Footprint Editor, place Pads (for the Pins to go through on the PCB). Use S-DIP and setup your Two Rows.
Edit>Footprint Properties> In the 3D panel, add your newly created Step and set the position/alignment/orientation as needed

1 Like

Got it, thanks!
Well, the main reason of my question is to understand how difficult is to create a footprint from an existing 3D board… and because I got an error even before loading the PCB into FreeCAD I was a bit puzzled :wink:

Anyway, your suggestion to import and export the very same model from FreeCAD fixed the error in KiCadStepUp plugin, great!
Now there are another dozen errors/warnings, but not so critical. I can follow the instructions in the other thread about importing this 3D model in my new footprint.

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