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 current release goal.
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.
PyVista can occasionally return small triangular or polygonal feature-edge
noise. The opt-in cleanup below removes closed edge loops and isolated open
surface components whose boundary contains at most 10 edges; adjust
--max-loop-edges for the model when needed.
ems-mesh-checker model.neu geometry.dxf `
--remove-small-loops `
--max-loop-edges 10
This cleanup is disabled by default because a small loop or open surface can also be a real geometric feature. Closed and multi-surface components are kept, as are 2-D closed regions. The CLI reports both removed edge loops and removed open surface components in its diagnostics.
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,
remove_small_loops=True,
max_loop_edges=10,
),
)
Public sample data
Only the following reviewed sample models are included:
data/3D/IronCoil/post_geom.atldata/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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ems_mesh_checker-0.1.1.tar.gz.
File metadata
- Download URL: ems_mesh_checker-0.1.1.tar.gz
- Upload date:
- Size: 77.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dded0c073db1ecf3b84a3964ba59361a808d82e348217c88eb164d237e5484d1
|
|
| MD5 |
9395a6a90faab83c5aa9cbe0835aa48b
|
|
| BLAKE2b-256 |
146af100e9ba30189a63f833b4006deb07860295bc7addf628af3a25d6348124
|
Provenance
The following attestation bundles were made for ems_mesh_checker-0.1.1.tar.gz:
Publisher:
publish.yml on EMSolution-SSIL/ems_mesh_checker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ems_mesh_checker-0.1.1.tar.gz -
Subject digest:
dded0c073db1ecf3b84a3964ba59361a808d82e348217c88eb164d237e5484d1 - Sigstore transparency entry: 2783462132
- Sigstore integration time:
-
Permalink:
EMSolution-SSIL/ems_mesh_checker@e89adec5278fdd948446de1075571a34f8cda8bb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/EMSolution-SSIL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e89adec5278fdd948446de1075571a34f8cda8bb -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file ems_mesh_checker-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ems_mesh_checker-0.1.1-py3-none-any.whl
- Upload date:
- Size: 75.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f8fc641b9d82144a1c053e73eadb83bb5e52ba81073320fd0d196f880dc914d
|
|
| MD5 |
17ba5eb9969fbd78e692cda467cff704
|
|
| BLAKE2b-256 |
045869e40e622d6750b37f6e7f28142f8d3942fcbf1be0c55819554246b99d51
|
Provenance
The following attestation bundles were made for ems_mesh_checker-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on EMSolution-SSIL/ems_mesh_checker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ems_mesh_checker-0.1.1-py3-none-any.whl -
Subject digest:
9f8fc641b9d82144a1c053e73eadb83bb5e52ba81073320fd0d196f880dc914d - Sigstore transparency entry: 2783462326
- Sigstore integration time:
-
Permalink:
EMSolution-SSIL/ems_mesh_checker@e89adec5278fdd948446de1075571a34f8cda8bb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/EMSolution-SSIL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e89adec5278fdd948446de1075571a34f8cda8bb -
Trigger Event:
workflow_dispatch
-
Statement type: