You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

92 lines
1.9 KiB

/*
* Copyright 2022 Thomas Buck - thomas@xythobuz.de
* Philipp Schönberger - mail@phschoen.de
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* See <http://www.gnu.org/licenses/>.
*/
module keycap(type="sa",row=1)
{
if(type == "sa" || type == "SA" ) {
keycap_sa(row);
}
if(type == "mt3" || type == "MT3") {
keycap_mt3(row);
}
}
module keycap_sa(row=1)
{
// sa is taken from https://github.com/getclacking/SA-profile-keys-3D-models
$fn=400;
if(row == 1) {
import("stl/keycaps/sa/sa_r1_u1.stl");
}
if(row == 2) {
import("stl/keycaps/sa/sa_r2_u1.stl");
}
if(row == 3) {
import("stl/keycaps/sa/sa_r3_u1.stl");
}
if(row == 4) {
import("stl/keycaps/sa/sa_r4_u1.stl");
}
if(row == 5) {
import("stl/keycaps/sa/sa_r5_u1.stl");
}
}
module keycap_mt3(row=1)
{
// sa is taken from https://github.com/getclacking/SA-profile-keys-3D-models
$fn=400;
if(row == 1) {
import("stl/keycaps/mt3/mt3_r1_u1.stl");
}
if(row == 2) {
import("stl/keycaps/mt3/mt3_r2_u1.stl");
}
if(row == 3) {
import("stl/keycaps/mt3/mt3_r3_u1.stl");
}
if(row == 4) {
import("stl/keycaps/mt3/mt3_r5_u1.stl");
}
if(row == 5) {
import("stl/keycaps/mt3/mt3_r5_u1.stl");
}
}
o=[10,30,50,70];
translate([0,-5,0])
text("sa 1u",size=5);
translate([30,-5,0])
text("mt3 1u",size=5);
translate([-10,o[0],0])
text("R1",size=5);
translate([-10,o[1],0])
text("R2",size=5);
translate([-10,o[2],0])
text("R3",size=5);
translate([-10,o[3],0])
text("R4",size=5);
for(i=[1:4]) {
translate([10,o[i-1],0])
keycap("sa",5-i);
}
for(i=[1:4]) {
translate([40,o[i-1],0])
keycap("mt3",5-i);
}