This repository provides tools to convert triangulated and quad meshes into a union of conforming quad NURBS surfaces, which are widely used in isogeometric analysis. The resulting NURBS surfaces are stored in a format compatible with the geometry file structure of the Boundary Element Method Based Engineering Library (Bembel).
To run the conversion process, use the following command:
python partition.py --input mesh/david.obj --num 350 --start 340 --id 340 --output outputname.dat--input: Specifies the input mesh file. Supported formats:.obj,.vtk.--num: The number of eigenfunctions to compute.--id: Specifies which eigenfunction to use for the partitioning.--output: The name of the output file where the NURBS surface data will be saved.
The code is organized as follows:
__init__.py: Initializes the module.eigens.py: Contains functions related to eigenfunction computations.io.py: Handles input/output operations.morseSmaleQuadrangulation.py: Implements the Morse-Smale complex-based quadrangulation.nurbs.py: Functions for creating and manipulating NURBS surfaces.patches_search.py: Algorithms to search and partition patches in the mesh.utils.py: Utility functions used throughout the code.
This project makes use of the following libraries:
- Topology ToolKit (TTK) for the Morse-Smale complex computation.
- NURBS-Python (geomdl) for NURBS interpolation.
- libigl for computing the eigenfunctions and mesh IO.
- The current implementation supports input mesh formats
.objand.vtk. - Not all eigenfunctions are suitable for obtaining a proper partition; careful selection is needed.
- Some parameters in the Morse-Smale module may need fine-tuning to achieve optimal results.
For any issues or questions, feel free to open an issue on this repository.