From 3185084efbe493bf232fb0de62b341ae2a2e2936 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Fri, 7 May 2021 15:37:06 -0500 Subject: 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 --- source/blender/blenkernel/intern/spline_poly.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/blenkernel/intern/spline_poly.cc') diff --git a/source/blender/blenkernel/intern/spline_poly.cc b/source/blender/blenkernel/intern/spline_poly.cc index 09c578c0503..ab6f4704a88 100644 --- a/source/blender/blenkernel/intern/spline_poly.cc +++ b/source/blender/blenkernel/intern/spline_poly.cc @@ -44,6 +44,14 @@ void PolySpline::add_point(const float3 position, const float radius, const floa this->mark_cache_invalid(); } +void PolySpline::resize(const int size) +{ + positions_.resize(size); + radii_.resize(size); + tilts_.resize(size); + this->mark_cache_invalid(); +} + MutableSpan PolySpline::positions() { return positions_; -- cgit v1.2.3