mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-11 09:14:29 +02:00
rename
This commit is contained in:
@@ -12,12 +12,12 @@ function _combi(n, k) =
|
|||||||
n < 4 ? bi_coef[n][k] :
|
n < 4 ? bi_coef[n][k] :
|
||||||
k == 0 ? 1 : (_combi(n, k - 1) * (n - k + 1) / k);
|
k == 0 ? 1 : (_combi(n, k - 1) * (n - k + 1) / k);
|
||||||
|
|
||||||
function bezier_curve_coordinate(t, pn, n, i) =
|
function bezier_curve_component(t, points, n, i) =
|
||||||
let(one_t = 1 - t)
|
let(one_t = 1 - t)
|
||||||
sum([for(j = [0:n]) _combi(n, j) * pn[j][i] * one_t ^ (n - j) * t ^ j]);
|
sum([for(j = [0:n]) _combi(n, j) * points[j][i] * one_t ^ (n - j) * t ^ j]);
|
||||||
|
|
||||||
function _bezier_curve(range, t, points, n) =
|
function _bezier_curve_coordinate(range, t, points, n) =
|
||||||
[for(i = range) bezier_curve_coordinate(t, points, n, i)];
|
[for(i = range) bezier_curve_component(t, points, n, i)];
|
||||||
|
|
||||||
function _bezier_curve_impl(t_step, points) =
|
function _bezier_curve_impl(t_step, points) =
|
||||||
let(
|
let(
|
||||||
@@ -26,6 +26,6 @@ function _bezier_curve_impl(t_step, points) =
|
|||||||
range = [0:len(points[0]) - 1]
|
range = [0:len(points[0]) - 1]
|
||||||
)
|
)
|
||||||
[
|
[
|
||||||
each [for(t = 0; t < t_end; t = t + 1) _bezier_curve(range, t * t_step, points, n)],
|
each [for(t = 0; t < t_end; t = t + 1) _bezier_curve_coordinate(range, t * t_step, points, n)],
|
||||||
_bezier_curve(range, 1, points, n)
|
_bezier_curve_coordinate(range, 1, points, n)
|
||||||
];
|
];
|
||||||
|
Reference in New Issue
Block a user