Skip to content

Instantly share code, notes, and snippets.

@erubboli
Last active October 19, 2015 16:00
Show Gist options
  • Save erubboli/0d6af4a63da3011fd0a4 to your computer and use it in GitHub Desktop.
Save erubboli/0d6af4a63da3011fd0a4 to your computer and use it in GitHub Desktop.
/* Box for the udoo 7'' touch screen */
/* Author: Enrico Rubboli */
// box size
box = [180,115,35];
round_size = 2;
inner_box = [box[0]-round_size*2, box[1] - round_size*2, box[2]];
box_color = "white";
// part of the display visible from the outside
screen = [155,94];
step = 2;
// margins around display
margins = [10,3,2,6];
x_margin = margins[1]+margins[3];
y_margin = margins[0]+margins[2];
// spaces for the device
bottom_depth = 8;
bottom_height = 65;
top_depth = 30;
top_height = screen[1] + y_margin - bottom_height +3;
// cables
cables_radio = 20;
cables_depth = 30;
// wall mount holes
wm_radio = 2;
difference(){
t_screen_x = (box[0] - screen[0]) / 2;
t_screen_y = (box[1] - screen[1]) / 2;
minkowski(){
color(box_color) cube(inner_box);
color(box_color) cylinder(r=2);
}
// show the display
linear_extrude(step)
translate([t_screen_x, t_screen_y, 0])
square(screen);
// bottom_space_for device
bs_translate_y = (t_screen_y + screen[1] + margins[2]) - bottom_height;
bs_translate_x = t_screen_x-margins[3];
bs_translate = [bs_translate_x, bs_translate_y,2];
translate(bs_translate){
linear_extrude(bottom_depth)
square([screen[0]+x_margin, bottom_height]);
}
// top space for device
ts_translate_x = bs_translate_x;
ts_translate = [ts_translate_x, -2,step];
translate(ts_translate){
linear_extrude(top_depth)
square([screen[0]+x_margin, top_height]);
}
// space for cables
cables_translate = [box[0]/2, box[1]/2-20,20];
translate(cables_translate){
linear_extrude(cables_depth)
circle(cables_radio);
}
// wall mount holes
wm1_translate = [20,20,30];
translate(wm1_translate){
linear_extrude(10)
circle(wm_radio);
}
wm2_translate = [160,20,30];
translate(wm2_translate){
linear_extrude(10)
circle(wm_radio);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment