STEP export peculiarities in KiCad 5

It is not only the .wrl that doesn’t get exported, apparently an .STEP model either.

And some other model either, I use mostly StepUp as such I have not much experience with the native exporter.

What’s the log output from step export? If you have a bad model or problems with you board outline it may fail.

@eelik, thanks for pointing out the FAQ. It does explain why .wrl models are not exported. It doesn’t address my other two issues, though.

@halachal, the log for the current board I’m working on contains two errors about missing models. The models are there, footprint editor and 3d viewer show them correctly. I tried importing the STEP models into Fusion and re-exporting them again, which did not change anything. The log says:

    Warning: 09:17:34: /vagrant/build/kicad/src/kicad/utils/kicad2step/pcb/oce_utils.cpp: AddComponent: 588
    Warning: * no model defined for component 'JB2'
    Warning: 09:17:34: /vagrant/build/kicad/src/kicad/utils/kicad2step/pcb/oce_utils.cpp: AddComponent: 588
    Warning: * no model defined for component 'JB1'
    Info: STEP file has been created successfully.

Please take a look at how the board looks in KiCad and in the eMachineShop STEP viewer. The two battery tabs are missing, and the black 1box.step model in the upper right is present, but is not scaled in the STEP output.


I believe the box not being scaled up is intentional.
In an MCAD context, scaling models rarely makes sense (a full-size car is not a scaled compact, for example.)
This also generally holds true WRT electronics. What package is there in the wild that’s nothing more than a blown-up variant of another?

Could you link to the missing models?

1 Like

That’s right, the scaling “issue” has also been discussed back and forth, but the fact is that mechanical engineering models, i.e. STEP models, should always be 1:1 to start with.

I’m not sure if it was made clear enough, but we usually recommend using FreeCAD and StepUp workbench. You can import a STEP model there, import the KiCad footprint file, then move and rotate the model correctly and finally export it as a new STEP file + WRL file combination which is usually compatible with KiCad even if the original STEP model had problems. This way you can be sure that the models are correct, and there’s no need to scale, move or rotate anything in KiCad.

You can also import the KiCad board file there directly which sometimes works better than exporting from KiCad. You can then export it as STEP from FreeCAD if you want to use some other 3D application.


As for the missing models, show at least a screenshot of the 3D Settings tab of the footprint, and the Configure Paths window where the variables used in the 3D paths are visible.

1 Like

I remember that a user asked for a similar feature in StepUp…

Using KiCad 5.1.6

I was curious to see if I could replicate the problem with models I made in FreeCad…
None of this is a problem for me so, not looking for solutions. Just posting observations…

Models:
• My older STEP models were done WithOut exporting from StepUp. I simply exported STEP’s from FreeCad and did Not export WRL’s.

• My newer models (seven of them) were exported using StepUp, thus, having both STEP and WRL.

Using them in KiCad:
• All the STEP’s exported directly from FreeCad (not using StepUp) were recognized, used by Kicad and Exported GOOD STEP’s. All opened in FreeCad.

• All the WRL’s exported using StepUp were recognized, used by Kicad and ALL Exported BAD STEP’s (encircled in Orange).

