1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-05 14:27:45 +02:00
This commit is contained in:
Justin Lin
2021-06-05 13:17:42 +08:00
parent b8dbe53756
commit 34b49281c8

View File

@@ -1,17 +1,17 @@
function sf_splines(ctrl_pts, rspline, cspline) = function sf_splines(ctrl_pts, row_spline, column_spline) =
let( let(
leng_ctrl_pts = len(ctrl_pts), leng_ctrl_pts = len(ctrl_pts),
cspl = is_undef(cspline) ? rspline : cspline, cspline = is_undef(column_spline) ? row_spline : column_spline,
r_pts = [ r_pts = [
for(r = 0; r < leng_ctrl_pts; r = r + 1) for(r = 0; r < leng_ctrl_pts; r = r + 1)
rspline(ctrl_pts[r]) row_spline(ctrl_pts[r])
], ],
leng_r_pts0 = len(r_pts[0]), leng_r_pts0 = len(r_pts[0]),
leng_r_pts = len(r_pts) leng_r_pts = len(r_pts)
) )
[ [
for(c = 0; c < leng_r_pts0; c = c + 1) for(c = 0; c < leng_r_pts0; c = c + 1)
cspl([for(r = 0; r < leng_r_pts; r = r + 1) r_pts[r][c]]) cspline([for(r = 0; r < leng_r_pts; r = r + 1) r_pts[r][c]])
]; ];
/* /*
@@ -30,10 +30,10 @@ thickness = 2;
t_step = 0.05; t_step = 0.05;
degrees = 2; degrees = 2;
rspline = function(points) bspline_curve(t_step, degrees, points); row_spline = function(points) bspline_curve(t_step, degrees, points);
cspline = function(points) bspline_curve(t_step, degrees, points); column_spline = function(points) bspline_curve(t_step, degrees, points);
function_grapher(sf_splines(ctrl_pts, rspline, cspline), thickness); function_grapher(sf_splines(ctrl_pts, row_spline, column_spline), thickness);
*/ */
/* /*
@@ -52,10 +52,10 @@ ctrl_pts = [
thickness = 2; thickness = 2;
t_step = 0.05; t_step = 0.05;
rspline = function(points) bezier_curve(t_step, points); row_spline = function(points) bezier_curve(t_step, points);
cspline = function(points) bezier_curve(t_step, points); column_spline = function(points) bezier_curve(t_step, points);
function_grapher(sf_splines(ctrl_pts, rspline, cspline), thickness); function_grapher(sf_splines(ctrl_pts, row_spline, column_spline), thickness);
*/ */
@@ -77,10 +77,10 @@ ctrl_pts = [
thickness = 2; thickness = 2;
t_step = 0.05; t_step = 0.05;
rspline = function(points) curve(t_step, points); row_spline = function(points) curve(t_step, points);
cspline = function(points) curve(t_step, points); column_spline = function(points) curve(t_step, points);
function_grapher(sf_splines(ctrl_pts, rspline, cspline), thickness); function_grapher(sf_splines(ctrl_pts, row_spline, column_spline), thickness);
for(i = [0:3]) { for(i = [0:3]) {
%hull_polyline3d(ctrl_pts[i]); %hull_polyline3d(ctrl_pts[i]);