Add a door module

Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
This commit is contained in:
Jacob Kiers 2022-01-08 01:28:55 +01:00
parent 49d1c65af6
commit 60f7c8e24f
2 changed files with 64 additions and 1 deletions

58
house/door.scad Normal file
View File

@ -0,0 +1,58 @@
// Builds a door with default measurements
// Usage: door(open_rotation = 45)
// The open_rotation parameter rotates the door in the z-plane.
module door(open_rotation = 45) {
frame_depth = 65;
frame_outer_list_width = 45;
frame_outer_receded_width = 15;
door_width = 775;
door_depth = 50;
door_height = 2100;
door_to_ground = 15;
door_to_frame = 3;
door_outline();
//door_list_receded();
door_door();
module door_outline()
{
difference() {
cube([
door_width + 2 * door_to_frame + 2 * (frame_outer_list_width + frame_outer_receded_width),
door_depth + 2 * frame_depth,
door_to_ground + door_height + door_to_frame + frame_depth
]);
translate([frame_outer_list_width, 0, 0]) door_list_receded();
}
}
module door_list_receded()
{
difference() {
color("yellow") cube([
door_width + 2 * door_to_frame + 2 * frame_outer_receded_width,
door_depth + 2 * frame_depth,
door_to_ground + door_height + door_to_frame
]);
}
}
module door_door()
{
translate([
frame_depth + door_to_frame,
frame_depth,
door_to_ground
])
rotate([0, 0, open_rotation])
cube([
door_width,
door_depth,
door_height
]);
}
}

View File

@ -1,3 +1,6 @@
// Includes
include <door.scad>
// All measurements are in millimeters.
// Dimensions
@ -153,4 +156,6 @@ module rectangle(start = [0, 0, 0], dimensions = [0, 0, 0], color)
cube([dx, dy, dz]);
translate([1,1,1]) cube([dx-2, dy-2, dz]);
}
}
}
color("white") door();