diff options
author | Hans Goudey <h.goudey@me.com> | 2021-05-07 23:37:06 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-05-07 23:37:06 +0300 |
commit | 3185084efbe493bf232fb0de62b341ae2a2e2936 (patch) | |
tree | b1c32e8646cfe9147801cdc1160cd4293db0ea97 /source/blender/blenkernel/intern/spline_bezier.cc | |
parent | 960535ddf3446204dbfcc0f23040bdb74f7a9720 (diff) |
Geometry Noes: Curve Resample Node
This node generates a naturally parametarized (even length edge) poly
spline version of every spline in the input. There are two modes,
"Count", and "Length". These are similar to the same options for the
line primitive node in end points mode.
I implemented this instead of a "Sample Points" node, because for this
operation it's trivial to keep the result as a curve, which is nice
since it increases flexibility, and because it can make instancing
simpler, i.e. using the transforms of each evaluated point rather than
requiring the construction of a "rotation" attribute.
Differential Revision: https://developer.blender.org/D11173
Diffstat (limited to 'source/blender/blenkernel/intern/spline_bezier.cc')
-rw-r--r-- | source/blender/blenkernel/intern/spline_bezier.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/spline_bezier.cc b/source/blender/blenkernel/intern/spline_bezier.cc index f62718011da..4d4e1b386c4 100644 --- a/source/blender/blenkernel/intern/spline_bezier.cc +++ b/source/blender/blenkernel/intern/spline_bezier.cc @@ -73,6 +73,18 @@ void BezierSpline::add_point(const float3 position, this->mark_cache_invalid(); } +void BezierSpline::resize(const int size) +{ + handle_types_left_.resize(size); + handle_positions_left_.resize(size); + positions_.resize(size); + handle_types_right_.resize(size); + handle_positions_right_.resize(size); + radii_.resize(size); + tilts_.resize(size); + this->mark_cache_invalid(); +} + MutableSpan<float3> BezierSpline::positions() { return positions_; |