PyMeshIt is a complete Python package for mesh generation and manipulation with a full-featured Qt-based GUI. It provides a comprehensive workflow to process point clouds and polylines into conforming surface meshes and tetrahedral meshes.
Note: This version runs entirely in Python without C++ dependencies, making it easier to install and deploy.
The included GUI (main.py) implements a full MeshIt workflow with the following main tabs:
-
- Load Data — load points, wells (polylines) or VTU/Poly formats; manage multiple datasets and colors.
-
- Convex Hull — compute dataset boundaries (convex or rim for/quasi-planar sheets) with corner detection.
-
- Segmentation — refine hulls by target feature size and per-surface length tables (RefineByLength).
-
- Triangulation — generate surface triangulations with gradient, min-angle, interpolation and uniform options.
-
- Intersections — compute & visualize global surface–surface and polyline–surface intersections; triple point detection.
-
- Refine & Mesh — refine intersection/hull lines, generate conforming surface meshes, constraint selection UI, per-surface mesh density table.
-
- Pre‑Tetramesh — select conforming surfaces, validate for TetGen, manage selection tree for tetrahedralization.
-
- Tetra Mesh — generate and visualize tetrahedral meshes, assign materials, export results.
PyMeshIt provides standalone executables for Windows 10/11 and Ubuntu (22.04+). These do not require Python to be installed.
- Go to the Releases page.
- Download the appropriate file for your OS:
- Windows:
PyMeshit-vX.X.X-win64.zip - Ubuntu:
PyMeshit-vX.X.X-linux.zip - MacOS:
PyMeshit-vX.X.X-macos.zip
- Windows:
- Extract the archive.
- On Linux, you may need to make the file executable:
chmod +x PyMeshIt
- Run the executable (
./PyMeshIton Linux, double-clickPyMeshIt.exeon Windows).
Note: macOS support is planned for future releases.
If you prefer to run from source or use the Python API, you can install via pip:
pip install triangle
pip install pymeshitIf you want to install from source:
git clone https://github.com/waqashussain117/PyMeshit
cd PyMeshit
pip install -e .The package will automatically install all required dependencies:
- numpy
- scipy
- matplotlib
- PySide6
- pyvista
- tetgen
- triangle (optional)
Linux Users: You may need to install system libraries for Qt. On Ubuntu:
sudo apt-get install libxcb-cursor0 libxkbcommon-x11-0 libegl1 libopengl0 libgl1For installation either install the Requirements and then open through Python. After installation, run the GUI:
meshit-guiOr from Python:
import Pymeshit
Pymeshit.main_wrapper()Typical workflow:
- Load one or more point or VTU files (File → Load).
- Compute hulls (Convex Hull tab).
- Compute segmentation (Segmentation tab) — set "Target Feature Size" or per-surface values.
- Run triangulation (Triangulation tab), choose interpolation and quality settings.
- Compute intersections (Intersections tab) to extract shared constraints and triple points.
- Refine intersection lines and generate conforming meshes (Refine & Mesh tab).
- Select conforming surfaces and validate for TetGen (Pre‑Tetramesh tab).
- Generate and visualize tetrahedral mesh (Tetra Mesh tab) and export.
If you encounter an error like X Error of failed request: BadWindow or the application crashes on startup, it is likely due to graphics driver compatibility, especially in Virtual Machines (VirtualBox, VMware).
Try running the application with software rendering forced:
export LIBGL_ALWAYS_SOFTWARE=1
./PyMeshItOr force the Qt platform to X11:
export QT_QPA_PLATFORM=xcb
./PyMeshItContributions are welcome. Please open an issue for discussion and submit PRs for fixes and features. Keep GUI behavior consistent with the tab-based workflow.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
