Platform with a locking mechanism

This commit is contained in:
Dejvino 2021-01-21 09:59:55 +01:00
parent 58fc149bbe
commit 09336f1d0d
4 changed files with 123 additions and 15 deletions

View File

@ -9,3 +9,5 @@ module cubi(s, fillet=0, edges=EDGES_ALL) {
} }
} }
function vec_sum(v, w) = [v.x + w.x, v.y + w.y, v.z + w.z];

View File

@ -395,7 +395,7 @@ module phone_harness() {
} }
module model() { module model() {
up(get_platform_size().z + get_harness_size().z/2) phone_harness(); up(get_harness_size().z/2) phone_harness();
} }
if (!is_undef(validation)) { if (!is_undef(validation)) {

View File

@ -1,4 +1,6 @@
include <export.scad> include <export.scad>
//export=MODEL_PLATFORM_HARNESS;
//export=MODEL_PLATFORM_STRAP;
// dependency: https://github.com/revarbat/BOSL // dependency: https://github.com/revarbat/BOSL
include <BOSL/constants.scad> include <BOSL/constants.scad>
@ -10,6 +12,7 @@ use <BOSL/sliders.scad>
use <specs_platform.scad> use <specs_platform.scad>
use <specs_strap.scad> use <specs_strap.scad>
use <common.scad>
use <strap_common.scad> use <strap_common.scad>
use <platform_common.scad> use <platform_common.scad>
@ -33,21 +36,109 @@ module model_prop_arm() {
// <<< // <<<
// Blocks: // Blocks:
module lock_pin(groove) {
slack=groove
?[1, 0.5, 0.3]
:[0, 0, 0];
pin_size=get_platform_lock_pin_size();
size=vec_sum(pin_size, slack);
down(size.z/2)
translate([slack.x/2, slack.y/2, slack.z/2])
xrot(-4) zrot(-90) right_triangle([size.y, size.x, size.z]);
}
module lock_arm() {
size=get_platform_lock_arm_size();
down(get_platform_top_size().z) back(size.y/2) right(size.x/2) cube(size, center=true);
joiner_size=[get_platform_lock_pin_size().x, size.y, get_platform_top_size().z];
translate([joiner_size.x/2, joiner_size.y/2, -joiner_size.z/2 + size.z/2]) cube(joiner_size, center=true);
}
module lock_mechanism_button(groove=false) {
button_size=groove
?[10,5]
:[7,4.5];
size=[button_size.x, get_platform_wall()*7, button_size.y];
translate([get_platform_lock_pin_size().x*1.5, -get_platform_size().y/2+size.y*1.3, -get_platform_size().z/2])
cube(size, center=true);
}
module lock_buttons_cutout() {
module cutout_side(groove) {
translate(get_platform_lock_pin_pos()) lock_mechanism_button(groove=true);
}
cutout_side();
scale([1, -1, 1]) cutout_side();
}
module lock_mechanism() {
lock_pin(groove=false);
lock_arm();
lock_mechanism_button();
}
module lock_socket() {
pin_size=get_platform_lock_pin_size();
size=[pin_size.x, pin_size.y, pin_size.z];
module socket_connector() {
conn_size=[pin_size.x+4, get_platform_wall()*3, get_platform_top_size().z];
up(pin_size.z/2) fwd(pin_size.y+conn_size.y/2) right(pin_size.x/2) {
prismoid(size1=[conn_size.x, conn_size.y], size2=[conn_size.x, conn_size.y-2], shift=[0, -1], h=conn_size.z/2);
down(conn_size.z/4) cube([conn_size.x, conn_size.y, conn_size.z/2], center=true);
}
}
down(pin_size.z)
translate(get_platform_lock_pin_pos()) {
fwd(pin_size.y) scale([1, -1, -1]) lock_pin();
socket_connector();
}
}
module platform_locks_pins() {
platform_size=get_platform_size();
lock_pin_size=get_platform_lock_pin_size();
module lock_side(groove) {
translate(get_platform_lock_pin_pos()) lock_mechanism();
}
lock_side();
scale([1, -1, 1]) lock_side();
}
module platform_locks_sockets() {
lock_socket();
scale([1, -1, 1]) lock_socket();
}
module platform(base) { module platform(base) {
size=get_platform_size(); size=get_platform_size();
base_size=size;
wall=get_platform_wall();
top_size=get_platform_top_size();
top=!base; top=!base;
up(top?size.z:0)
color(top?"Olive":"YellowGreen") module base_platform() {
cube(size, center=true); module base_platform_core() {
braced_thinning_wall(h=size.y, l=size.x, thick=size.z, wall=0, strut=wall, orient=ORIENT_X_90);
}
difference() {
base_platform_core();
translate(get_platform_top_pos()) down(top_size.z/2) prismoid(size1=[top_size.x,top_size.y], size2=[base_size.x-2,base_size.y-2], h=top_size.z);
lock_buttons_cutout();
}
}
module top_platform() {
up((base_size.z-top_size.z)/2)
braced_thinning_wall(h=top_size.y, l=top_size.x, thick=top_size.z, wall=0, strut=wall/4, orient=ORIENT_X_90);
}
module strap_connectors() { module strap_connectors() {
down(size.z/2) foreach_platform_strap_connector() { //down(size.z/2)
foreach_platform_strap_connector() {
link_connector_pin(); link_connector_pin();
} }
} }
color(top?"Olive":"YellowGreen")
if (base) { if (base) {
base_platform();
platform_locks_pins();
strap_connectors(); strap_connectors();
} else {
top_platform();
platform_locks_sockets();
} }
} }
@ -61,6 +152,12 @@ module model_platform_strap() {
} }
// Export: // Export:
if (is_model(MODEL_PLATFORM_HARNESS)) model_platform_harness(); difference() {
if (is_model(MODEL_PLATFORM_STRAP)) model_platform_strap(); union() {
if (is_model(MODEL_DEMO)) model_prop_arm(); if (is_model(MODEL_PLATFORM_HARNESS)) model_platform_harness();
if (is_model(MODEL_PLATFORM_STRAP)) model_platform_strap();
//if (is_model(MODEL_DEMO)) model_prop_arm();
}
// xray:
//left(500+5) cube([1000, 1000, 1000], center=true);
}

View File

@ -2,13 +2,22 @@ use <specs_phone.scad>
use <specs_strap.scad> use <specs_strap.scad>
function get_platform_size() = [ function get_platform_size() = [
get_phone_size().x - 5, get_phone_size().x - 30,
get_phone_size().y - 5, get_phone_size().y - 5,
5 get_platform_wall()*3
];
function get_platform_top_size() = [
get_platform_size().x - 2*get_platform_wall(),
get_platform_size().y - 2*get_platform_wall(),
get_platform_size().z - get_platform_wall()];
function get_platform_top_pos() = [0, 0, (get_platform_size().z-get_platform_top_size().z)/2];
function get_platform_wall() = 3;
function get_platform_strap_connector_offset() = [
(get_platform_size().x/2 - get_link_segment_size().y/2) - 3,
get_platform_size().y/2 + 4,
-get_link_segment_size().z/2 + 0.5
]; ];
function get_platform_strap_connector_offset() = [ function get_platform_lock_pin_size() = [20, 4, 3];
(get_platform_size().x/2 - get_link_segment_size().y/2), function get_platform_lock_arm_size() = [65, 2, 3];
get_platform_size().y/2, function get_platform_lock_pin_pos() = [-20, -get_platform_top_size().y/2 + get_platform_wall()*4 + 1, get_platform_top_size().z/2];
-get_link_segment_size().z/2
];