tumcms / Open-Infra-Platform

This is the official repository of the open-source Open Infra Platform software (as of April 2020).
Other
50 stars 23 forks source link

[TODO] Performance optimation in splineUtilities (derivatives) #408

Open christophKaiser opened 3 years ago

christophKaiser commented 3 years ago

Location in code file Core/src/IfcGeometryConverter/SplineUtilities.h, functions of curvature and derivative calculation - especially the function computeCurvatureOfBSplineCurveWithKnots and its called subfunctions.

Performance optimation could be meaningful because the calculation with 168 control points needs about 1:40 minutes (observed with the option Stroke to Alignment in the class SplineInterpretation.

Additional context The function call hierarchy in the calculation of the curvature looks about like the following: (simplified)

computeCurvatureOfBSplineCurveWithKnots
  computePointOfBSpline
    obtainBasisFunctionBSpline
  computePointOfDerivativeOne
    obtainBasisFunctionBSpline  // first recall
    obtainBasisFunctionDerivativeOne
  computePointOfDerivativeTow
    obtainBasisFunctionBSpline  // second recall
    obtainBasisFunctionDerivativeOne  // first recall
    obtainBasisFunctionDerivativeTwo

By restructuring the functions, probably the repeating calls of the 'obtain Basis Function ...' could be prevented. Maybe, some other optimizations are possible, as well.

Till now, the function computeCurvatureOfBSplineCurveWithKnots is only used by the interpretation of B-Splines to alignment elements (see #202). It isn't used in any ifc-converters, thus this task seems to be not urgent.