Fitting cubic spline curve to 2d points
This is an implementation of paper "Fitting B-spline Curves to Point Clouds by Curvature-Based Squared Distance Minimization".
Link to the paper: http://www.geometrie.tuwien.ac.at/ig/sn/2006/wpl_curves_06/wpl_curves_06.html
The input is a set of 2d points, the output are control points of a close cubic spline curve.
- Input file: a file that contains n rows and each row reprents a point with x y positions.
- Output files: a file with the control points of the output curve; and a file with sampling points of the output file.
This project depends on two code librarie:
- Eigen 3: all matrix and vector operations are based on this library
- ANN: it is used to compute the nearest neighbor of a given point.
BSplineFitting should be able to run in any environment, but it is only tested in windows enviroment.
I use cmake to configure and generate project files.
drawResult.m: a simple .m file to visulize the input and output
core/cubic_b_spline.h: a class encode the cubic b spline
core/spline_curve_fitting.h:
read_write_asc.h: a simple class that reads/writes files