Skip to main content

EMS Mesh Checker

ems_mesh_checker is a Python proof-of-concept for checking finite-element mesh topology and reconstructing representative Property geometry from EMSolution meshes. It uses PyVista/VTK for feature-edge extraction, then applies its own topology and curve reconstruction to export reusable CAD/mesher input.

Features

  • Extract external faces and interfaces between Property IDs.
  • Select only specified Properties with --properties.
  • Exclude specified Properties, such as an air region, with --exclude-properties.
  • Treat multiple Properties as one region and omit their mutual interfaces with --merge-properties.
  • Optionally suppress same-Property hexahedron/tetrahedron coupling interfaces made from one quadrilateral and two triangles.
  • Reconstruct representative straight lines and circular arcs from feature edges.
  • Export the same reconstructed curves to DXF, Gmsh GEO, and Femap Neutral geometry files.
  • Report node/element loading progress for large Femap Neutral files.

The current PoC targets linear elements. Higher-order element support is not a release goal for version 0.1.0.

Installation

Python 3.10 or newer is required. The normal installation model is to install both projects as Python packages; the two repositories do not need to remain in the same parent directory.

Install from PyPI. ems-file-format-converter 0.6.0 or newer is installed automatically as a dependency:

python -m pip install ems-mesh-checker

For development of both projects, clone and install both repositories:

git clone https://github.com/EMSolution-SSIL/ems_file_format_converter.git
git clone https://github.com/EMSolution-SSIL/ems_mesh_checker.git

python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e .\ems_file_format_converter
.\.venv\Scripts\python.exe -m pip install -e ".\ems_mesh_checker[dev]"

The editable installs may point to repositories in any directories. Placing them next to each other is only a convenient convention.

Command-line usage

The command accepts an arbitrary input mesh. It always writes three files with the same stem: representative .dxf, .geo, and Femap geometry .neu.

ems-mesh-checker INPUT_MESH [OUTPUT.dxf]

IronCoil public sample:

ems-mesh-checker .\data\3D\IronCoil\post_geom.atl .\generated\IronCoil.dxf `
  --circle-elements-per-turn 48

QuadTri public sample, retaining cross-Property boundaries while suppressing same-Property hex/tet coupling faces:

ems-mesh-checker .\data\3D\QuadTri\post_geom.neu .\generated\QuadTri.dxf `
  --suppress-quad-tri-interfaces

Export only Properties 2 and 5:

ems-mesh-checker model.neu geometry.dxf --properties 2,5

Exclude air Property 1 and merge Properties 4 and 5 into one extracted region:

ems-mesh-checker model.neu geometry.dxf `
  --exclude-properties 1 `
  --merge-properties 4,5

For repeated independent groups, repeat --merge-properties. Run ems-mesh-checker --help for tolerance, preview, Gmsh validation, and other options.

Output formats

  • DXF contains point/line/arc-oriented representative geometry for CAD and mesher interoperability.
  • Gmsh GEO contains points, lines, circles, planar/ruled surfaces, surface loops, and volumes where reconstruction succeeds.
  • Femap Neutral output contains reconstructed point, line, and arc geometry.

Feature-edge extraction is heuristic. Complex or noisy meshes may contain open shells or unsupported planar regions; review the CLI diagnostics and generated geometry before using it for production meshing.

Python API

The lower-level API is available from ems_mesh_checker:

from ems_file_format_converter import read_mesh
from ems_mesh_checker import BoundaryExtractor, FeatureEdgeConfig
from ems_mesh_checker import extract_property_group_feature_edges

mesh = read_mesh("model.neu", progress=True)
boundaries = BoundaryExtractor(mesh).extract()
features = extract_property_group_feature_edges(
    boundaries,
    (2, 5),
    config=FeatureEdgeConfig(feature_angle_degrees=30.0),
)

Public sample data

Only the following reviewed sample models are included:

  • data/3D/IronCoil/post_geom.atl
  • data/3D/QuadTri/post_geom.neu

Other development and customer models are intentionally excluded. The .gitignore treats all additional files below data/ as private by default.

Tests

python -m pytest -q

License

MIT License. Copyright (c) 2026 Hiroyuki Kaimori. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ems_mesh_checker-0.1.0.tar.gz (74.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ems_mesh_checker-0.1.0-py3-none-any.whl (73.5 kB view details)

Uploaded Python 3

File details

Details for the file ems_mesh_checker-0.1.0.tar.gz.

File metadata

  • Download URL: ems_mesh_checker-0.1.0.tar.gz
  • Upload date:
  • Size: 74.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ems_mesh_checker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6252b52f2b767dceb11c89a31cd35e554d6664ffee4e5cbf21f595dfab9236b3
MD5 58e2f1fc20da44443dbb2e78fe36404e
BLAKE2b-256 7709c96cc69824f00401ad1735161299e0c8c4113d82f49ff055c107524df090

See more details on using hashes here.

Provenance

The following attestation bundles were made for ems_mesh_checker-0.1.0.tar.gz:

Publisher: publish.yml on EMSolution-SSIL/ems_mesh_checker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ems_mesh_checker-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ems_mesh_checker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de8f94afbcd461fc565720c4f68960184f989834c25eed89c6eabd3fb04b8213
MD5 e685028b5072ec35c3f064349451d606
BLAKE2b-256 678f409a193e946db0d12e5869259608e3a02e9ee9fa554dc575275320189d40

See more details on using hashes here.

Provenance

The following attestation bundles were made for ems_mesh_checker-0.1.0-py3-none-any.whl:

Publisher: publish.yml on EMSolution-SSIL/ems_mesh_checker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page