cad/house/house.scad

150 lines
3.4 KiB
OpenSCAD
Raw Normal View History

// Dimensions
office_jacob_length = 203;
office_jacob_width = 341;
bedroom_length = 206;
bedroom_width = 341;
frame_depth = 13.5;
hall_length = 261;
hall_length_extra_office_jacob = 124;// Hall to end of office
hall_length_full = hall_length + hall_length_extra_office_jacob;
hall_width = 97.5;
livingroom_back_to_door_width = 341;
livingroom_door_to_frame_width = 96.5;
livingroom_doorframe_to_kitchen_width = 223.5;
livingroom_kitchen_to_front_threshold = 148;
livingroom_width = livingroom_back_to_door_width + livingroom_door_to_frame_width + frame_depth + livingroom_doorframe_to_kitchen_width + livingroom_kitchen_to_front_threshold
;
livingroom_length_kitchen = 343;
livingroom_length_back = 287;
kitchen_width_bath_to_entrance = 45;
kitchen_width = livingroom_kitchen_to_front_threshold + kitchen_width_bath_to_entrance;
kitchen_length = 162;
hall_to_bathroom_length = 87 + hall_length_extra_office_jacob;
bathroom_length = 146 + frame_depth;
bathroom_width = 158; //house_width - office_jacob_width - hall_width - kitchen_width;
house_height = 266;
house_width = livingroom_width;
house_length = hall_length_extra_office_jacob + hall_length + frame_depth +
livingroom_length_kitchen
;
// End Dimensions
// Global floor
cube([house_width, house_length, 1]);
// Jacob office
rectangle(
[
house_width - office_jacob_width,
house_length - office_jacob_length,
1
],
[
office_jacob_width,
office_jacob_length,
house_height
],
"lightblue"
);
// Bedroom
rectangle(
[
house_width - bedroom_width,
house_length - frame_depth - office_jacob_length - frame_depth - bedroom_length,
1
],
[
bedroom_width,
bedroom_length,
house_height
],
"lightgrey"
);
// Hallway
rectangle(
[
house_width - bedroom_width - frame_depth - hall_width,
house_length - hall_length_full,
1
],
[
hall_width,
hall_length,
house_height
],
"pink"
);
// Living room
rectangle(
[
house_width - livingroom_width,
house_length - office_jacob_length - bedroom_length - livingroom_length_back - frame_depth - frame_depth - frame_depth,
1
],
[
livingroom_width,
livingroom_length_back,
house_height
],
"orange"
);
// Bathroom
rectangle(
[
house_width - office_jacob_width - frame_depth - hall_width - frame_depth - bathroom_width,
house_length - hall_to_bathroom_length - bathroom_length - frame_depth,
1
],
[
bathroom_width,
bathroom_length,
house_height
],
"purple"
);
// Kitchen
rectangle(
[
house_width - (livingroom_back_to_door_width + livingroom_door_to_frame_width + livingroom_doorframe_to_kitchen_width) - frame_depth - kitchen_width + kitchen_width_bath_to_entrance,
house_length - hall_length_full,
1
],
[
kitchen_width,
kitchen_length,
house_height
],
"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)
{
dx = dimensions[0];
dy = dimensions[1];
dz = dimensions[2];
translate(start) color(color) //cube([dx, dy, dz]);
difference() {
cube([dx, dy, dz]);
translate([1,1,1]) cube([dx-2, dy-2, dz]);
}
}