1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-20 13:31:30 +02:00

fix wrong angs

This commit is contained in:
Justin Lin
2019-06-17 08:18:40 +08:00
parent 9182575ff2
commit bb8604e42b

View File

@@ -115,7 +115,7 @@ module along_with(points, angles, twist = 0, scale = 1.0, method = "AXIS_ANGLE")
// >>> begin: modules and functions for "EULER-ANGLE" // >>> begin: modules and functions for "EULER-ANGLE"
function _euler_angle_path_angles(pts, end_i) = function _euler_angle_path_angles(pts, end_i) =
[for(i = 0; i < end_i; i = i + 1) [__angy_angz(pts[i], pts[i + 1])]]; [for(i = 0; i < end_i; i = i + 1) __angy_angz(pts[i], pts[i + 1])];
function euler_angle_path_angles(children) = function euler_angle_path_angles(children) =
let( let(
@@ -135,7 +135,6 @@ module along_with(points, angles, twist = 0, scale = 1.0, method = "AXIS_ANGLE")
rotate(twist_step_a * i) rotate(twist_step_a * i)
scale([1, 1, 1] + scale_step_vt * i) scale([1, 1, 1] + scale_step_vt * i)
children(0); children(0);
test_along_with_angles(angs);
} }
// <<< end: modules and functions for "EULER-ANGLE" // <<< end: modules and functions for "EULER-ANGLE"
@@ -178,21 +177,20 @@ module along_with(points, angles, twist = 0, scale = 1.0, method = "AXIS_ANGLE")
} }
} }
else if(method == "EULER_ANGLE") { else if(method == "EULER_ANGLE") {
angs = angles_defined ? angles : euler_angle_path_angles($children);
if($children == 1) { if($children == 1) {
angs = angles_defined ? angles : euler_angle_path_angles($children);
for(i = [0:leng_points_minus_one]) { for(i = [0:leng_points_minus_one]) {
euler_angle_align(i, angs) children(0); euler_angle_align(i, angs) children(0);
} }
} else { } else {
for(i = [0:min(leng_points, $children) - 1]) { for(i = [0:min(leng_points, $children) - 1]) {
euler_angle_align(i, angs) children(i); euler_angle_align(i, angs) children(i);
} }
}
}
test_along_with_angles(angs);
} }
} }
module test_along_with_angles(angles) { module test_along_with_angles(angles) {