Commit e3ccb420 authored by György Kurucz's avatar György Kurucz
Browse files

Added a new tablet holder design.

Added a new 'rounded_square' module to the include directory.
parents
/*
Creates a rectangle with rounded corners.
The created shape will be a subset of a normal rectangle with the same
dimensions.
*/
module rounded_square(s, r=1, center=false) {
tr = center ? 0 : r;
translate([tr, tr]) minkowski() {
square([s.x-2*r, s.y-2*r], center=center);
circle(r=r, $fn=32);
}
}
\ No newline at end of file
use <../../include/rounded_square.scad>;
wall_t = 5; //wall thickness
wall_front = 19-2; //wall height on the front
wall_back = 2*wall_front; //wall height at the back
radius = 1; //corner radius
thick = 8.7; //thickness of tablet
base_t = 5; //base thickness
base_w = 15; //base width
base_e = 47; //base extend at back
tablet_offset = 2; //offset from the 'virtual' base of the walls
tablet_width = 114;
side_w = 1; //side wall thickness
width = tablet_width + side_w*2;
module mirrored(v) { children(); mirror(v) children(); }
module wall(h) rounded_square([wall_t, h], r=radius);
module base(ext=base_e, sub=0) translate([-ext/2 - sub/2, 0])
rounded_square([base_w + ext - sub, base_t], r=radius, center=true);
module domain() {
translate([-50, -base_t/2]) square([100, 100]);
}
module tablet_placeholder_shape() translate([-thick/2, base_t/2]) rounded_square([thick, 190], r=2);
module tablet_placeholder() {
translate([0, 0, side_w]) color("red") linear_extrude(tablet_width) holder_trans() translate([0, tablet_offset, 0]) tablet_placeholder_shape();
}
module placeholders() {
tablet_placeholder();
color("green") translate([0, -10, 0]) rotate([-90, 0, 0])
projection() rotate([90,0,0]) tablet_placeholder();
}
module holder(off_back=2, off_front=-4) {
off = off_back;
intersection() {
holder_trans() {
translate([thick/2, off_front])
wall(wall_front + tablet_offset - off_front);
translate([-thick/2, off])
mirror([1, 0, 0]) wall(wall_back - off);
}
domain();
}
}
module holder_trans() translate([0, -1, 0]) rotate([0, 0, 15]) children();
module side_wall() {
hull() holder();
}
union() {
translate([0, 0, width/2]) mirrored([0, 0, 1]) {
translate([0, 0, width/2-10]) linear_extrude(10) {
holder();
base();
}
translate([0, 0, -1]) linear_extrude(11) {
holder();
base();
}
}
linear_extrude(width) {
holder(23);
base(sub=52);
base(ext=5);
}
linear_extrude(side_w) side_wall();
translate([0, 0, width - side_w]) linear_extrude(side_w) side_wall();
}
//placeholders();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment