Skip to content

Commit

Permalink
Create the correct number of points in deboornet constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Steinbeck committed Jul 26, 2018
1 parent 8c4a494 commit edd2b33
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tinyspline.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,9 @@ void ts_internal_deboornet_new(const tsBSpline *spline,
{
const size_t dim = ts_bspline_dimension(spline);
const size_t deg = ts_bspline_degree(spline);
const size_t num_points = (size_t)(deg * (deg+1) * 0.5f);
/* Handle case deg <= 1 which generates too few points. */
const size_t order = ts_bspline_order(spline);
const size_t num_points = (size_t)(order * (order+1) * 0.5f);
/* Handle case order == 1 which generates too few points. */
const size_t fixed_num_points = num_points < 2 ? 2 : num_points;

const size_t sof_real = sizeof(tsReal);
Expand Down

0 comments on commit edd2b33

Please sign in to comment.