diff options
author | Hans Goudey <h.goudey@me.com> | 2022-07-06 00:08:37 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-07-06 00:08:37 +0300 |
commit | 9435ee8c65193e3d4af8f1ac5b07b7884cf62bd5 (patch) | |
tree | c30e035d43729f26d7774b30faa1376f0aa9c4a8 /source/blender/geometry/GEO_subdivide_curves.hh | |
parent | 7688f0ace7a6c45aaa8304d2a26a760be0056aa6 (diff) |
Curves: Port subdivide node to the new data-block
This commit moves the subdivide curve node implementation to the
geometry module, changes it to work on the new curves data-block,
and adds support for Catmull Rom curves. Internally I also added
support for a curve domain selection. That isn't used, but it's
nice to have the option anyway.
Users should notice better performance as well, since we can avoid
many small allocations, and there is no conversion to and from the
old curve type.
The code uses a similar structure to the resample node (60a6fbf5b599)
and the set type node (9e393fc2f125). The resample curves node can be
restructured to be more similar to this soon though.
Differential Revision: https://developer.blender.org/D15334
Diffstat (limited to 'source/blender/geometry/GEO_subdivide_curves.hh')
-rw-r--r-- | source/blender/geometry/GEO_subdivide_curves.hh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/geometry/GEO_subdivide_curves.hh b/source/blender/geometry/GEO_subdivide_curves.hh new file mode 100644 index 00000000000..4f671467b24 --- /dev/null +++ b/source/blender/geometry/GEO_subdivide_curves.hh @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +#include "BLI_function_ref.hh" +#include "BLI_index_mask.hh" + +#include "BKE_curves.hh" + +struct CurveComponent; + +namespace blender::geometry { + +/** + * Add more points along each segment, with the amount of points to add in each segment described + * by the #cuts input. The new points are equidistant in parameter space, but not in the actual + * distances. + * + * \param selection: A selection of curves to consider when subdividing. + */ +Curves *subdivide_curves(const CurveComponent &src_component, + const bke::CurvesGeometry &src_curves, + IndexMask selection, + const VArray<int> &cuts); + +} // namespace blender::geometry |