NeuralQuad provides a practical quad-remeshing/re-topology workflow to generate cross field aligned quad mesh using NeurCross trained cross field data.
- Start from a triangle mesh.
- Train a cross field with the bundled
NeurCrosssource. - Optionally convert the saved cross-field output to
.rosy. - Extract an aligned quad mesh with
pyquadwildordirectional.
neuralquad/: quad mesh extraction package and CLI.third_party/NeurCross/: cross-field training and cross-field to.rosyconversion.third_party/pyquadwild/: quad extraction backend dependency.third_party/Directional/: related research dependency and buildable third-party library.
- Python
>=3.10 - A working C/C++ build environment may be required by transitive dependencies such as
pyquadwild - For NeurCross training:
neurcross(installed viapip install .\third_party\NeurCross)torch- optional CUDA-capable GPU if you want GPU training
The root NeuralQuad package declares these runtime dependencies:
numpyscipytimmtrimesh
pyquadwild @ git+https://github.com/akashskypatel/pyquadwild.gitdirectional @ git+https://github.com/akashskypatel/directional.git
python -m pip install .\third_party\Directionalpython -m pip install .\third_party\pyquadwildInstall the root package from this repository:
python -m pip install .For editable development install:
python -m pip install -e .This installs the root extraction CLI:
neuralquad-extract-quad-meshIf you also want the standalone NeurCross training commands, install the bundled subproject separately:
python -m pip install .\third_party\NeurCross- Train NeurCross on a triangle mesh to generate cross-field snapshots.
- Use the latest saved cross-field snapshot or a
.rosyfile as extraction input. - Run NeuralQuad extraction to generate the final quad OBJ.
flowchart LR
A[Train NeurCross] --> B[Generate cross-field snapshots]
B --> C[Use latest snapshot or .rosy file]
C --> D[Run NeuralQuad extraction]
D --> E[Generate final quad OBJ]
From the bundled NeurCross project:
neurcross-train-quad-mesh --data_path D:\path\to\mesh.plyNeurCross writes saved cross-field snapshots under a save_crossField directory in the training output location.
If you want a standalone .rosy file from a saved NeurCross cross-field snapshot:
neurcross-crossfield-to-rosy D:\path\to\save_crossField\mesh_iter_999.vecneuralquad-extract-quad-mesh D:\path\to\mesh.ply D:\path\to\field.rosyUse the Directional backend instead of pyquadwild:
neuralquad-extract-quad-mesh --backend directional D:\path\to\mesh.ply D:\path\to\field.rosyEquivalent module form:
python -m neuralquad.extract_quad_mesh D:\path\to\mesh.ply D:\path\to\field.rosyNeuralQuad can take a saved NeurCross cross-field .vec directly:
neuralquad-extract-quad-mesh D:\path\to\mesh.ply D:\path\to\save_crossField\mesh_iter_999.vecDirectional can also consume the NeurCross .vec directly:
neuralquad-extract-quad-mesh --backend directional D:\path\to\mesh.ply D:\path\to\save_crossField\mesh_iter_999.vecNeuralQuad can also pass a 12-column Directional .rawfield file directly to the Directional backend:
neuralquad-extract-quad-mesh D:\path\to\mesh.ply D:\path\to\field.rawfield
# equivalent explicit backend form:
neuralquad-extract-quad-mesh --backend directional D:\path\to\mesh.ply D:\path\to\field.rawfieldWhen given a NeurCross .vec file, NeuralQuad will:
- Read the saved cross field.
- Write a sidecar
*_crossfield.vec. - Write a Directional-compatible
*.rawfielddebug file. - Convert that to
*.rosy. - Run the selected backend.
- Write the final quad mesh as OBJ.
The third argument is optional:
neuralquad-extract-quad-mesh D:\path\to\mesh.ply D:\path\to\field.rosy D:\path\to\output.objIf you pass a directory instead of a filename, NeuralQuad creates a default OBJ name inside that directory:
neuralquad-extract-quad-mesh D:\path\to\mesh.ply D:\path\to\mesh_iter_999.vec D:\output_dirThis resolves to:
<output_dir>\<mesh-stem>_<field-stem>_quad.obj
If no output path is provided, the default output is written beside the input mesh using the same naming pattern.
Depending on the input field type, extraction may produce:
- final quad mesh OBJ
- generated
*.rosyfile - generated
*_crossfield.vecfile - generated
*.rawfieldfile containing 12-column Directional raw field data for debugging pyquadwild_debug/debug directory
When using --backend directional, the extractor writes quads only. Any non-quad polygons produced by Directional are filtered out before OBJ export.
The root Python package exposes:
neuralquad.extract_quad_mesh(mesh_path, field_path, output_path=None)
extract_quad_mesh() accepts either:
- a triangulated input mesh
- a
.rosyfield file - a NeurCross cross-field
.vecfile - optional
--verboseflag for detailed logging
python -m neuralquad.extract_quad_mesh mesh.ply field.rosy output.obj
# or if using a NeurCross cross-field file:
python -m neuralquad.extract_quad_mesh mesh.ply crossfield.vec output.objThis project is built on top of the following excellent work:
- NeurCross - Neural cross field learning
