Export copper as flat .stl (2D) - Unexpected KiCad 8.99 .step export behavior

Hello fellow KiCad users,

I’m in need of doing an EM simulation with openEMS. For now I was able to use KiCad Nightly version 9 to export a .step with all the geometry. Then, I loaded it into FreeCAD and exported each copper node and PCB material to ASCII .stl to be loaded in to openEMS.

Since I want to simplify the simulation, I would like to have 2D copper features. I tried to achieve this by changing in the layer stackup the copper thickness to zero before using KiCad 9 new .step export.

Unfortunately, it seems that the .step exporter will not correctly merge and simplify copper features when the thickness is zero. That feature is really nice!

Does someone have a workaround or any ideas about how do export the simplified copper in 2D? I think that if I use kicadStepUp, I will have to do extra work to flatten the copper (I’m not very experience with that FreeCAD pluging)

Another thing I observer is that it seems pads and tracks have different thicknesses, so even when fusing copper together, there is a step in height when the copper comes out of a pad. I would expect all copper (pads & tracks) to have the same height within the same layer:

Should I open an issue about the behavior of the exporter?

Best regards,
2nOrderEDO

if you want it in 2D, couldn’t you just use the normal 2D export pipeline? gerber, pdf, dxf etc

if i remember correctly, KiCadStackUp KiCadStepUp exports copper as a 2D object…

You probably mean KiCADStepUp (addon to FreeCAD).

1 Like

Please report this on GitLab with an example project.

This is done to have distinct pad faces for naming in XAO format.

On a sidenote:
Please use the correct version number. KiCad V9 does not exist yet, and using that version number will cause confusion with other readers of this forum after KiCad V9 is released.

3 Likes

Yeah ! my heart skipped a beat " is it here already ?? V9 ?? but Santa hasn’t been yet ? "
:mouse:

The topic is that I need .stl files. I was trying to prevent the extra steps from exporting a .dxf to FreeCad to then convert them to meshes.

I will try to give it another try this evening. Last time I did not find a way to export 2D copper in .stl from there.

Will do this evening and report back here. I would also suggest to have an option to enable flat copper. There is also a proposal for filled vias that I already saw in Gitlab.

Thanks to everyone for the comments. I will report back in the following days about what was the best workflow I could find.

Regards,
2nOrderEDO

I’ve added STL/PLY export yesterday (Post-V8 New Features and Development News - #63 by dsa-t)

PLY export currently marks each face as its own element (you can see it in CAD Assistant, for example).

It could be changed to mark each part as it’s own element, but looking at OpenEMS import functions it doesn’t seem like the element ids are imported.

STL doesn’t support any element ids.

You should be able to invoke kicad-cli multiple times to get the parts you need in separate files (board body, copper, etc)

2 Likes

How do you want vias to appear? Because OCCT only allows fusing parts with the same dimension, it’s not possible to fuse a flat face with a cylinder, for example
(See in Open CASCADE Technology: Boolean Operations: For Boolean operation Fuse all arguments should have equal dimensions.).

If should be able to fuse FACE with a SHELL, but how useful is it? (SOLID usually is made out of a SHELL)

1 Like