Skip to content

Bézier curve evaluation and fit cubic Bézier spline to stream of points#1476

Merged
alecjacobson merged 5 commits intomasterfrom
bezier
Apr 19, 2020
Merged

Bézier curve evaluation and fit cubic Bézier spline to stream of points#1476
alecjacobson merged 5 commits intomasterfrom
bezier

Conversation

@alecjacobson
Copy link
Copy Markdown
Contributor

This is an implementation of "An Algorithm for Automatically Fitting Digitized Curves" by Philip J. Schneider from "Graphics Gems" for arbitrary dimension input (i.e., not just 2D).

Check all that apply (change to [x])

  • All changes meet libigl style-guidelines.
  • Adds new .cpp file.
  • Adds corresponding unit test.
  • This is a minor change.

@jdumas jdumas requested a review from qnzhou April 11, 2020 23:58
@jdumas jdumas added the feature label Apr 11, 2020
@jdumas jdumas mentioned this pull request Apr 12, 2020
4 tasks
if(nPts==1) { return; }
// Avoid using zero tangent
const static auto tangent = [&](const int i,const int dir)->Eigen::RowVectorXd
const static auto tangent = [](
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you even need the lambda to be static? It wouldn't make a difference to the compiler.

Copy link
Copy Markdown
Collaborator

@qnzhou qnzhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! My only concern is that tangent computation seems to be sensitive to input noise.

I am also curious about how good this approach is at capturing sharp corners (G0 locations).

@alecjacobson alecjacobson merged commit f2cc26f into master Apr 19, 2020
@alecjacobson
Copy link
Copy Markdown
Contributor Author

Both your concerns are very valid and problems with this paper. This can be a reference implementation for now (indeed it's a rewrite from Schneider's gem). It'd be cool to handle those and other issues. Not sure if it's research or there're just better methods out there already.

@jdumas jdumas deleted the bezier branch April 19, 2020 16:50
@LINJILIANG
Copy link
Copy Markdown

I wanna know how to use the cubics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants