tigl icon indicating copy to clipboard operation
tigl copied to clipboard

Add functionality for reparameterizing B-splines without changing geometry (Fix issue #890)

Open svengoldberg opened this issue 2 months ago • 9 comments

Description

This PR implements a method to apply exact reparameterizations of B-splines used for profile curves. The underlying algorithm was found in The NURBS Book (1997; 2nd edtion; Piegl and Tiller), p. 251. The reparameterization is mandatory for lofting (correct connection of kinks in two profiles, since they are connected based on parametric values of the curves). The current implemented reparameterization creates overshoots of the profile curves (cf. issue #890) due to change of the geometry. The approach in this PR does not change the geometric structure but still executes a reparameterization. The wanted parameters are interpolated picewise linearly (to mimic a B-spline structure of the reparameterization function) and to not increase the degree of the resulting B-spline curve. After that, the above mentiond algorithm is applied based on this reparameterization function. To come into account, a new function and some helper functions are implemented based on OpenCASCADE B-spline handling.

Changes in src/fuselage/CCPACSFuselageProfile.cpp :

Apply the reparameterization on a B-spline. Similar to the current behaviour.

Changes in src/geometry/CTiglBSplineAlgorithms.* :

Implement the new reparameterization (bsplineReparameterizePicewiseLinear) with the use of a few helper functions.

Changes in src/geometry/CTiglInterpolatePointsWithKinks.* :

The function computeParams is now needed also in CCPACSFuselageProfile.cpp and is therefore put into a non-anonymous namespace.

Fixes issue #890

EDIT:

The combination of this reparameterization with the reparametrizeBSplineNiceKnots() seems not to work as the geometry is changed in a too drastic way when the parameters are predefined. However, since the performance advantage should not be rejected in the most cases, the function is only used when there are no parameters defined in the CPACS profile.

How Has This Been Tested?

The test bsplineReparameterizePicewiseLinear is added to check if the reparameterization is applied correct and if the geometric structure is kept. Also, in the attached screenshots, the behaviour of the old vs. new implementation is compared:

Overshoot Overshoot after reparameterization Fix_Overshoot No overshoot after reparameterization

Checklist:

  • [x ] A test for the new functionality was added.
  • [ ] All tests run without failure.
  • [ ] The new code complies with the TiGL style guide.
  • [ ] New classes have been added to the Python interface.
  • [ ] API changes were documented properly in tigl.h.

svengoldberg avatar May 07 '24 11:05 svengoldberg