This patch is intended to adjust some comments for the trim implementation:
Corrects trim for cyclical curves mentioned in T101379, splitting the curves if the start/endpoint is at the 'loop point'.
Corrects implementation based on comments in D14481, request was made to use 'foreach_curve_by_type' to computing the point lookups.
Included corrections found in D16066 as it may not be a adopted solution.
Exposed selection input by adding it as input to the node.
Above changes implied some cascading effect to the implementation:
- IndexRangeCyclic was transformed to using 32 bit integers and no longer works within a subinterval of some buffer using range_size_ to determine the size of the underlying buffer. No longer tracking the start/end of the underlying buffer. While these features where the memory consumption (40 bytes, 320 bits) to store an entry had a noticeable performance impact in the trim implementation as it was changed to compute entries once. Since the primary purpose is to use it for curves which is limited to a buffer size determined by a 32 bit integer, reducing the memory usage of an entry to fit in a 128 bit WORD had a performance impact.
- Computing the curve size computation is parallelized and is combined with the point lookup computations in 'compute_curve_trim_parameters()'. The solution for avoiding computing both trim lookups if equivalent should be slightly clearer.
- Added 'foreach_curve_by_type_mask()' to avoid recomputing the curve selection based on type. Selection for single point splines is tracked and updated after 'compute_curve_trim_parameters()'.
Performance for large number of Bezier/Catmull curves is slightly improved after mentioned adaptations. Uncertainty in the measurements however.
Interesting feedback:
Should selection input be reverted/ moved to a separate diff?
Wouldn't say this is an improvement to the code quality as it removes functionality that would be reusable.