No description, website, or topics provided.
C++ Python CMake C
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Doo-Sabin subdivision regression

This repository provides the code necessary to fit Doo-Sabin subdivision surfaces to unstructured 3D point data. It is the 3D analog of Uniform B-spline Regression.

Author: Richard Stebbing

License: MIT (refer to LICENSE).



Python Example & Visualisation:

  • Numpy
  • Scipy
  • scikit-learn
  • VTK


To build doosabin_regression:

  1. Run CMake with an out of source build.
  2. Set COMMON_CPP_INCLUDE_DIR to the full path to rstebbing/common/cpp.
  3. Set DOOSABIN_INCLUDE_DIR to the full path to rstebbing/subdivision/cpp/doosabin/include.
  4. Set Ceres_DIR to the directory containing CeresConfig.cmake.
  5. Set GFLAGS_INCLUDE_DIR, GFLAGS_LIBRARY and RAPID_JSON_INCLUDE_DIR. (Add -std=c++11 to CMAKE_CXX_FLAGS if compiling with gcc.)
  6. Configure.
  7. Build.


To generate an example regression problem:

python python/ 2048 example-2048.json --seed=0

The generated JSON file contains five fields: Y, raw_face_array, X, p, and U:

  • Y is the flattened (num_data_points, 3) array of data points. Here, the num_data_points = 2048 data points are synthetically generated by uniformly sampling a sphere and displacing the points radially with zero-mean Gaussian noise.
  • raw_face_array is the mesh topology (see sequence_to_raw_face_array) that defines the Doo-Sabin subdivision surface.
  • X is the flattened (num_control_points, 3) array of control points that defines the geometry of the Doo-Sabin surface.
  • Each data point has an (unknown) correspondence (preimage) on the surface. p is the array of (num_data_points,) patch indices; U is the flattened (num_data_points, 2) array of patch coordinates.

To visualise the problem and initial state:

python python/ example-2048.json

(Add -d U to disable the tubes between each data point and its correspondence.)

The purpose of doosabin_regression is to update X, U, and p so that the evaluated surface "fits" the data points Y. To run:

<build-directory>/bin/doosabin_regression example-2048.json 1e-4 example-2048-1.json -v 1 --min_trust_region_radius=1e-6 --max_num_iterations=10

where the compiled binary is located at <build-directory>, 1e-4 is the amount of regularisation ("force" betwen mesh control points), example-2048-1.json is the output path, -v 1 enables verbose output, and --min_trust_region_radius=1e-6 and --max_num_iterations=10 control termination of the optimiser.

To visualise:

python python/ example-2048-1.json

Additional arguments to python/, python/, and doosabin_regression can be found with --help.