1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-28 00:40:39 +02:00

a uniform knot vector is enough

This commit is contained in:
Justin Lin
2019-10-12 07:45:24 +08:00
parent 3ccb725645
commit 107837bbdd

View File

@@ -43,8 +43,8 @@ module klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn) {
}
module tube() {
mid_pts = [
[0, 0, bottom_height + radius1 / 2],
[0, 0, bottom_height + radius1],
[0, 0, bottom_height + radius1 * 2],
[0, radius1, bottom_height + radius1 * 3.5],
@@ -57,34 +57,24 @@ module klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn) {
[0, radius1 * 1, bottom_height - radius1 * 2],
[0, radius1 * 0.15, bottom_height + half_thickness - radius1 * 3],
[0, 0, bottom_height - radius1 * 4],
[0, 0, bottom_height - radius1 * 5]
[0, 0, bottom_height - radius1 * 5],
[0, 0, bottom_height - radius1 * 6]
];
degree = 2;
pts_leng = 15;
knot_leng = 18;
bs_curve = bspline_curve(t_step, degree, mid_pts);
knots = concat(
[0, 0, 0],
[for(i = [1:12]) i / 13],
[2, 2, 2]
tube_path = concat(
[[0, 0, bottom_height]],
bs_curve,
[[0, 0, 0]]
);
tube_path = bspline_curve(
t_step,
degree,
concat(
concat([[0, 0, bottom_height]], mid_pts),
[[0, 0, -thickness]]
), knots);
tube_path2 = bspline_curve(
t_step,
degree,
concat(
concat([[0, 0, bottom_height - thickness]], mid_pts),
[[0, 0, -thickness * 1.5]]
), knots);
tube_path2 = concat(
[[0, 0, bottom_height - thickness]],
bs_curve,
[[0, 0, -thickness]]
);
difference() {
union() {
@@ -101,7 +91,6 @@ module klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn) {
tube_path2
);
}
}
tube();