What is the difference between step and wrl 3d models?


The two formats are fundamentally different. The wrl format is a tessellated surface mesh meant for making nice renderings (originally conceived for virtual reality) while step is meant to communicate parametric information between cad tools.

TlDr: use wrl to make pictures for your marketing guy, use step to exchange information with your fellow mechanical engineers.

In KiCad

The internal 3d viewer of KiCad can work with both (since version 5) and they both have their distinct purpose. Using wrl generally yields nicer looking pictures (assuming you selected the wrl (shader) material properties well)

Exporting to step either via the internal step exporter or via the freecad extension stepup will automatically replace the wrl file endings of the 3d path with step file endings.
Meaning you can add wrl models for the internal viewer and still be able to export step as long as you have both files stored under the same name and scaled correctly. (KiCad reads 1 wrl unit as 1 inch. Step stores its base uint explicitly. Stepup already exports correctly scaled wrl and step model pairs)

More details about 3d model assignment Tutorial: How to make a footprint in KiCad 5.1.x? (Section 3d model assignment)

Detailed differences between step and wrl

As an example take a drill hole defined in step. It might be defined as a direction vector, radius and depth of the hole. This means one can extract the true hole center, dimension, direction for use as the source for constrains and also to get manufacturing drawings made from it (one can tell that it has exactly that diameter with this depth)

Contrast this to wrl. here the hole does not really exist. The aproximated cylinder that was used to create it is not part of the file format. (that information is lost forever) All you have is a strange mesh that looks to the human eye as if there was a nicely drilled hole there. The file format does not contain information about its center, direction or radius. It only has a number of triangles that form that hole.

You can try and reconstruct the hole dimensions but what should its radius be. There is no rule in place how the original thing approximated the circular base. So the true circle could be anywhere between the two possible extremes (maximum inside circle to minimum outside circle)

The end result is that one can easily translate a step model into a wrl model but the other way round is not easily possible. (It can be done but you will not get back the information missing. Curves will stay approximations after conversion.)

KiCad Speciality: WRL is Assumed to be Imperial

WRL does not specify what its unit means. KiCad reads it as one wrl unit is equal to one inch for legacy reasons. So if you design a 3d model in for example FreeCAD then you will need to scale the wrl model before exporting as FreeCAD normally exports with one wrl unit equal one mm. If you use the FreeCAD extension “kicad-stepup” for exporting then this scaling of the wrl model is already done for you.