mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-07-31 20:10:36 +02:00
refactor
This commit is contained in:
@@ -12,6 +12,7 @@ module floor_stand(width, height, thickness, joint_spacing) {
|
|||||||
];
|
];
|
||||||
|
|
||||||
module board_base() {
|
module board_base() {
|
||||||
|
translate([0, -half_h, 0])
|
||||||
difference() {
|
difference() {
|
||||||
polygon(points);
|
polygon(points);
|
||||||
translate([0, -half_h, 0])
|
translate([0, -half_h, 0])
|
||||||
@@ -20,12 +21,12 @@ module floor_stand(width, height, thickness, joint_spacing) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module joint_tops(dist) {
|
||||||
module joint_top() {
|
module joint_top() {
|
||||||
linear_extrude(thickness / 4 + half_sc, scale = 0.1)
|
linear_extrude(thickness / 4 + half_sc, scale = 0.1)
|
||||||
circle(thickness / 4 + half_sc);
|
circle(thickness / 4 + half_sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
module joint_tops(dist) {
|
|
||||||
half_d = dist / 2;
|
half_d = dist / 2;
|
||||||
translate([-half_d, 0, 0])
|
translate([-half_d, 0, 0])
|
||||||
rotate([0, -90, 0])
|
rotate([0, -90, 0])
|
||||||
@@ -36,31 +37,11 @@ module floor_stand(width, height, thickness, joint_spacing) {
|
|||||||
joint_top();
|
joint_top();
|
||||||
}
|
}
|
||||||
|
|
||||||
module stick() {
|
|
||||||
linear_extrude(thickness * 0.75)
|
|
||||||
square([width / 12, half_w], center = true);
|
|
||||||
}
|
|
||||||
|
|
||||||
module slot_df() {
|
|
||||||
translate([0, -half_h - thickness, -half_th])
|
|
||||||
stick();
|
|
||||||
}
|
|
||||||
|
|
||||||
module border() {
|
|
||||||
translate([0, 0, half_th])
|
|
||||||
color("black") linear_extrude(half_th / 2)
|
|
||||||
hollow_out(shell_thickness = font_size / 4)
|
|
||||||
offset(half_w / 10)
|
|
||||||
scale([0.75, 0.675])
|
|
||||||
polygon(points);
|
|
||||||
}
|
|
||||||
|
|
||||||
module board1() {
|
module board1() {
|
||||||
difference() {
|
difference() {
|
||||||
union() {
|
union() {
|
||||||
linear_extrude(thickness, center = true)
|
linear_extrude(thickness, center = true)
|
||||||
difference() {
|
difference() {
|
||||||
translate([0, -half_h, 0])
|
|
||||||
board_base();
|
board_base();
|
||||||
square([width / 1.5, height / 3], center = true);
|
square([width / 1.5, height / 3], center = true);
|
||||||
}
|
}
|
||||||
@@ -74,18 +55,13 @@ module floor_stand(width, height, thickness, joint_spacing) {
|
|||||||
circle(thickness, $fn = 24);
|
circle(thickness, $fn = 24);
|
||||||
|
|
||||||
joint_tops(half_w / 1.5 * 2);
|
joint_tops(half_w / 1.5 * 2);
|
||||||
|
|
||||||
slot_df();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module board2() {
|
module board2() {
|
||||||
difference() {
|
|
||||||
union() {
|
|
||||||
linear_extrude(thickness, center = true)
|
linear_extrude(thickness, center = true)
|
||||||
union() {
|
union() {
|
||||||
difference() {
|
difference() {
|
||||||
translate([0, -half_h, 0])
|
|
||||||
board_base();
|
board_base();
|
||||||
square([width, height / 3], center = true);
|
square([width, height / 3], center = true);
|
||||||
}
|
}
|
||||||
@@ -103,36 +79,50 @@ module floor_stand(width, height, thickness, joint_spacing) {
|
|||||||
joint_tops(half_w / 1.5 * 2 - joint_spacing);
|
joint_tops(half_w / 1.5 * 2 - joint_spacing);
|
||||||
}
|
}
|
||||||
|
|
||||||
slot_df();
|
module border() {
|
||||||
}
|
translate([0, 0, half_th])
|
||||||
|
color("black") linear_extrude(half_th / 2)
|
||||||
|
hollow_out(shell_thickness = font_size / 4)
|
||||||
|
offset(half_w / 10)
|
||||||
|
scale([0.75, 0.675])
|
||||||
|
polygon(points);
|
||||||
|
}
|
||||||
|
|
||||||
|
module stick() {
|
||||||
|
linear_extrude(thickness * 0.75)
|
||||||
|
square([width / 12, half_w], center = true);
|
||||||
|
}
|
||||||
|
|
||||||
|
module decorate_board() {
|
||||||
|
rotate([-80, 0, 0])
|
||||||
|
difference() {
|
||||||
|
rotate([80, 0, 0])
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
color("yellow") children();
|
||||||
|
translate([0, -height / 1.8, 0])
|
||||||
|
border();
|
||||||
|
}
|
||||||
|
// slot
|
||||||
|
translate([0, -half_h - thickness, -half_th])
|
||||||
|
stick();
|
||||||
}
|
}
|
||||||
|
|
||||||
module ground_df() {
|
|
||||||
translate([0, 0, -height - half_th])
|
translate([0, 0, -height - half_th])
|
||||||
linear_extrude(thickness)
|
linear_extrude(thickness)
|
||||||
square(width, center = true);
|
square(width, center = true);
|
||||||
}
|
}
|
||||||
|
|
||||||
module carve_board() {
|
|
||||||
rotate([-80, 0, 0])
|
|
||||||
difference() {
|
|
||||||
rotate([80, 0, 0]) union() {
|
|
||||||
color("yellow") children();
|
|
||||||
translate([0, -height / 1.8, 0]) border();
|
|
||||||
}
|
|
||||||
ground_df();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// stick
|
// stick
|
||||||
translate([width, 0, 0])
|
translate([width, 0, 0])
|
||||||
stick();
|
stick();
|
||||||
|
|
||||||
translate([0, 0, thickness / 2])
|
translate([0, 0, half_th])
|
||||||
carve_board() board1();
|
decorate_board() board1();
|
||||||
|
|
||||||
translate([0, 0, thickness / 2])
|
translate([0, 0, half_th])
|
||||||
rotate(180)
|
rotate(180)
|
||||||
carve_board() board2();
|
decorate_board() board2();
|
||||||
|
|
||||||
children();
|
children();
|
||||||
rotate(180)
|
rotate(180)
|
||||||
|
Reference in New Issue
Block a user