Python 3.10 or newer is required. Use a Python environment with compatible PyTorch and compiled extension builds.
The package requires NumPy, SciPy, PyTorch, and torch-scatter.
- Install the PyTorch build for your Python version and CPU/CUDA environment using the official PyTorch instructions.
- Install a matching
torch-scatterbuild using the PyG extension installation guide. Match the extension wheel to your PyTorch and CPU/CUDA build, including when running a CUDA-enabled PyTorch installation on the CPU. - From the project root, install this package:
python -m pip install .The import name is torch_fea_mesh; the distribution name is torch-fea-mesh.
| Extra | Purpose | Installation |
|---|---|---|
vtk |
VTK I/O, VTK-based processing, and isotropic remeshing | python -m pip install '.[vtk]' |
chamfer |
Chamfer distance with PyTorch Geometric and its KNN backend | python -m pip install '.[chamfer]' |
dev |
pytest, build tools, and distribution checks | python -m pip install -e '.[dev]' |
For chamfer, install a matching pyg-lib build using the PyG extension guide
before installing the extra. This extra requires PyTorch Geometric 2.8 or newer
and pyg-lib 0.6 or newer.
VTK is optional for core mesh operations. Importing the isotropic remesher requires VTK.
After installing matching torch-scatter and pyg-lib builds, install all test
dependencies in editable mode:
python -m pip install -e '.[dev,vtk,chamfer]'
python -m pytest test/ -vCUDA tests also require an accessible CUDA device. See testing for partial runs and optional dependency skips.
With the dev extra installed:
python -m build
python -m twine check dist/*The wheel contains the library. The source distribution also contains tests,
examples, documentation, and data/data_record.json. Dataset files and generated
outputs under data/ are excluded from both. Obtain shared inputs separately to
run the tests that use them; see the testing guide.
To check an installed wheel, use a separate environment with matching numerical dependencies and run from outside the project directory. This ensures the source folder cannot shadow the installed package; see wheel validation.