1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-21 14:04:53 +02:00

refactor: naming value

This commit is contained in:
Justin Lin
2022-03-30 17:02:17 +08:00
parent 9f189e1124
commit 8e5255fdc9

View File

@@ -76,12 +76,14 @@ module along_with(points, angles, twist = 0, scale = 1.0, method = "AXIS_ANGLE")
) )
[each matrice, curr_matrix * prev_matrix]; [each matrice, curr_matrix * prev_matrix];
scale_one = [1, 1, 1];
// align modules // align modules
module axis_angle_align_with_pts_angles(i) { module axis_angle_align_with_pts_angles(i) {
translate(pts[i]) translate(pts[i])
rotate(twist_step_a * i + angles[i]) rotate(twist_step_a * i + angles[i])
scale([1, 1, 1] + scale_step_vt * i) scale(scale_one + scale_step_vt * i)
children(0); children(0);
} }
@@ -128,7 +130,7 @@ module along_with(points, angles, twist = 0, scale = 1.0, method = "AXIS_ANGLE")
rotate(angs[i]) rotate(angs[i])
rotate(look_at) rotate(look_at)
rotate(twist_step_a * i) rotate(twist_step_a * i)
scale([1, 1, 1] + scale_step_vt * i) scale(scale_one + scale_step_vt * i)
children(0); children(0);
} }
@@ -154,23 +156,25 @@ module along_with(points, angles, twist = 0, scale = 1.0, method = "AXIS_ANGLE")
m_rotation(ang_vect[0], ang_vect[1]) m_rotation(ang_vect[0], ang_vect[1])
]); ]);
x_90 = [90, 0, 0];
translate(pts[0]) translate(pts[0])
axis_angle_align_with_local_rotate(0, 0, [1, 1, 1], cumu_rot_matrice) axis_angle_align_with_local_rotate(0, 0, scale_one, cumu_rot_matrice)
rotate([90, 0, 0]) rotate(x_90)
children(0); children(0);
if($children == 1) { if($children == 1) {
for(i = [0:leng_points - 2]) { for(i = [0:leng_points - 2]) {
translate(pts[i + 1]) translate(pts[i + 1])
axis_angle_align_with_local_rotate(i, i * twist_step_a, [1, 1, 1] + scale_step_vt * i, cumu_rot_matrice) axis_angle_align_with_local_rotate(i, i * twist_step_a, scale_one + scale_step_vt * i, cumu_rot_matrice)
rotate([90, 0, 0]) rotatex_90)
children(0); children(0);
} }
} else { } else {
for(i = [0:min(leng_points, $children) - 2]) { for(i = [0:min(leng_points, $children) - 2]) {
translate(pts[i + 1]) translate(pts[i + 1])
axis_angle_align_with_local_rotate(i, i * twist_step_a, [1, 1, 1] + scale_step_vt * i, cumu_rot_matrice) axis_angle_align_with_local_rotate(i, i * twist_step_a, scale_one + scale_step_vt * i, cumu_rot_matrice)
rotate([90, 0, 0]) rotate(x_90)
children(i + 1); children(i + 1);
} }
} }