scad/atreoid.scad

160 lines
5.6 KiB
OpenSCAD

$h = 1.3;
$fn = 18;
$right_hand = false;
$make_trackpoint = $right_hand && true;
include <hotswap_pcb_generator/scad/trackpoint.scad>;
$base_joiner_h = 10;
$nut_r = 5.4/2 + 0.5;
$bolt_r = 3/2 + 0.25;
$encl_h = 5;
// generated from points.yaml...
array = [[6.4249826, 36.4378869, -10], // matrix_pinkycluster_home
[9.7242979, 55.1492342, -10], // matrix_pinkycluster_top
[23.3998481, 23.290494, -10], // matrix_pinky_home
[26.6991635, 42.0018413, -10], // matrix_pinky_top
[29.9984789, 60.7131886, -10], // matrix_pinky_num
[40.5483618, 11.1279088, -10], // matrix_ring_bottom
[43.8476772, 29.8392561, -10], // matrix_ring_home
[47.1469926, 48.5506034, -10], // matrix_ring_top
[50.4463079, 67.2619507, -10], // matrix_ring_num
[60.6488945, 15.7070555, -10], // matrix_middle_bottom
[63.9482099, 34.4184028, -10], // matrix_middle_home
[67.2475253, 53.1297501, -10], // matrix_middle_top
[70.5468407, 71.8410974, -10], // matrix_middle_num
[76.581871, -3.349184, -10], // matrix_index_bottom
[79.8811864, 15.3621633, -10], // matrix_index_home
[83.1805018, 34.0735106, -10], // matrix_index_top
[86.4798171, 52.7848579, -10], // matrix_index_num
[94.5986256, -10.5877304, -10], // matrix_inner_bottom
[97.897941, 8.1236169, -10], // matrix_inner_home
[101.1972564, 26.8349643, -10], // matrix_inner_top
[104.4965717, 45.5463116, -10], // matrix_inner_num
[112.2680838, -19.7958923, -10], // matrix_thumb_bottom
[115.5673992, -1.0845449, -10], // matrix_thumb_home
[118.8667146, 17.6268024, -10], // matrix_thumb_top
[288.7098158, 36.4378869, 10], // mirror_matrix_pinkycluster_home
[285.4105005, 55.1492342, 10], // mirror_matrix_pinkycluster_top
[271.73495030000004, 23.290494, 10], // mirror_matrix_pinky_home
[268.4356349, 42.0018413, 10], // mirror_matrix_pinky_top
[265.1363195, 60.7131886, 10], // mirror_matrix_pinky_num
[254.5864366, 11.1279088, 10], // mirror_matrix_ring_bottom
[251.28712120000003, 29.8392561, 10], // mirror_matrix_ring_home
[247.98780580000002, 48.5506034, 10], // mirror_matrix_ring_top
[244.68849050000003, 67.2619507, 10], // mirror_matrix_ring_num
[234.48590390000004, 15.7070555, 10], // mirror_matrix_middle_bottom
[231.18658850000003, 34.4184028, 10], // mirror_matrix_middle_home
[227.88727310000002, 53.1297501, 10], // mirror_matrix_middle_top
[224.5879577, 71.8410974, 10], // mirror_matrix_middle_num
[218.55292740000002, -3.349184, 10], // mirror_matrix_index_bottom
[215.25361200000003, 15.3621633, 10], // mirror_matrix_index_home
[211.95429660000002, 34.0735106, 10], // mirror_matrix_index_top
[208.65498130000003, 52.7848579, 10], // mirror_matrix_index_num
[200.53617280000003, -10.5877304, 10], // mirror_matrix_inner_bottom
[197.23685740000002, 8.1236169, 10], // mirror_matrix_inner_home
[193.937542, 26.8349643, 10], // mirror_matrix_inner_top
[190.63822670000002, 45.5463116, 10], // mirror_matrix_inner_num
[182.86671460000002, -19.7958923, 10], // mirror_matrix_thumb_bottom
[179.5673992, -1.0845449, 10], // mirror_matrix_thumb_home
[176.26808380000003, 17.6268024, 10] // mirror_matrix_thumb_top
];
module corner_mount() {
translate([ 0, 0, -1 * $base_joiner_h ]) {
difference() {
cube([5, 5, $base_joiner_h]);
cylinder(r1=4, r2=0, h=$base_joiner_h);
}
}
}
module keyboard_plate() {
union() {
cube([155, 140, 3.3]);
// translate([135,0,0]) cube([20, 140, 3.3]);
translate([5,5,0]) rotate([0,0,180]) corner_mount();
translate([150,140,0]) rotate([0,0,270]) corner_mount();
translate([5,135,0]) rotate([0,0,90]) corner_mount();
translate([150,0,0]) rotate([0,0,0]) corner_mount();
// add bolt-together points
if ($right_hand) {
translate([149,10,-3.6]) rotate([0,90,0]) nut_holes();
translate([149,130,-3.6]) rotate([0,90,0]) nut_holes();
} else {
translate([149,10,-3.6]) rotate([0,90,0]) bolt_holes();
translate([149,130,-3.6]) rotate([0,90,0]) bolt_holes();
}
}
}
module one_half() {
difference() {
translate([0,-30,0])
keyboard_plate();
for (tuple = array) {
translate([tuple[0], tuple[1],0]) {
rotate([0,0, tuple[2]]) {
translate([-0.5,-0.5,0])
cube([15,15,2]);
translate([0,0,2])
cube([14, 14, 1.3]);
}
}
}
// right hand has a trackpoint
if ($make_trackpoint) {
translate([115,73,2.5])
rotate(a=[180,0,-10])
trackpoint_cutout();
}
}
}
module trackpoint_check() {
difference() {
cube([40, 40, 3.3]);
translate([20,20,2.5])
rotate(a=[180,0,-10])
trackpoint_cutout();
}
}
// trackpoint_check();
// trackpoint_cutout();
module bolt_holes() {
translate([-0.60,0,0]) {
difference() {
translate([-3,-5,1]) cube([10,10,$encl_h]);
translate([2,0,0]) cylinder(h=$encl_h + 2, r=$bolt_r);
}
}
}
module nut_holes() {
let ($fn = 6) {
translate([-0.60,0,0]) {
difference() {
translate([-3,-5,1]) cube([10,10,$encl_h]);
translate([2,0,-1]) cylinder(h=$encl_h, r=$nut_r);
let ($fn = 18) {
translate([2,0,0]) cylinder(h=$encl_h + 2, r=$bolt_r);
}
}
}
};
}
rotate(a=[0,180,0])
if ($right_hand) {
mirror([0,1,0]) {
one_half();
}
} else {
one_half();
}