mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-11 01:04:07 +02:00
fix rotation bug
This commit is contained in:
@@ -74,7 +74,6 @@ Puts children along the given path. If there's only one child, it will put the c
|
|||||||
circle(1.25, $fn = 24);
|
circle(1.25, $fn = 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
rotate([90, 0, 0])
|
|
||||||
for(a = [0:30:330]) {
|
for(a = [0:30:330]) {
|
||||||
rotate(a)
|
rotate(a)
|
||||||
translate([5, 0, 0])
|
translate([5, 0, 0])
|
||||||
|
@@ -42,7 +42,6 @@ module hilbert_dragon() {
|
|||||||
one_body_scale_data = one_body_scale(body_r, body_fn, scale_fn, scale_tilt_a);
|
one_body_scale_data = one_body_scale(body_r, body_fn, scale_fn, scale_tilt_a);
|
||||||
|
|
||||||
along_with(dragon_body_path, scale = [0.425, 0.6, 0.425])
|
along_with(dragon_body_path, scale = [0.425, 0.6, 0.425])
|
||||||
rotate([90, 0, 0])
|
|
||||||
scale(0.035)
|
scale(0.035)
|
||||||
one_segment(body_r, body_fn, one_body_scale_data);
|
one_segment(body_r, body_fn, one_body_scale_data);
|
||||||
|
|
||||||
|
@@ -129,7 +129,7 @@ module infinity_dragon() {
|
|||||||
one_body_scale_data = one_body_scale(body_r, body_fn, scale_fn, scale_tilt_a);
|
one_body_scale_data = one_body_scale(body_r, body_fn, scale_fn, scale_tilt_a);
|
||||||
|
|
||||||
along_with(body_path, scale = [0.45, 0.7, 0.45])
|
along_with(body_path, scale = [0.45, 0.7, 0.45])
|
||||||
rotate([90, 90, 0])
|
rotate([0, 0, -90])
|
||||||
one_segment(body_r, body_fn, one_body_scale_data);
|
one_segment(body_r, body_fn, one_body_scale_data);
|
||||||
|
|
||||||
ayz = __angy_angz(body_path[leng_body_path - 2], body_path[leng_body_path - 1]);
|
ayz = __angy_angz(body_path[leng_body_path - 2], body_path[leng_body_path - 1]);
|
||||||
|
@@ -82,8 +82,7 @@ module along_with(points, angles, twist = 0, scale = 1.0, method = "AXIS_ANGLE")
|
|||||||
|
|
||||||
module axis_angle_align_with_pts_angles(i) {
|
module axis_angle_align_with_pts_angles(i) {
|
||||||
translate(pts[i])
|
translate(pts[i])
|
||||||
rotate(angles[i])
|
rotate(twist_step_a * i + angles[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);
|
||||||
}
|
}
|
||||||
@@ -127,13 +126,21 @@ module along_with(points, angles, twist = 0, scale = 1.0, method = "AXIS_ANGLE")
|
|||||||
];
|
];
|
||||||
|
|
||||||
module euler_angle_align(i, angs) {
|
module euler_angle_align(i, angs) {
|
||||||
|
if(angles_defined) {
|
||||||
|
translate(pts[i])
|
||||||
|
rotate(twist_step_a * i + angs[i])
|
||||||
|
scale([1, 1, 1] + scale_step_vt * i)
|
||||||
|
children(0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
translate(pts[i])
|
translate(pts[i])
|
||||||
rotate(angs[i])
|
rotate(angs[i])
|
||||||
rotate(angles_defined ? [0, 0, 0] : [90, 0, -90])
|
rotate([90, 0, -90])
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// <<< end: modules and functions for "EULER-ANGLE"
|
// <<< end: modules and functions for "EULER-ANGLE"
|
||||||
|
|
||||||
@@ -157,18 +164,21 @@ module along_with(points, angles, twist = 0, scale = 1.0, method = "AXIS_ANGLE")
|
|||||||
|
|
||||||
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, [1, 1, 1], cumu_rot_matrice)
|
||||||
|
rotate([90, 0, 0])
|
||||||
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, [1, 1, 1] + scale_step_vt * i, cumu_rot_matrice)
|
||||||
|
rotate([90, 0, 0])
|
||||||
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, [1, 1, 1] + scale_step_vt * i, cumu_rot_matrice)
|
||||||
|
rotate([90, 0, 0])
|
||||||
children(i + 1);
|
children(i + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user