Step file export doesn't match 3D viewer and footprint properties dialog box

Hi folks,

We’re working on a PCB for a very small enclosure. I’m generating rough component placement options and exporting step files of them to our mechanical engineer, who then imports them into Solidworks & checks clearances to the enclosure.

During this process, we noticed a discrepancy regarding the location of a 3D model relative to the surface of the PCB. Kicad’s footprint properties box & 3D viewer seemed to agree, but when we exported a step file, we don’t get the same result. Below are screen captures that show the problem.

Any ideas what it could be? Is this a Kicad bug? An issue with the model itself?

BTW, we discovered this because I formerly had the Kicad model sitting flush with the PCB, and when we’d view the step file in Solidworks, we’d see a gap.

Thanks!

Steve

I guess there is a height for the solderstop layer in the KiCad viewer but not the exported PCB.

Be aware that this are differences that you can not see in the real world since there are other tolerances that are way higher. We talk about 30-50µm or so. The copper is 35µm thick per default and the solder stop and silkscreen also has a non-0 thickness. Depending on where you have copper, solder stop and silkscreen, the thickness of the PCB will vary, and this are information that are not exported to the STEP model. And then there is a tolerance in the thickness of the FR4 part of the PCB.

If you really care about this high differences, you probably should try to remove copper, solderstop and silkscreen under some components so they can be placed a few micrometre lower.

If you want to hide this layers in KiCad, as they are in the STEP-Model, you can do so in preferences → settings… → 3D viewer → generally → Board Layers → Layers with Solderstopmask (Not sure if the terms are translated correctly to English).
You can change the height of this layers in the 3D view in the Stackup settings of the board.

KiCad uses the thickness for copper specified in PCB Editor / File / Board Setup / Board Stackup / Physical Stackup to offset the footprints above the PCB. And this makes sense because the copper is usually in between the PCB and the footprints.

To verify this, you can just set the copper thickness to some redicilous value such as 2mm and observe the results in the 3D viewer. I also set the solder mask thickness to 5 mm, but that does apparently not matter for the height of the footprints.

Apart from that, all footprints of the PCB I am looking at now, also have all footprints, together with the solder paste layer floating slightly above the copper.

Hi folks,

Per paulvdh’s suggestion, I tried ridiculous values just to see what happens. I used 21 mils for outer layer copper & 100 mils for soldermask.

As before, in Kicad the connector still sits slightly below the surface of the soldermask, and in Freecad it’s flush. See screenshots.

This confirms what paulvdh said: when placing the 3D model on the board, Kicad adjusts for the thickness of the outer layer of copper, but ignores the soldermask thickness.

I’m not sure exactly what the reference point is, but the component’s height relative to it must be controlled completely by the height setting in the footprint properties dialog (Z axis in my case). In other words, regardless of copper & soldermask thicknesses in the board setup menu, if your Z-axis setting happens to put the component, say, 1 mil below the soldermask, that’s where it will stay. Even if you change the copper or soldermask thicknesses, the 3D viewer will still show that you’re 1 mil below the soldermask.

Take-away #1: Kicad makes it difficult to precisely position a component vertically relative to the top of the board. You can play with the numbers in the footprint properties dialog box until it looks flush to the eye, but there isn’t, for example, a “height above soldermask” field that you can numerically set to zero.

Thankfully, this usually isn’t a big deal, and if it is, a host of other tolerances & thicknesses become important, as johannespfister noted. So this isn’t a complaint, it’s just noting Kicad’s behavior.

Take-away #2: soldermask thickness is ignored when exporting a step file. In my example using extreme dimensions, the overall board thickness that showed up in Freecad (from Kicad’s step file export) matches the stackup thickness without soldermask. For me that was 90.6 mils. So if you’re exporting a step file, just know that the soldermask thicknesses aren’t included. This is probably a don’t-care 99% of the time, too.

Lastly, it’s worth mentioning that in the 3D Viewer, Kicad didn’t plot the full (ridiculous!) thickness of the soldermask, which was 100 mils. It did display the soldermask, it just didn’t display it as being crazy thick. Perhaps Kicad applies a sanity check of some sort.

Thanks!

Steve

That can not work. KiCad only cares about the position of the origin of the 3D model and its orientation. KiCad can not know where the part is supposed to touch the surface of the PCB.

Can you do a favour and use metric units? Non-metric shouldn’t be used, especially not in anything professional. Note that the differences of the different units that are all called inch is way bigger than the few micrometre offset you see here for the solderstop.

Eh, you are just seeing the fact the export STEP file lacks the soldermask layer in the export. If that layer were exported, it would clip the connector leg the same way that the 3d viewer shows. You should even able to measure the thickness of the board in mcad and see it’s the exact height of the configured layers minus the soldermask.

The height/placement of the component relative to the board remains the same, there’s just a “visual gap” introduced by the lack of soldermask layer.

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