Skip to content

Choosing An Export

github-actions[bot] edited this page Nov 19, 2026 · 12 revisions

10. Choosing An Export

The choices to make before a run are the mode, the file formats, the units, the origin and how copper and dielectrics are grouped. The parameter files' own values are the ones for an EM simulation (10.5), the presets bundle the right combination for each other tool, and --set or the files in parameters/ change any single value.

10.1 Decision Table

Need Choice Reason
FreeCAD, and Elmer or CalculiX through its FEM workbench --for freecad: simulation, STEP, mm, KiCad origin, copper per net, dielectrics per layer FreeCAD imports STEP with every part under its own name, and its FEM workbench meshes the solids and runs Elmer or CalculiX; with mm and KiCad's origin a position read off the layout is the same x and the negated y in the model (KiCad's Y points down, KESE's up)
Elmer (ElmerFEM) --for elmer: simulation, STEP, mm, KiCad origin, copper per net, dielectrics per layer, no finish Elmer reads neither STEP nor STL: gmsh meshes the STEP file and ElmerGrid 14 2 board.msh turns the mesh into Elmer's; set Coordinate Scaling = 0.001, the mesh being in mm. See 10.2
CalculiX (heat and stress) --for calculix: as elmer, copper per layer CalculiX has no electromagnetics; gmsh meshes the STEP file into an Abaqus .inp, or CalculiX's own cgx reads the STEP file
openEMS / CSXCAD --for openems: simulation, STL, mm, KiCad origin, per net, per layer openEMS has no STEP reader; it imports STL files, each into one material, and materials.json carries the properties. See openEMS Workflow
gmsh, other CAD, an EM solver that reads STEP no option: the default STEP in mm with KiCad's origin, every part as closed solids, holes and round edges as true circles and cylinders (Step.STEP_EXACT_ARCS)
Web viewer, three.js, <model-viewer> --for viewer: visual, GLB, metres, centred glTF viewers expect metres and a model around the origin; the skin does not z-fight
Blender, renders --for blender_glb or --for blender_obj: visual, metres, centred, flat, with the solder mask and silkscreen GLB carries PBR materials; OBJ carries an .mtl with the colours and transparency, which Blender reads. Blender's importers turn Y-up into Z-up, so flat lands with F.Cu up
Thermal or FEA tool that reads STL --format stl one closed STL per part, in mm
DC-IR / PDN with one solid per copper layer --set Copper.COPPER_GROUPING=layer copper per layer, plating as its own Plating part
A single body for the whole laminate --set Board.DIELECTRIC_GROUPING=merged one Board solid instead of one per dielectric

Note

Every format and both modes hold the same parts: the lines of the stack-up in parameters/PCB_elements/Stackup.py that are True (Stack-Up Model). The laminate, the copper, the plated holes and the finish are on by default (the finish is the one the board file names, Finish), the solder mask and the silkscreen off. Switch the mask and silkscreen on when the solver or the render must see them: --set Stackup.solder_mask=True --set Stackup.silkscreen=True. A STEP file with them is 1.4 to 1.9 times as big (the PCIe card in Input/, in mm: 151 MB and 1,024 solids against 81 MB and 788 solids, measured with Geometry.CIRCLE_CHORD_TOLERANCE_MM = 0.002).

10.2 The Presets

Presets.PRESETS (in parameters/Run_KESE/Presets.py); --for <name> applies these overrides before any --set, and parameters.txt records the preset and every value it changed. Each name in a preset is checked as a --set is, and a new entry in the file is a new preset. A preset leaves Stackup.FUSION_BUILD as Stackup.py has it, so each of them works with the plies separate and with the plies fused (--for freecad --set Stackup.FUSION_BUILD=PLIES_FUSED). None of these routes has been tried with KESE output yet: they follow each tool's documented import formats.

Preset MODE FILE_FORMAT UNITS ORIGIN COPPER_GROUPING DIELECTRIC_GROUPING WRITE_MATERIALS_JSON Also
freecad simulation step mm kicad net layer True
elmer simulation step mm kicad net layer True no finish
calculix simulation step mm kicad layer layer True no finish
openems simulation stl mm kicad net layer True no finish
viewer visual glb m center (unchanged) (unchanged) (unchanged)
blender_glb visual glb m center (unchanged) (unchanged) (unchanged) ORIENTATION flat, Stackup.solder_mask and Stackup.silkscreen True
blender_obj visual obj m center (unchanged) (unchanged) (unchanged) ORIENTATION flat, Stackup.solder_mask and Stackup.silkscreen True

