A modular Python pipeline to convert topographic surfaces (in XYZ format) into Material Point numerical domains, including STL mesh generation and material point list creation.
- Translates surfaces to the origin
- Filters invalid or internal points
- Combines surfaces with failure geometry
- Generates STL meshes with optional resolution control
- Produces uniformly distributed material points
- Filters material points below the STL surface
- Exports material points as JSON list for MPM-compatible simulator
From the root of the repository (where setup.py is located), run:
pip install -e .xyz2mpm/
├── xyz2mpm/ # Main package
│ ├── main.py
│ ├── __init__.py
│ ├── preproc/
│ ├── mesh/
│ └── particles/
├── examples/
│ └── lomba_grande_slope/
│ ├── input/
│ ├── output/
│ └── run_example.py
├── requirements.txt
├── setup.py
└── README.md
python examples/lomba_grande_slope/run_example.pyfrom xyz2mpm.main import run_xyz2mpm_pipeline
run_xyz2mpm_pipeline(
initial_xyz="input/surface_before.xyz",
failure_xyz="input/surface_failure.xyz",
dx=2.0, dy=2.0, dz=2.0,
reduction_factor=2,
safety_factor=0.1
)- Python ≥ 3.8
- Packages: numpy, scipy, pyvista, matplotlib
MIT License – see LICENSE
Developed by Prof. Dr. Fabricio Fernández – Universidad Católica del Norte