I admit that in some cases, I made the models differently (Bodies, Parts, Boolean Union, Fuse, Compound… etc. However, in all cases, my STEP models were useable and subsequently exported Good STEP files from Kicad.
The only exception is One not baring the Colors used in design (the Toggle Switch shows Colors Correctly in 3D viewer but Not Correctly as exported STEP from Kicad. Loaded into FreeCad, Encircled with Yellow).

Additional:
The Two WRL Jumper Wires, encircled in Orange Exported STEP with the Full Wire Length. Why? Well, I scaled the WRL’s in Kicad intentionally so, was surprised the STEP’s didn’t export at the scaled value.

if you mean your ‘bad’ models will not be loaded using StepUp, probably it s just because you placed them in a different path and you confgured that path only in KiCad and NOT in FreeCad StepUp.
Please have a better insight of StepUp cheatsheet manual.

Again STEP exporters don’t scale any model because of design decision, they just replace the ‘.wrl’ extension to ‘.step’ and try to load the corresponding model (if it exists in the same path).

About the scaling…
In KiCad V3 or V4 a lot of the default models had weird scaling factors which was quite horrible and these seem to have thankfully all dissapeared, probably due to good library management and a strict 1:1 scaling rule, and I agree. All library models should be 1:1.

But not applying scaling factors on STEP export is a bug in my book.
There are good reason for a user to want to apply a scaling factor for some footprints. The wires shown above are a good example. I myself had a footprint of an Inductor with no 3D model, so I re-used an existing 3D model of a similar inductor and scaled it, which is a valid workaround for quick solutions.

The exported PCB should look the same in a CAD program as it does in the 3D viewer in KiCad itself.

No scaling was applied to Step models.
Scaling used for only WRL.
All models are in same Folder Path and correctly defined and have No problems with loading any footprints or symbols either into Kicad or StepUp.

My comment, “Exported BAD STEPs” refers to only Kicad’s exporting of Steps, not StepUp’s exporting of Steps. StepUp was Not used in the process above process, other than using it for exporting and there were no problems with that (files created and exported 6 months ago).

Please have better insight to what’s ‘posted’ under the Bold Text heading of “Using them in Kicad”, and be not so quick to defend your plugin when nothing was said or implied about StepUp.

ahahah sorry for misunderstanding your post, I’m not native English speaker :smiley:

The step exporter doesn’t build a new model, but simply assembly the board adding the 3D step models at the right position.
STEP format doesn’t support any scaling factor inside, opposite to the WRL format.
Applying a scale could be a risky path when working with mechanical integration … an alternative is to modify the model in the mechanical sw and save it with a different file name. In this way you will have a correct matching between the file name and the real mechanical dimensions, with a little cost in your designing time.

3 Likes

I created a simple Model in FreeCad (FC).

Using Gmesh App to view files:

#1 Exported it from FC as WRL
#2 Exported it from FC as STEP
Results: Both files are Good

#3 Exported it from StepUp
#4 Exported it from StepUp
Results: Step file is Good. WRL file is BAD.

If only changing the extension (as you said) then, I would expect the WRL to also exhibit the Good ability of results as did the Step.

I don’t know it … I use view3dscene as a viewer

that is strange … I mean most (all) the KiCAD 3d libraries are generated using StepUp internal export engine and I had no BAD feedback in 5 years…

This time you misunderstood me…
I said:

they just replace the ‘.wrl’ extension to ‘.step’ and try to load the corresponding model (if it exists in the same path)

then you must have a 3D step model with the same filename of the wrl model, it is not simply changing the extension but loading the file with the same name but ‘.step’ extension.

Okay, my turn for apology :wink:

If interested: Create a FreeCad model and repeat what I did. See if your viewer shows errors…

The FreeCad file (if interested):
junk.FCStd (21.7 KB)

[EDIT - FOLLOWup]
I loaded the WRL into ParaView, it looks good. Thus, Gmesh is headed for the Trash bin…

1 Like

Ok, I’m not sure I follow the discussion anymore.

To answer some of the points raised:

I believe the box not being scaled up is intentional.
In an MCAD context, scaling models rarely makes sense (a full-size car is not a scaled compact, for example.)

I very much disagree. The scaling feature was a fantastic way to quickly get a “bounding box”-style 3D model, which works well enough for mechanical design and is actually close to 100% accurate for things like atypical QFNs/DFNs or shielded inductors. It’s a lifesaver for those of us who do many things and can’t spend too much time on any single one. Also, if scaling is “officially” deprecated, then scaling options should be removed from the dialog. As it is now, they are there, they work within KiCad, show up scaled in 3D Viewer, but are not scaled for STEP export, which is inconsistent and probably not what was intended, whatever the decision on scaling.

I am not posting other screenshots, because STEP export works for all other models I use, and their footprint setup is exactly the same. The specific parts that fail are Keystone 591 battery tabs and I can’t provide the files for them, because Keystone doesn’t make them public (sigh). You have to ask to get them. Yes, I know. But it’s not my decision.

Now, some people have been pointing me towards StepUp. This is something I can’t afford: I tried it in the past, and the amount of work required to understand it, set it up and maintain it was far above what I could dedicate. I was very happy that KiCad included STEP export in the built-in release, as this is something I can (hopefully) simply start using.

1 Like

It’s always amusing when people suggest others should program something because they can’t be bothered to learn to use the solutions that already exist.

2 Likes

I understand your amusement, but also feel sympathy for JWR.

FreeCAD is getting usable, but it still has not reached version 1, and rightly so in my opinion as there are far too many loose ends that do not work properly yet. Almost half the time spent in learning FreeCAD seems to be in learning to avoid the parts that do not work properly.

I’ve made some drawings in FreeCAD over the last few years. I think I started with FreeCAD 0.14 or so (Much improvements since then). My FreeCAD drawings mostly exist of padded sketches and I can get around with it. (My biggest drawing probably has 100+ of these). I’ve tried a few times to wrap my head around the “Draft” workbench, including a few hours yesterday and it seems almost impossible to draw something dimensionally accurate. In it’s current state I’m not even sure if the Draft Workbench is usable, or a left over stub from a different era.

So, when all that is needed is a STEP export from a KiCad PCB, and this function is available in KiCad. I can not blame JWR for expecting this function to work properly and intuitively.

Scaling differences between what KiCad shows in the 3D viewer and the STEP export should not be there.

1 Like

3D modeling is a difficult path… for sure FC doesn’t have the most intuitive user’s interface, but I would like to add this opinion made from a professional 3D designer which do SolidWorks Certification Course…
Is it Worth Learning FreeCAD? Can It Be Used Commercially? |JOKO ENGINEERING|
from ClosedCaptions:

I think freecad for what it is and that is primarily three people in their spare time developing this with some enhancements from the community have done a superbly fantastic job in making a software that runs like industry software and i think is incredibly useful

I use it all the time i use it alongside solidworks and all a bunch of other cad modelers
I esteem freecad highly for making such a wonderful complex workflow available for free to anybody
I love freecad i hope you do too in fact i think you should too


this being an open source software i’m very new to it but i cannot believe how powerful and immense and just overall impressive

that this software is being provided absolutely free it blows my mind and i i cannot thank the developers enough for making such a wonderful
useful relevant amazing software absolutely free it is a it is a treasure to use and as evidenced version 018 is even better than 017

truly incredible so again my my congratulations and admiration to those who’ve made such a great software

Joko EngineeringHelp channel: videos

There’s a discussion going on in the developers’ mailing list. It gives more opinions and technical background information: https://www.mail-archive.com/kicad-developers@lists.launchpad.net/msg38984.html

1 Like

@eelik Thanks for the pointer — that discussion is interesting, and I’m really happy about the proposed idea of implementing a simple shape generator within KiCad, which would obviate my need for scaling unit boxes.

There remains the problem of missing STEP models in export (which are visible in 3D Viewer), which I guess will remain unsolved for now. I am working around this by adding the models manually in my MCAD later on.

I also wrote a response to @halachal’s comment, but decided to remove it as I think this direction of discussion is entirely unconstructive.

1 Like