Simple GUI plugin for FreeCAD to export current model for EM simulation in OpenEMS
  • Python 99%
  • MATLAB 1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-06-19 00:45:59 +08:00
documentation/help BACKUP COMMIT modified help webpages, generators for lumped elements to generate right code for custom excitation 2023-10-25 02:27:35 +02:00
documentation_img Added README description. 2022-03-11 01:03:54 +01:00
experiments Added first help .html page how to read .h5 files in octave 2023-09-27 11:23:40 +02:00
img BACKUP COMMIT added Probe category, add/remove/update is running, need add save/load, script generator functions and some handlers for comboboxes which has depend on probes like NF2FF 2023-04-23 14:21:21 +02:00
test Fix: Port macro from PySide2 to qtpy for PySide6/Qt6 compatibility 2025-06-19 00:45:59 +08:00
ui BACKUP COMMIT added Zin plot into octave generator for S11 script, modified helper text for grid added python code example 2023-12-18 12:41:01 +01:00
utils3rdParty/fcad_pcb BACKUP COMMIT added KiCAD Importer Tool to project, for now just dummy GUI. This tool is wrapper over fcad_pcb to be able import KiCAD PCB into FreeCAD. NOT COMPATIBLE WITH BLENDER 2023-10-19 14:06:45 +02:00
utilsOpenEMS Fix: Port macro from PySide2 to qtpy for PySide6/Qt6 compatibility 2025-06-19 00:45:59 +08:00
.gitattributes add Linguist settings 2022-08-30 21:47:27 +02:00
.gitignore BACKUP COMMIT removed from port Et Dump, Ht Dump, probe, DumpBox, now they are just in probe, OctaveScriptLinesGenerator improved, generate probes correctly, corrected GUI signals to populate NF2FF combobox from probes no from ports like before. Code cleaned. 2023-04-24 21:26:18 +02:00
__init__.py Fix: Port macro from PySide2 to qtpy for PySide6/Qt6 compatibility 2025-06-19 00:45:59 +08:00
ExportOpenEMSDialog.py Fix: Port macro from PySide2 to qtpy for PySide6/Qt6 compatibility 2025-06-19 00:45:59 +08:00
FreeCAD-OpenEMS-Export.FCMacro BACKUP COMMIT smooth mesh support added into mesh priorities widget, now when grid is updated and type is changed from something to smooth mesh or reversed in mesh priority widget it's handled correctly ie. children of smooth mesh group are rmeoved and there is placed just "Grid, groupName, SMOOTH MESH GROUP", also when type is changed from smooth mesh this item is removed and replaced by mesh priority line for each memeber of grid group 2023-04-20 18:46:59 +02:00
KiCADImporterToolDialog.py Fix: Port macro from PySide2 to qtpy for PySide6/Qt6 compatibility 2025-06-19 00:45:59 +08:00
LICENSE Initial commit 2020-10-02 03:44:07 +02:00
README.md Added README description. 2022-03-11 01:03:54 +01:00

FreeCAD-OpenEMS-Export

Simple GUI plugin for FreeCAD to export current model for EM simulation in OpenEMS

What is OpenEMS

According to www.openems.de openEMS is a free and open electromagnetic field solver using the FDTD method. Matlab or Octave are used as an easy and flexible scripting interface.

FDTD means finite distance time domain, it's technique to simulate electromagnetic fields. In pracitce model which is supposed to be simulated is meshed and afterward material constants, ports, probes and other parameters are defined. During simulation electric and magnetic field is excited in appropriate mesh points and propagation of electromagnetic wave is calculated. This method is easy to implement based on Yee's method (https://en.wikipedia.org/wiki/Finite-difference_time-domain_method) and provide good results, advantage of this method over other MoM (method of moments) which is also used to calculate different parameters for antennas is that also materials other than air can be used. In practice this means you can simulate parameters for PCB antennas or simulate electromagnetic wave propagation through any other real models since you know electric parameters of used materials in model (material permitivity, permeability, conductivity and loss parameters).

yee cell

What's this plugin for

OpenEMS itself is FDTD solver implemented in C++ language. Its author Tobias Liebzig made outstanding work, not just to implement solver itself but also provided Matlab (also Octave) interface and programmed AppCSXCAD application to visualize scripted model to visualy inspect model, its meshing and also to modify model itself.

So when using openEMS you have to define your model in Matlab/Octave script what required to study Matlab/Octave interface and its quite exhausting and many thing can go wrong till you figure out how to write your script right. Also to script your model is easy till you want to simulate simple structures but become hard at point you want to simulate more complex structure composed from different materials not mentioning if you want to define complex shapes and still have easy control over their geometry.

On the other hand there is possibility to import into simulation model STL files what brings possibility to define complex structures in some 3D CAD and after import them into simulation. If this all is already provided there was still gap between defining simulation in script and 3D CAD, so this plugin for FreeCAD was created.

This plugin is GUI application which works over FreeCAD, you model your structure in it and afterwards define whole simulation in additional GUI, when everything is done plugin will create Matlab/Octave script which you have to run to simulate model. Also there are options to generate postprocessing scripts to evaluate S parameters and fields for defined structure.

Workflow is similar to Ansoft HFSS, you defines materials, ports, lumped parts, excitation and assign these properties to FreeCAD model objects.

To make long story short below is picture already defined simulation in plugin GUI and also few examples are provided for patch antenna, helical antenna and other. At first sight maybe it seems little hard, but to script these simulation without this plugin will be much harder :)

The main purpose of this GUI is to made easy setup simulation and help to define mesh for it. Right meshing is crucial when using FDTD simulation, it has affect on results. There are some help function like displaying defined mesh lines in FreeCAD model, setting priorities for mesh gridlines and make mesh grid setting understandable for normal people.

GUI example 1