"No finish" is Stackup.finish = False, the three finish lines of the stack-up: 80 nm of gold (ENIG's) is far below any FDTD cell of openEMS, and would force the volume mesh of Elmer or CalculiX down to cells of that size.

  • Elmer: neither ElmerGrid nor ElmerSolver reads STEP or STL. Mesh the STEP file with gmsh, whose BooleanFragments make the touching solids share their faces, export the mesh in gmsh's format, and convert it with ElmerGrid 14 2 board.msh -autoclean. Elmer takes coordinates as they come, so with a mesh in mm set Coordinate Scaling = 0.001 (Model > Setup in ElmerGUI) for SI units. gmsh reads STEP in mm unless Geometry.OCCTargetUnit says otherwise. The Elmer bridge on the Elmer_Integration branch takes another way: it asks the elmer preset for STL files as well and builds a 2.5D mesh of its own from them (Elmer FEM Walkthrough).
  • CalculiX: gmsh meshes the STEP file and saves an Abaqus .inp (Mesh.Format = 39), which ccx runs; or CalculiX's own pre-processor cgx imports the STEP file. CalculiX does heat and stress, not electromagnetics; its units are the ones you keep consistent (the mesh is in mm).
  • Blender: File > Import > glTF 2.0 for blender_glb, File > Import > Wavefront (.obj) for blender_obj. Both importers turn the files' Y-up into Blender's Z-up (glTF always; OBJ with its default axes, forward −Z and up Y), so the flat board lies with F.Cu up and KiCad's top view in Blender's top view. glTF is in metres, which Blender takes as its unit; the OBJ importer's scale is 1, so the OBJ is written in metres too.

A preset is only a set of overrides: --for freecad --format step glb writes both.

10.3 Units And Origin

mm m
Run.UNITS EM solvers and CAD. Dimensions in the file equal the layout's. Use it for STEP: the file declares the units it is written in, but CAD tools and solvers are set up in millimetres. The default. glTF viewers (the glTF specification is in metres): the viewer and Blender presets set it.
center kicad
Run.ORIGIN The outline's bounding-box centre is at (0, 0). Good for viewers: the viewer and Blender presets set it. KiCad's page origin is kept: x equals the layout's x and y is the layout's y negated, since KESE's Y points up. Good for placing ports. The default.

Run.ORIENTATION: upright (board in XY, F.Cu toward +Z, Y up, KiCad's top view not mirrored) or flat (board in XZ, F.Cu toward +Y, the convention of some viewers, and what Blender's importers turn into F.Cu up). The Verifier's checks work in either.

10.4 Grouping

Copper.COPPER_GROUPING Parts Use
net Copper_<net>: all layers and vias of a net in one solid EM ports, parasitic extraction, per-net anything
layer Copper_F.Cu, Copper_In1.Cu, ... plus Plating layer-by-layer DC or thermal studies
merged one Copper a single conductor body
Board.DIELECTRIC_GROUPING Parts
layer Board_dielectric 1, Board_dielectric 2, ... each with its own εr and tanδ
merged one Board (the first dielectric's material)

10.5 The Default Combination

The parameter files are set for an EM simulation of a board in the solver's own units, so a run with no option (python run_KESE.py board.kicad_pcb) gives it:

Setting Value
Run.MODE simulation
Run.FILE_FORMAT ["step"] (or ["stl"] for openEMS)
Run.UNITS mm
Run.ORIGIN kicad
Copper.COPPER_GROUPING net
Board.DIELECTRIC_GROUPING layer
Run.WRITE_MATERIALS_JSON True
Stackup.FUSION_BUILD PLIES_SEPARATE: every ply, every core and the resin between the traces a solid of its own
The solder mask and the silkscreen left out (Stackup.solder_mask, Stackup.silkscreen)
Finish.FINISH_TYPE file: the finish the board file names; a board that names none stops the run until a finish is named or the finish is left out (Finish)
Board.DIELECTRIC_MODEL djordjevic_sarkar: the wideband model's parameters beside each εr and tan δ (Material Properties)
Copper.COPPER_ROUGHNESS_MODEL huray, with the values Ansys's tools start with (Material Properties)
Verifier.VERIFY True: every model is checked before it goes to a solver (--no-verify leaves the checks out)

The material values are generic ones. Set the fabricator's values in parameters/PCB_elements/Copper.py, SolderMask.py and Board.py before trusting the results; see Parameter Reference.

Previous Next
Output Modes Project Output Organization

Clone this wiki locally