Exporting to STEP: component models only included when STEP included in footprint 3d properties

Hi guys,

I have been playing a lot with Pcbnew lately, and I noticed that STEP export works (yay!), but only if each component’s STEP file is included in its footprint (".kicad_mod" or “Footprint properties/3D settings”).

However, while STEP models are included for many components in the kicad-library Ubuntu package, the footprints files only refer to the wrl file.

For example /usr/share/kicad/modules/Resistors_SMD.pretty/R_1206_HandSoldering.kicad_mod:

(model Resistors_SMD.3dshapes/R_1206.wrl
(at (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)

I experimented with the 3D models and their relation with the 3D viewer and the VRML/STEP export functions:

  • if only WRL model is included in footprint: component will appear in 3D Viewer, but only in an exported VRML file
  • if only STEP model is included in footprint: component will appear in 3D Viewer and exported VRML and STEP files
  • if both WRL and STEP model are included in footprint: component will appear in 3D Viewer and exported VRML and STEP files

It thus looks to me like the footprints should at least include STEP models by default, no?

What am I missing?

Thanks!

If you add both the .wrl and the .step models to the part, they will both be displayed in the 3D viewer:

Here’s an example where I added both and rotated the .wrl model by 25 degrees.

But only the .step file gets exported to the step output

We are currently discussing how this should be handled, I believe the approach will be the same as Stepup.
Options you can consider if you need to export a step file:

  1. Use stepup to export the step model
    2.open your kicad_pcb file in a text editor and do a search and replace for .wrl - > .step
1 Like

please have a look at StepUp to convert a kicad pcb board and parts to STEP, when the models are just .wrl (or even .step)


StepUp will substitute .wrl to .step automatically and the result will be a fully STEP model of you kicad pcb

with the uptodate libraries you will just need to configure your KISYS3DMOD variable

PS models cannot include STEP by default because of compatibility with kicad stable release… using StepUp approach you will not need to change anything and your 3D viewer will use all the Material properties for better rendering

2 Likes

PS models cannot include STEP by default because of compatibility with kicad stable release… using StepUp approach you will not need to change anything and your 3D viewer will use all the Material properties for better rendering

I understand now! I will also have a look at StepUp, thanks.

I guess the gist of my question is: is using STEP files as 3D models better in every way, or are there downsides?

If there are no downsides, I see several ways KiCad could handle this (which you guys have probably contemplated already):

  • Checkbox in preferences to replace WRL models with their STEP equivalent on the fly, if they exist
  • Removing redundant WRL files in a post-build script of “kicad-library”, and replacing them with STEP files in the kicad_mod files automatically, where applicable

In any case, thanks for your help!

Step has down sides, WRL has material properties meaning how it shines back and what not. If you search for “kicad Raytracing” you’ll see what it can do :slight_smile: quite amazing :slight_smile: wrl and step are for different purposes but both can be really useful.

4 Likes

Step is mainly a mechanical model, wrl is instead mainly a rendering model.
As @Shack has already pointed out, with wrl you can put Materials properties to your 3D model… then your rendering will be much more realistic in kicad.
One other big value is that wrl can have transparency on Materials and models… Transparency is really useful for many purposes, particularly when you need to check enclosures and also for nice rendering result.

4 Likes