Skip to main content

Testing windows Testing linux PyPi version codecov

EM forces interpolator

Quickstart

em-interpolator is now on PyPi. You can simply install it using:

pip install em-interpolator

and upgraded it to the latest version with

pip install --upgrade em-interpolator

After that, start the GUI using:

python -m em_interp

N.B.
The first time you use the tool, it may take a long time to load. This is most likely due to C++ binding compilations from the GUI package. After this initial run, loading times should be much faster.

GUI overview and functionalities

The GUI is divided into two main tabs: the first is used to configure the interpoalation, while the second is used to perform the interpolation, export data and check results.

Configuration Tab

Three different paths must be indicated to run the interpolation:

  • EM folder: path to a folder containing the EM forces. These are .csv files (with or without header, various separators are accepted) that must contain the coordinates of the EM centroids (in meters) and the EM forces to be interpolated (in Newton). The GUI allows to indicate which is the index (starting from 0) of the X column and Fx column. Y, Z and Fy, Fz columns are expected to be placed respectively after the X column and Fx one. No other files should be present in this folder. More than one EM force file can be interpolated in the same run.
  • Mechanical Mesh: path to the .csv file describing the nodes of the mechanical mesh onto which forces have to be interpolated. The GUI allows to indicate the column index of the node number and the X coordinate (in meters). Y and Z coordinates columns are expected after the X one.
  • Output directory folder where all outputs of the interpolation will be stored.

In addition to these paths, the interpolation parameters described in the algorithm section must be set.

Interpolation Tab

The following is a description of the action buttons of the interpolation tab:

  • Run All: equivalent to clicking all buttons in sequence except for Preview Forces.
  • Initialize interpolator: builds the KDTree and pre-compute all the mech neighbours of each EM centroid.
  • Interpolate: performs the interpolation of all EM force files provided.
  • Export Checks: export a .csv containing forces and moments summaries of all interpolations.
  • Export ANSYS: export one force file for each interpolation ready to be used with the /INPUT command of APDL. The file has the format F, <node_ID>, Fx, <value>.
  • Compute VTK: build vtk objects for original and interpolated forces point clouds.
  • Export VTK: export the vtk objects to .vtk files.
  • Preview Forces: preview a comparison between original and interpolated EM forces to video in the GUI. Sliders are provided at the bottom of the pane to scale up or down the gliph arrows for better visibility purposes.

Description of available algorithms

The interpolation algorithm is based on K-Dimensional Trees (KDTree), a way to organize points in a K-dimensional space which grants fast querys.

KDTree neighbours

There are different ways to search for "close" points into a KDTree (i.e. neighbours). The following are the type of queries that are currently implemented here:

  • K-Nearest: select the K closest mech nodes to the EM node.
  • Radius: select all mech nodes contained by a sphere of radius R centered on the EM node.

Two additional parameters are provided independently of the neighbour selection strategy:

  • maximum distance cut-off: mech nodes farther than distance will be disregarded (more useful with k-nearest strategies).
  • coincidence tolerance: distance at which a mech node and em node should be considered coincident. In this case, no interpolation is called and the EM force is entirely assigned to the coincident mech node.

Interpolation kernels

Once the neighbours are found, there may be different ways to distribute the original EM force on the selected mechanical nodes. The following are the currently available interpolation kernels:

  • Weight by distance: distribute the forces invertionally proportional to the distance from the EM node.
  • FEM based: connect each mech node with a stiff beam to the EM node and distribute forces in order to have the same resultant force and a moment equal to zero.

Developer section

Developer install

First git clone the GitHub repository to your local hardware.

Create a fresh python environment using:

conda create -n <env_name> python=<python_version>

activate the new environment and install the package in editable mode and with additional dev dependencies:

pip install -e .[dev]

Metadata

Release files for em-interpolator 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for em-interpolator 0.1.0
File Size Uploaded Provenance Actions
em_interpolator-0.1.0.tar.gz 1.5 MB With provenance Details for em_interpolator-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for em-interpolator 0.1.0
File Interpreter ABI Platform Actions
em_interpolator-0.1.0-py3-none-any.whl Python 3 none any Details for em_interpolator-0.1.0-py3-none-any.whl

Total release size: 1.5 MB

Release files / em_interpolator-0.1.0.tar.gz

Download URL em_interpolator-0.1.0.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
e4d9fe2c34d97a338d9a24c7455b927c29e324bad81ae9aac0c34620d4f0d300
BLAKE2b-256 checksum
How to use checksums
b07b5a83e54950b5a3eb222de7ba6aefa3f6c3f8c8f0e38d48582978c27d993f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 11, 2026.

Transparency log

Release files / em_interpolator-0.1.0-py3-none-any.whl

Download URL em_interpolator-0.1.0-py3-none-any.whl
Size 27.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc2d0b5c3ac3eb9f2a29c5d406100cc3eb3e87dc35a8e5aa220a967fd7200b24
BLAKE2b-256 checksum
How to use checksums
877fa42eb9f3be61a63718bb4fb71e0558898f8a76af9ea95ad5061e4d411412
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 11, 2026.

Transparency log

Security for em-interpolator 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for em_interpolator-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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