Compare commits
2 Commits
60f7c8e24f
...
3be73fede2
Author | SHA1 | Date | |
---|---|---|---|
3be73fede2 | |||
517d37b91d |
@ -3,7 +3,10 @@
|
|||||||
// Usage: door(open_rotation = 45)
|
// Usage: door(open_rotation = 45)
|
||||||
// The open_rotation parameter rotates the door in the z-plane.
|
// The open_rotation parameter rotates the door in the z-plane.
|
||||||
|
|
||||||
module door(open_rotation = 45) {
|
DOOR_LEFT = "left";
|
||||||
|
DOOR_RIGHT = "right";
|
||||||
|
|
||||||
|
module door(open_rotation = 45, door_position = DOOR_LEFT) {
|
||||||
frame_depth = 65;
|
frame_depth = 65;
|
||||||
frame_outer_list_width = 45;
|
frame_outer_list_width = 45;
|
||||||
frame_outer_receded_width = 15;
|
frame_outer_receded_width = 15;
|
||||||
@ -14,17 +17,28 @@ module door(open_rotation = 45) {
|
|||||||
door_to_ground = 15;
|
door_to_ground = 15;
|
||||||
door_to_frame = 3;
|
door_to_frame = 3;
|
||||||
|
|
||||||
door_outline();
|
if (door_position == DOOR_LEFT) {
|
||||||
//door_list_receded();
|
door_outline();
|
||||||
door_door();
|
//door_list_receded();
|
||||||
|
door_door();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (door_position == DOOR_RIGHT) {
|
||||||
|
translate([full_width(), full_depth(), 0])
|
||||||
|
rotate([0, 0, 180]) {
|
||||||
|
door_outline();
|
||||||
|
//door_list_receded();
|
||||||
|
door_door();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
module door_outline()
|
module door_outline()
|
||||||
{
|
{
|
||||||
difference() {
|
difference() {
|
||||||
cube([
|
cube([
|
||||||
door_width + 2 * door_to_frame + 2 * (frame_outer_list_width + frame_outer_receded_width),
|
full_width(),
|
||||||
door_depth + 2 * frame_depth,
|
full_depth(),
|
||||||
door_to_ground + door_height + door_to_frame + frame_depth
|
full_height()
|
||||||
]);
|
]);
|
||||||
translate([frame_outer_list_width, 0, 0]) door_list_receded();
|
translate([frame_outer_list_width, 0, 0]) door_list_receded();
|
||||||
}
|
}
|
||||||
@ -43,16 +57,46 @@ module door(open_rotation = 45) {
|
|||||||
|
|
||||||
module door_door()
|
module door_door()
|
||||||
{
|
{
|
||||||
translate([
|
if (door_position == DOOR_LEFT) {
|
||||||
frame_depth + door_to_frame,
|
translate([
|
||||||
frame_depth,
|
frame_depth + door_to_frame,
|
||||||
door_to_ground
|
frame_depth,
|
||||||
])
|
door_to_ground
|
||||||
rotate([0, 0, open_rotation])
|
])
|
||||||
cube([
|
rotate([0, 0, open_rotation])
|
||||||
door_width,
|
cube([
|
||||||
door_depth,
|
door_width,
|
||||||
door_height
|
door_depth,
|
||||||
]);
|
door_height
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
if (door_position == DOOR_RIGHT) {
|
||||||
|
translate([
|
||||||
|
frame_depth + door_to_frame,
|
||||||
|
frame_depth,
|
||||||
|
door_to_ground
|
||||||
|
])
|
||||||
|
rotate([0, 0, open_rotation])
|
||||||
|
cube([
|
||||||
|
door_width,
|
||||||
|
door_depth,
|
||||||
|
door_height
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function full_width() =
|
||||||
|
door_width +
|
||||||
|
2 * door_to_frame +
|
||||||
|
2 * (frame_outer_list_width + frame_outer_receded_width);
|
||||||
|
|
||||||
|
function full_depth() =
|
||||||
|
door_depth +
|
||||||
|
2 * frame_depth;
|
||||||
|
|
||||||
|
function full_height() =
|
||||||
|
door_to_ground +
|
||||||
|
door_height +
|
||||||
|
door_to_frame +
|
||||||
|
frame_depth;
|
||||||
}
|
}
|
7
house/door_test.scad
Normal file
7
house/door_test.scad
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
include <door.scad>
|
||||||
|
|
||||||
|
distance = 1150;
|
||||||
|
|
||||||
|
door();
|
||||||
|
|
||||||
|
translate([distance, 0, 0]) door(door_position = DOOR_RIGHT);
|
@ -10,10 +10,10 @@ office_jacob_width = 3410;
|
|||||||
bedroom_length = 2060;
|
bedroom_length = 2060;
|
||||||
bedroom_width = 3410;
|
bedroom_width = 3410;
|
||||||
|
|
||||||
frame_depth = 135;
|
frame_depth = 65;
|
||||||
|
|
||||||
hall_length = 2610;
|
hall_length = 2610;
|
||||||
hall_length_extra_office_jacob = 1240;// Hall to end of office
|
hall_length_extra_office_jacob = 1040;// Hall to end of office
|
||||||
hall_length_full = hall_length + hall_length_extra_office_jacob;
|
hall_length_full = hall_length + hall_length_extra_office_jacob;
|
||||||
hall_width = 975;
|
hall_width = 975;
|
||||||
|
|
||||||
@ -139,11 +139,7 @@ rectangle(
|
|||||||
house_height
|
house_height
|
||||||
],
|
],
|
||||||
"red"
|
"red"
|
||||||
)
|
);
|
||||||
|
|
||||||
echo("House length =", house_length, ", width = ", house_width);
|
|
||||||
echo("Living diff length =", house_length - office_jacob_length - bedroom_length - livingroom_length_back);
|
|
||||||
echo(office_jacob_length, bedroom_length, livingroom_length_back);
|
|
||||||
|
|
||||||
module rectangle(start = [0, 0, 0], dimensions = [0, 0, 0], color)
|
module rectangle(start = [0, 0, 0], dimensions = [0, 0, 0], color)
|
||||||
{
|
{
|
||||||
@ -158,4 +154,43 @@ module rectangle(start = [0, 0, 0], dimensions = [0, 0, 0], color)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
color("white") door();
|
// Hallway door
|
||||||
|
translate([
|
||||||
|
kitchen_width + bathroom_width + 2* frame_depth,
|
||||||
|
livingroom_length_kitchen + 65, 0
|
||||||
|
]) color("white") door(-35);
|
||||||
|
|
||||||
|
// Bedroom door
|
||||||
|
translate([
|
||||||
|
house_width - bedroom_width - 1.5 * frame_depth,
|
||||||
|
house_length - bedroom_length - 2 * frame_depth - 150,
|
||||||
|
0
|
||||||
|
]) color("white")
|
||||||
|
rotate([0, 0, -90]) door(35);
|
||||||
|
|
||||||
|
// Office Jacob door
|
||||||
|
translate([
|
||||||
|
house_width - office_jacob_width - 1.5 * frame_depth,
|
||||||
|
house_length - hall_length_extra_office_jacob,
|
||||||
|
0
|
||||||
|
]) color("white")
|
||||||
|
rotate([0, 0, -90]) door(
|
||||||
|
open_rotation = -35,
|
||||||
|
door_position = DOOR_RIGHT
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Bathroom door
|
||||||
|
translate([
|
||||||
|
house_width - office_jacob_width - hall_width - frame_depth,
|
||||||
|
house_length - hall_to_bathroom_length - bathroom_length - frame_depth,
|
||||||
|
1
|
||||||
|
]) color("white") rotate([0, 0, 90]) door(door_position = DOOR_RIGHT);
|
||||||
|
|
||||||
|
// Main door
|
||||||
|
translate([
|
||||||
|
house_width - office_jacob_width - hall_width - 2 * frame_depth,
|
||||||
|
house_length - hall_length_extra_office_jacob - 0.5 * frame_depth,
|
||||||
|
1
|
||||||
|
]) color("green") rotate([0, 0, -90])
|
||||||
|
door();
|
Loading…
Reference in New Issue
Block a user