Add dimension-templated constrained curve wrapper - #61
Open
illionj wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
First of all, thank you for this library. It has been very helpful in my work.
I ran into a small issue in my own use case: I mostly work with 2D curves, and
the current
std::vector<fpPoint>representation means that each point is itselfa dynamically sized vector. In my path-smoothing code, this adds some extra
overhead and makes the call sites slightly less direct.
This PR adds
fpConstrainedCurveTemplate<N>, an alternative fixed-dimensionwrapper around
fitpack_constrained_curve_c.The main change is that each point is represented as:
std::array<FP_REAL, N>instead of a dynamically sized
std::vector.This is useful for common fixed-dimension cases such as 2D and 3D curves, while
keeping the existing API unchanged.
Example:
Changes
include/fpConstrainedCurveTemplate.hppinclude/fitpack.hppstd::array<FP_REAL, N>for pointsfpConstrainedCurveAPI unchanged