Skip to content

Open-RFlab/openemsh

Repository files navigation

Liberapay patrons Discord License Version Nix

CodeQL SonarCloud quality gate SonarCloud coverage

OpenEMSH : OpenEMS Mesher [WIP]

This project is under heavy development and not yet usable, for now the best way to contribute is to give a symbolic tip. :)

Abstract

This is an OpenEMS mesher draft (with a H at the end, it looks like mesh poorly written). Meshing an OpenEMS structure is a difficult task often done manually. Some automatic meshers exist, shipped with either an Octave/Python API or a converter tool from a PCB design software.

By creating myself one of those converter (Qucs-RFlayout), discussing with other meshers authors, observing meshers behavior and looking into their code, I identified some pitfalls that end up to usability or mesh correctness issues :

  • All polygon edges should be detected and not just the edges of the polygon minimal bounding boxes.
  • The collinear edges' detection is not related to the mesh and thus should be treated independently, before any thirds rule application or smoothmesh generation.
  • The user should be able to give directives to customize the mesh / solve meshlines conflicts through a decent interface.
  • The thirds rule should not be applied statically at the chosen mesh resolution before smoothmeshing, but should be applied while smoothmeshing. The reason is fixed meshlines make the structure really difficult to smoothmesh correctly. Also, this way is not possible to correctly handle structure parts that are equivalent or thinner than the mesh resolution.

Those considerations led me to think the key to create a correct mesher is about conflict management system :

  • Identifying and classifying conflict kinds.
  • Registering conflicts.
  • Providing automatic resolution.
  • Providing access to resolve manually.

Also, I'd like this mesher to be a standalone tool, independent of any converter or scripting API.

The doc/ directory contains some experimentations about meshing algorithms, such as this Python script.

Developing

The development environment is based on Nix (which handles dependencies) and the tools provided by cmake-utils. Install Nix and take a look to cmake-utils for usage information.

  • nix flake update For updating the dev env
  • nix develop For entering the dev env

And then proceed as usual with CMake.