This repo contains code for fitting curves and surfaces to any input point cloud.
- Pytorch: Installation command can be generated from here.
- Pytorch 3D:
- For CPU only install
pip install pytorch3d
should do - For macOS running on Apple Silicon
MACOSX_DEPLOYMENT_TARGET=10.14 CC=clang CXX=clang++ pip install "git+https://github.com/facebookresearch/pytorch3d.git"
- For GPU support, we would need to install
pytorch3d
using the following processTBD pip install "git+https://github.com/facebookresearch/pytorch3d.git"
- For CPU only install
- Geomdl:
pip install geomdl
- Curve Evaluation (curve_eval.py)
- The evaluation kernels for curve_eval.py are written under torch_nurbs_eval/csrc/curve_eval.cpp
- To run curve_eval.py, provide input control points, input point cloud and set the number of evaluation points under out_dim in CurveEval.
- To generate random distribution of control points, use data_generator.gen_control_points()
- Input Size parameters:
- control points : (No of curves, no of control points, [(x,y,weights) or (x,y,z,weights)] )
- point cloud : (No of point clouds, no of points in point cloud,3)
- Parameters to vary: degree, number of control points, number of evaluation points.
- To run the curve evaluation, cd into torch_nurbs_eval.
- To run
python curve_eval.py
(Will add details for Surface Fitting soon)