Add auto_speed option for BSplines to avoid sharp bends #88
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using
auto_speed=true
inbspline!
orBSplineRouting
will optimize endpoint speeds to minimize the integral of the squared curvature. This is mainly for convenience, to avoid having to set speeds manually. Smooth changes in curvature are also often physically nice, but note that our BSpline construction only sets the tangent at the origin, not the curvature, so there is still a discontinuity in curvature at the start and end of the bend. (For a 90 degree turn, the radius of curvature varies from 92.5% to 102.5% of a circle's.) Maybe we should have a zero initial curvature option?First commit has a version that uses the derivative of the curvature.
I would like to make this the default, but that will have to wait for v2.0 because it would be a breaking change.
Works nicely on a variety of test cases and is reasonably fast. Still need to convert those to unit tests.