.wrl, .step import

Hi there,
I wanted to import 3D data for a footprint.

  1. Having a .step file from the manufacturer’s webpage needs to be converted to .wrl
    a) using SolidWorks, doesn’t show any 3D model in KiCad (this issue was disscussed somewhere else There seems to be two .wrl versions: VRML1.0 and VRML2.0 aka VRML97, the latter should work). The SolidWorks I had, only exported one version and obviously the wrong one. So SolidWorks seems not to work.
    b) using CATIA-V5 seems to work
    c) using FreeCAD seems to work
    However, scaling factor needs to be set to 1/2.54 = 0.3937. Why?
  2. Having a .wrl file from another manufacturer’s website
    Import to KiCad works directly, however, the correct scaling factor in this case was approx. 2.07? Why?

Is there a way to find these scaling factors without iterative trial&error?
And why is the x,y,z-shape offset in the Footprint-Editor in Inches and not in mm? Can this be changed? These conversions are pretty annoying.

to c) KiCAD interprets 1 unit of VRML as 1 inch. If your VRML was made with 1 unit = 1 mm it needs to be scaled down by a factor of 1/2.54 = 0.3937 as otherwise it would be interpreted larger.

to 2) VRML doesn’t specify a unit like mm or inch or furlongs, it’s just 1 unit. I don’t know what conversion the manufacturer did use…

If you want less trouble during scale matching, use @maui 's StepUP tool in FreeCAD. You can load the footprint into it and adjust the model before exporting it with the correct scale, orientation and position.

1 VRML unit in KiCad = 0.1 inch

1 Like

There are at least 2 solutions if you want to use the ‘stable’ release:

  1. Use Maurice’s StepUP scripts for FreeCAD
  2. compile and use the step to VRML converter here: https://github.com/cbernardo/kicad_oce_vis

You need to take care of the (0,0,0) offset and rotation (orientation) as well. Maurice’s tools allow you to do this interactively; the other STEP to VRML converter doesn’t have such provisions.

If you use the nightly builds then you can use the STEP (and IGES) models directly with no more translation to VRML. The new 3DViewer allows you to interactively set the offset and orientation in the 3D model selector dialog. In a few days the nightly builds will also have the capability to export STEP files so you can load your board + component models into SolidWorks or CATIA. The new 3D plugin system and 3D viewer will also display those SolidWorks VRML files - not that you will have any use for them.

thanks @Joan_Sparky and @cbernardo
I tried Maurice’s StepUp Tool. It looks good and it is almost doing what I would expect (see picture). Maybe I am still doing something wrong.
Left FreeCAD, right KiCad.

I still do not understand why a data format of a technical drawing (VRML) does not have dimensions in it? This would be just a line which can be ignored or read out to get the right size?!

Anyway, thanks for the hint with the nightly builds using directly the .step format. I will try it and get rid of this strange VRML format. I hope that I will be able to shift the origin of the component and adjust the axes orientations (if necessary) to fit the pad layout.

Hi @theozh
from your image it seems that probably you have a wrong z angle value on your pcb file…
sometimes the model used in the pcb file (.kicad_pcb) has different x,y,z orientation values compared to the module used for orienting the model file (.kicad_mod)
you can check it just opening your .kicad_pcb and .kicad_mod files in a text editor and search for the .wrl file name
here you can find a detailed discussion of that

VRML is a lightweight format, and it has been used as kicad approach just because it is much simpler than STEP format.
VRML has more graphical attributes that can be used to display material properties when rendering the board and models
Using kicad StepUp tools you can have both mechanical and ECAD environment aligned and at their best.
Kicad StepUp tools can be used to import STEP models and align them to kicad footprint in a mechanical environment, where you can check distance and mechanical collisions. Than you can just generate the STEP and VRML models aligned to your footprint with a simple click.
It is a bit more complicated than using directly he STEP model inside kicad (that can be done only with latest (up today) dev build and not with the actual stable version) but can offer you some advantages like full material properties in 3D kicad internal rendering and some more tricks…
Feel free to ask if you may require further assistance :smiley:
In general use mechanical or just STEP model as a base for your models, this kind of model are normally designed at 1:1 scale and from them you can easily convert the model to wrl format, adding material properties if needed.
Most manufacturers would give you a chance to download STEP model at 1:1 scale.


1 Like

VRML = Virtual Reality Markup Language, it was intended high speed rendering for use with 3d goggles, not precision modelling. STEP is the way to go for KiCad

1 Like

VRML is a visualization data specification, not a Solid Model data specification. The specification states that 1VRML unit = 1m but this was never enforced and different tools do different things. Even among MCADs some will use 1U = 1m and others 1U = 1mm and so on. STEP and IGES on the other hand are Solid Model data representations and the file specification includes an explicit specification of the design units. Since VRML is unreliable (and in fact many of the models which people have created do not even meet the mechanical specifications of the packages they are meant to represent), the KiCad STEP exporter will only accept IGES and STEP files even though the 3DViewer supports visualization of other formats. I can include IDF in the STEP exporter as well but no one has been asking for that feature so I’m not spending time on it.

1 Like

Did STEP import, from the development branch, make it into 4.0.5 Stable? If not, when is it expected? Thanks.

As usual 4.0.5 is just a bug fix release. I’m afraid you will have to be patient for 5.0

1 Like

As a follow up question:
I have been using StepUp since its first release, and my internal project library includes both the WRL and STEP for every footprint. Now that KiCad supports STEP in the latest builds, is there any advantage to still using WRL versus moving everything to STEP-only models?

The advantage of using WRL is that you can set materials … that it is important if you are concerning on getting better 3D renders.

Hi @aaron
with VRML it is possible to:

  1. improve 3D rendering/raytracing with material properties
    that could be useful for i.e. commercial rendering of products
  2. have transparency for 3D models
    transparency can be enabled or disabled just toggle-ing material properties in the latest kicad releases
    this is useful with i.e. enclosures or mechanical checking for parts and board

PS kicad StepUp now you can use STEP or IGES or VRML or mixed type of models in your board with a seamless integration