[Bf-blender-cvs] [d7aa4812317] geometry-nodes-curve-support: Splines: Add comments
Hans Goudey
noreply at git.blender.org
Thu Apr 22 21:20:41 CEST 2021
Commit: d7aa48123174c08a07366cfb7f5e3544b5c2fbb0
Author: Hans Goudey
Date: Thu Apr 22 12:24:52 2021 -0500
Branches: geometry-nodes-curve-support
https://developer.blender.org/rBd7aa48123174c08a07366cfb7f5e3544b5c2fbb0
Splines: Add comments
===================================================================
M source/blender/blenkernel/intern/spline_nurbs.cc
===================================================================
diff --git a/source/blender/blenkernel/intern/spline_nurbs.cc b/source/blender/blenkernel/intern/spline_nurbs.cc
index 4181e8c6df6..f81dec2d8f3 100644
--- a/source/blender/blenkernel/intern/spline_nurbs.cc
+++ b/source/blender/blenkernel/intern/spline_nurbs.cc
@@ -301,6 +301,7 @@ static void calculate_basis_for_point(const float parameter,
}
}
+ /* Shrink the range of calculated values to avoid storing unecessary zeros. */
while (basis_buffer[start] == 0.0f && start < end) {
start++;
}
@@ -334,6 +335,8 @@ void NURBSpline::calculate_basis_cache() const
MutableSpan<BasisCache> basis_cache = this->weight_cache_;
+ /* This buffer is reused by each basis calculation to store temporary values.
+ * Theoretically it could likely be optimized away in the future. */
Array<float> basis_buffer(this->knots_size());
const float start = knots[order - 1];
More information about the Bf-blender-cvs
mailing list