Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve curve interpolation #10

Closed
pbeshai opened this issue Nov 21, 2016 · 2 comments · Fixed by #16
Closed

Improve curve interpolation #10

pbeshai opened this issue Nov 21, 2016 · 2 comments · Fixed by #16
Assignees

Comments

@pbeshai
Copy link
Owner

pbeshai commented Nov 21, 2016

As was demonstrated in #7, curve interpolation can use some work. The current solution sets the control points to have the same values as the x,y position of the point which results in a slightly jagged appearance:

interpolate_fix1

To get over this, we would need to split the bezier curve intelligently. Since we're using d3's interpolateString to do our actual interpolation, this would require a significant amount of work. Ideas on how to split bezier curves are here: http://www.iscriptdesign.com/?sketch=tutorial/splitbezier. Interestingly, switching to doing numeric interpolation on the already derived command objects might actually end up being faster than using d3's interpolateString anyway and could be investigated for its own merits.

@pbeshai
Copy link
Owner Author

pbeshai commented Jun 12, 2017

Note that I have programmed the functions for this now and just need to integrate them here. See

@pbeshai
Copy link
Owner Author

pbeshai commented Jul 6, 2017

As an update to my last comment - it turns out interpolating position is not sufficient for solving this problem. You actually need to split the bezier curves (i.e. also interpolate where the new control points should be given the new start and end points). I ended up using de Casteljau's algorithm for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant