1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-05 22:37:35 +02:00

rename var

This commit is contained in:
Justin Lin
2022-07-19 17:19:56 +08:00
parent a51a8f2bd4
commit 6d0eb7de03

View File

@@ -4,14 +4,14 @@ use <matrix/m_transpose.scad>
use <util/sum.scad> use <util/sum.scad>
size = [100, 50, 120]; size = [100, 50, 120];
panel_thickness = 1.5; shelf_thickness = 1.5;
draw_thickness = 1.25; draw_thickness = 1.25;
drawer_numbers = 3; drawer_numbers = 3;
spacing = 0.6; spacing = 0.6;
curved_cabinet(size, panel_thickness, draw_thickness, drawer_numbers, spacing); curved_cabinet(size, shelf_thickness, draw_thickness, drawer_numbers, spacing);
module curved_cabinet(size, panel_thickness, draw_thickness, drawer_numbers, spacing) { module curved_cabinet(size, shelf_thickness, draw_thickness, drawer_numbers, spacing) {
p0 = [size.x * 0.5, size.y * 0.5, 0]; p0 = [size.x * 0.5, size.y * 0.5, 0];
p1 = [size.x * 0.75, size.y * 0.5, size.z * 0.25]; p1 = [size.x * 0.75, size.y * 0.5, size.z * 0.25];
p2 = [size.x * 0.5, size.y * 0.5, size.z * 0.5]; p2 = [size.x * 0.5, size.y * 0.5, size.z * 0.5];
@@ -69,28 +69,28 @@ module curved_cabinet(size, panel_thickness, draw_thickness, drawer_numbers, spa
difference() { difference() {
sweep(m_transpose([path4, path3, path2, path1])); sweep(m_transpose([path4, path3, path2, path1]));
translate([0, size.y * 0.5 - panel_thickness, 0]) translate([0, size.y * 0.5 - shelf_thickness, 0])
rotate([90, 0, 0]) rotate([90, 0, 0])
linear_extrude(size.y) linear_extrude(size.y)
for(profile = drawer_profiles) { for(profile = drawer_profiles) {
offset(-panel_thickness) offset(-shelf_thickness)
polygon(profile); polygon(profile);
} }
} }
translate([0, size.y * 0.5 - panel_thickness - spacing * 0.5, 0]) *translate([0, size.y * 0.5 - shelf_thickness - spacing * 0.5, 0])
rotate([90, 0, 0]) rotate([90, 0, 0])
for(i = [0:drawer_numbers - 1]) { for(i = [0:drawer_numbers - 1]) {
translate([0, 0, size.y * 0.9 - size.y / drawer_numbers * i]) { translate([0, 0, size.y * 0.9 - size.y / drawer_numbers * i]) {
color(rands(0, 1, 3)) color(rands(0, 1, 3))
difference() { difference() {
linear_extrude(size.y - panel_thickness - spacing * 0.5) linear_extrude(size.y - shelf_thickness - spacing * 0.5)
offset(-panel_thickness - spacing * 0.5) offset(-shelf_thickness - spacing * 0.5)
polygon(drawer_profiles[i]); polygon(drawer_profiles[i]);
translate([0, 0, draw_thickness]) translate([0, 0, draw_thickness])
linear_extrude(size.y - panel_thickness - draw_thickness * 2) linear_extrude(size.y - shelf_thickness - draw_thickness * 2)
offset(-panel_thickness - spacing * 0.5 - draw_thickness) offset(-shelf_thickness - spacing * 0.5 - draw_thickness)
polygon(drawer_profiles2[i]); polygon(drawer_profiles2[i]);
} }