1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-19 13:01:37 +02:00
This commit is contained in:
Justin Lin
2022-04-01 13:58:01 +08:00
parent bb9c630e20
commit 356966b8f6
4 changed files with 71 additions and 71 deletions

View File

@@ -16,21 +16,21 @@ module dis_connected_klein_bottle(radius1, radius2, bottom_height, thickness, t_
module bottom() {
rotate(180)
rotate_extrude() {
ph1 = arc_path(radius = radius2, angle = [180, 360]);
ph2 = bezier_curve(t_step, [
[radius1 + radius2 * 2, 0, 0],
[radius1 + radius2 * 2, bottom_height * 0.25, 0],
[radius1 + radius2 * 0.5, bottom_height * 0.5, 0],
[radius1, bottom_height * 0.75, 0],
[radius1, bottom_height * 1.015, 0]
]);
path = concat([for(p = ph1) p + [radius1 + radius2, 0, 0]], ph2);
polyline_join(path)
circle(half_thickness);
}
rotate_extrude() {
ph1 = arc_path(radius = radius2, angle = [180, 360]);
ph2 = bezier_curve(t_step, [
[radius1 + radius2 * 2, 0, 0],
[radius1 + radius2 * 2, bottom_height * 0.25, 0],
[radius1 + radius2 * 0.5, bottom_height * 0.5, 0],
[radius1, bottom_height * 0.75, 0],
[radius1, bottom_height * 1.015, 0]
]);
path = concat([for(p = ph1) p + [radius1 + radius2, 0, 0]], ph2);
polyline_join(path)
circle(half_thickness);
}
}
module tube() {
@@ -75,17 +75,17 @@ module dis_connected_klein_bottle(radius1, radius2, bottom_height, thickness, t_
bottom();
rotate(-90)
path_extrude(
shape_circle(radius1 + half_thickness),
tube_path
);
path_extrude(
shape_circle(radius1 + half_thickness),
tube_path
);
}
rotate(-90)
path_extrude(
shape_circle(radius1 - half_thickness),
tube_path2
);
path_extrude(
shape_circle(radius1 - half_thickness),
tube_path2
);
}
}
@@ -94,17 +94,17 @@ module dis_connected_klein_bottle(radius1, radius2, bottom_height, thickness, t_
module trefoil_klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn) {
rotate(90)
dis_connected_klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn);
dis_connected_klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn);
translate([0, -26.9, 151.35]) // try-and-error
rotate([-120, 0, 0])
rotate(90)
dis_connected_klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn);
dis_connected_klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn);
translate([0, 117.59, 98.975]) // try-and-error
rotate([120, 0, 0])
rotate(90)
dis_connected_klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn);
dis_connected_klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn);
}
module trefoil_cutted_klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn) {

View File

@@ -11,18 +11,18 @@ twisted_ring(
);
translate([95, 0])
twisted_ring(
[for(p = shape_liquid_splitting(radius = 5, centre_dist = 25)) [p[0], p[1] + 10]],
r = 25,
shape_turns = 3
);
twisted_ring(
[for(p = shape_liquid_splitting(radius = 5, centre_dist = 25)) [p[0], p[1] + 10]],
r = 25,
shape_turns = 3
);
translate([-110, 0])
twisted_ring(
[[17.5, 10], [17.5, 20], [12.5, 20], [12.5, 15], [7.5, 15], [7.5, 20], [2.5, 20], [2.5, 15], [-2.5, 15], [-2.5, 20], [-7.5, 20], [-7.5, 15], [-12.5, 15], [-12.5, 20], [-17.5, 20], [-17.5, 10]],
r = 30,
shape_turns = 3
);
twisted_ring(
[[17.5, 10], [17.5, 20], [12.5, 20], [12.5, 15], [7.5, 15], [7.5, 20], [2.5, 20], [2.5, 15], [-2.5, 15], [-2.5, 20], [-7.5, 20], [-7.5, 15], [-12.5, 15], [-12.5, 20], [-17.5, 20], [-17.5, 10]],
r = 30,
shape_turns = 3
);
module twisted_ring(shape, r, shape_turns) {
t = 360 * shape_turns;

View File

@@ -106,39 +106,39 @@ module walk_torus83_fort(radius, thickness, height) {
half_leng2 = leng2 / 2;
rotate([90, 0, 0])
linear_extrude(thickness, center = true) {
// walkway with doors
difference() {
hull() {
translate([half_leng, 0, 0])
square([leng, height], center = true);
translate([-half_leng, -half_h])
polygon(tri_points);
}
translate([-leng / 2.125, 0])
door_df();
half_door_df();
}
translate([-half_leng - height, -half_h])
stairs(height, stair_number);
// walkway without doors
translate([-leng * 2, 0])
rotate([180, 0, 180]) {
translate([half_leng2, 0])
square([leng2, height], center = true);
translate([0, -half_h])
linear_extrude(thickness, center = true) {
// walkway with doors
difference() {
hull() {
translate([half_leng, 0, 0])
square([leng, height], center = true);
translate([-half_leng, -half_h])
polygon(tri_points);
translate([-height, -half_h])
stairs(height, stair_number);
walk_bottom_leng = 2 * leng - height * 2 - half_leng;
translate([-walk_bottom_leng - height, -half_h])
square([walk_bottom_leng, height / stair_number]);
}
}
translate([-leng / 2.125, 0])
door_df();
half_door_df();
}
translate([-half_leng - height, -half_h])
stairs(height, stair_number);
// walkway without doors
translate([-leng * 2, 0])
rotate([180, 0, 180]) {
translate([half_leng2, 0])
square([leng2, height], center = true);
translate([0, -half_h])
polygon(tri_points);
translate([-height, -half_h])
stairs(height, stair_number);
walk_bottom_leng = 2 * leng - height * 2 - half_leng;
translate([-walk_bottom_leng - height, -half_h])
square([walk_bottom_leng, height / stair_number]);
}
}
}
module one_burst(leng, thickness, height, stair_number) {

View File

@@ -25,8 +25,8 @@ module wormhole(length, width, depth, thickness, hole_r) {
difference() {
rotate([90, 0, 0])
linear_extrude(width, center = true)
polyline_join(plane)
square(thickness, center = true);
polyline_join(plane)
square(thickness, center = true);
translate([(length - r1) / 2, 0])
linear_extrude(depth + thickness * 2, center = true)
@@ -43,8 +43,8 @@ module wormhole(length, width, depth, thickness, hole_r) {
translate([(length - r1) / 2, 0, r1 - r2])
rotate_extrude()
translate([r2 + half_thickness + hole_r, 0])
polyline_join(hole_profile)
square(thickness, center = true);
polyline_join(hole_profile)
square(thickness, center = true);
}
hole();