mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-19 21:12:08 +02:00
format
This commit is contained in:
@@ -16,21 +16,21 @@ module dis_connected_klein_bottle(radius1, radius2, bottom_height, thickness, t_
|
|||||||
|
|
||||||
module bottom() {
|
module bottom() {
|
||||||
rotate(180)
|
rotate(180)
|
||||||
rotate_extrude() {
|
rotate_extrude() {
|
||||||
ph1 = arc_path(radius = radius2, angle = [180, 360]);
|
ph1 = arc_path(radius = radius2, angle = [180, 360]);
|
||||||
ph2 = bezier_curve(t_step, [
|
ph2 = bezier_curve(t_step, [
|
||||||
[radius1 + radius2 * 2, 0, 0],
|
[radius1 + radius2 * 2, 0, 0],
|
||||||
[radius1 + radius2 * 2, bottom_height * 0.25, 0],
|
[radius1 + radius2 * 2, bottom_height * 0.25, 0],
|
||||||
[radius1 + radius2 * 0.5, bottom_height * 0.5, 0],
|
[radius1 + radius2 * 0.5, bottom_height * 0.5, 0],
|
||||||
[radius1, bottom_height * 0.75, 0],
|
[radius1, bottom_height * 0.75, 0],
|
||||||
[radius1, bottom_height * 1.015, 0]
|
[radius1, bottom_height * 1.015, 0]
|
||||||
]);
|
]);
|
||||||
|
|
||||||
path = concat([for(p = ph1) p + [radius1 + radius2, 0, 0]], ph2);
|
path = concat([for(p = ph1) p + [radius1 + radius2, 0, 0]], ph2);
|
||||||
|
|
||||||
polyline_join(path)
|
polyline_join(path)
|
||||||
circle(half_thickness);
|
circle(half_thickness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module tube() {
|
module tube() {
|
||||||
@@ -75,17 +75,17 @@ module dis_connected_klein_bottle(radius1, radius2, bottom_height, thickness, t_
|
|||||||
bottom();
|
bottom();
|
||||||
|
|
||||||
rotate(-90)
|
rotate(-90)
|
||||||
path_extrude(
|
path_extrude(
|
||||||
shape_circle(radius1 + half_thickness),
|
shape_circle(radius1 + half_thickness),
|
||||||
tube_path
|
tube_path
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
rotate(-90)
|
rotate(-90)
|
||||||
path_extrude(
|
path_extrude(
|
||||||
shape_circle(radius1 - half_thickness),
|
shape_circle(radius1 - half_thickness),
|
||||||
tube_path2
|
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) {
|
module trefoil_klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn) {
|
||||||
rotate(90)
|
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
|
translate([0, -26.9, 151.35]) // try-and-error
|
||||||
rotate([-120, 0, 0])
|
rotate([-120, 0, 0])
|
||||||
rotate(90)
|
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
|
translate([0, 117.59, 98.975]) // try-and-error
|
||||||
rotate([120, 0, 0])
|
rotate([120, 0, 0])
|
||||||
rotate(90)
|
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) {
|
module trefoil_cutted_klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn) {
|
||||||
|
@@ -11,18 +11,18 @@ twisted_ring(
|
|||||||
);
|
);
|
||||||
|
|
||||||
translate([95, 0])
|
translate([95, 0])
|
||||||
twisted_ring(
|
twisted_ring(
|
||||||
[for(p = shape_liquid_splitting(radius = 5, centre_dist = 25)) [p[0], p[1] + 10]],
|
[for(p = shape_liquid_splitting(radius = 5, centre_dist = 25)) [p[0], p[1] + 10]],
|
||||||
r = 25,
|
r = 25,
|
||||||
shape_turns = 3
|
shape_turns = 3
|
||||||
);
|
);
|
||||||
|
|
||||||
translate([-110, 0])
|
translate([-110, 0])
|
||||||
twisted_ring(
|
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]],
|
[[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,
|
r = 30,
|
||||||
shape_turns = 3
|
shape_turns = 3
|
||||||
);
|
);
|
||||||
|
|
||||||
module twisted_ring(shape, r, shape_turns) {
|
module twisted_ring(shape, r, shape_turns) {
|
||||||
t = 360 * shape_turns;
|
t = 360 * shape_turns;
|
||||||
|
@@ -106,39 +106,39 @@ module walk_torus83_fort(radius, thickness, height) {
|
|||||||
half_leng2 = leng2 / 2;
|
half_leng2 = leng2 / 2;
|
||||||
|
|
||||||
rotate([90, 0, 0])
|
rotate([90, 0, 0])
|
||||||
linear_extrude(thickness, center = true) {
|
linear_extrude(thickness, center = true) {
|
||||||
// walkway with doors
|
// walkway with doors
|
||||||
difference() {
|
difference() {
|
||||||
hull() {
|
hull() {
|
||||||
translate([half_leng, 0, 0])
|
translate([half_leng, 0, 0])
|
||||||
square([leng, height], center = true);
|
square([leng, height], center = true);
|
||||||
translate([-half_leng, -half_h])
|
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])
|
|
||||||
polygon(tri_points);
|
polygon(tri_points);
|
||||||
translate([-height, -half_h])
|
}
|
||||||
stairs(height, stair_number);
|
|
||||||
|
translate([-leng / 2.125, 0])
|
||||||
walk_bottom_leng = 2 * leng - height * 2 - half_leng;
|
door_df();
|
||||||
translate([-walk_bottom_leng - height, -half_h])
|
|
||||||
square([walk_bottom_leng, height / stair_number]);
|
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) {
|
module one_burst(leng, thickness, height, stair_number) {
|
||||||
|
@@ -25,8 +25,8 @@ module wormhole(length, width, depth, thickness, hole_r) {
|
|||||||
difference() {
|
difference() {
|
||||||
rotate([90, 0, 0])
|
rotate([90, 0, 0])
|
||||||
linear_extrude(width, center = true)
|
linear_extrude(width, center = true)
|
||||||
polyline_join(plane)
|
polyline_join(plane)
|
||||||
square(thickness, center = true);
|
square(thickness, center = true);
|
||||||
|
|
||||||
translate([(length - r1) / 2, 0])
|
translate([(length - r1) / 2, 0])
|
||||||
linear_extrude(depth + thickness * 2, center = true)
|
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])
|
translate([(length - r1) / 2, 0, r1 - r2])
|
||||||
rotate_extrude()
|
rotate_extrude()
|
||||||
translate([r2 + half_thickness + hole_r, 0])
|
translate([r2 + half_thickness + hole_r, 0])
|
||||||
polyline_join(hole_profile)
|
polyline_join(hole_profile)
|
||||||
square(thickness, center = true);
|
square(thickness, center = true);
|
||||||
}
|
}
|
||||||
|
|
||||||
hole();
|
hole();
|
||||||
|
Reference in New Issue
Block a user