Add GeomAPI_PointsToBSpline as an optional alternative algorithm in CSTCurveBuilder #1049
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.
Fixes #1048
Description
This PR adds the option to set the algorithm in CCSTCurveBuilder. The current algorithm based on a Chebychev approximation creates relatively good curves with few control points, but it potentially introduces discontinuities in the curvature, because the approximation is performed segmentwise and the segments are concatenated without taking second derivatives into account.
With the changes introduced here, the CCSTCurveBuilder constructor gets a new optional enum argument, to switch the algorithm to OCCT's GeomAPI_PointsToBSpline implementation for the approximation. This results in a C3 continuous B-Spline of degree 4 which is much smoother, but may have more control points.
How Has This Been Tested?
The existing CSTApprox tests have been parametrized, such that the both algorithms are tested. In addition, the profile definition from the issue description in #1048 has been added. As it turns out, the old implementation fails to satisfy the prescribed tolerance of 1e-5 for this specific choice of CST parameters.
The image shows the curvature comb for the Chebychev approximation (default algorithm that was used thus far) to the right in the back and the curvature comb for the approximation based on
GeomAPI_PointsToBSpline
to the left/front.Checklist: