Browse Source

add option to disable bezier betreen the switches

main
phschoen 2 years ago
parent
commit
c674964b5c
  1. 2
      config.scad
  2. 35
      switch_holder_plate.scad

2
config.scad

@ -59,6 +59,8 @@ ball_h = 15;
roller_dia = 3.0;
roller_count = 3;
bezier_between_keys = false;
$switch_with_pcb=true;
$show_switches=true;
$show_keycaps=true;

35
switch_holder_plate.scad

@ -73,6 +73,17 @@ function switch_bz_between(switch_r,switch_t,rows,colums,a,h,offset_bz=[2,0,0],o
],
];
function switch_line_connection(switch_r,switch_t,rows,colums,a,h,offset_bz=[2,0,0]) = [
[
switch_rc_point(switch_r,switch_t,rows[0],colums[0],a[0][0],h,[0,0,0]),
switch_rc_point(switch_r,switch_t,rows[0],colums[0],a[0][1],h,[0,0,0]),
],
[
switch_rc_point(switch_r,switch_t,rows[len(rows) == 1 ? 0 : 1],colums[len(colums) == 1 ? 0 : 1],a[1][0],h,[0,0,0]),
switch_rc_point(switch_r,switch_t,rows[len(rows) == 1 ? 0 : 1],colums[len(colums) == 1 ? 0 : 1],a[1][1],h,[0,0,0]),
],
];
function switch_bz_connection(switch_r,switch_t,rows,colums,a,h,offset_bz=[2,0,0]) = [
[
switch_rc_point(switch_r,switch_t,rows[0],colums[0],a[0][0],h,[0,0,0]-$e*offset_bz),
@ -100,6 +111,16 @@ function switch_bz_connection(switch_r,switch_t,rows,colums,a,h,offset_bz=[2,0,0
],
];
function switch_line_connection_cross(switch_r,switch_t,rows,colums,a,h,offset_bz=[2,0,0]) = [
[
switch_rc_point(switch_r,switch_t,rows[0],colums[0],a[0][0],h,[0,0,0]),
switch_rc_point(switch_r,switch_t,rows[1],colums[0],a[0][1],h,[0,0,0]),
],
[
switch_rc_point(switch_r,switch_t,rows[0],colums[1],a[1][0],h,[0,0,0]),
switch_rc_point(switch_r,switch_t,rows[1],colums[1],a[1][1],h,[0,0,0]),
],
];
function switch_bz_connection_cross(switch_r,switch_t,rows,colums,a,h,offset_bz=[2,0,0]) = [
[
switch_rc_point(switch_r,switch_t,rows[0],colums[0],a[0][0],h,[0,0,0]-$e*offset_bz),
@ -198,13 +219,19 @@ ctrl_pts_NS_IN = [
ctrl_pts_OW_IN = [
// within NS
for(r=[0:len(switch_r)-2], c=[0:len(switch_r[r])-1])
switch_bz_connection(switch_r,switch_t,[r,r+1], [c],[ ["SW", "SO"],["NW", "NO"] ],"top",[0,-1,0]),
for(r=[0:len(switch_r)-2], c=[0:len(switch_r[r])-1]) (
(bezier_between_keys == true) ?
switch_bz_connection(switch_r,switch_t,[r,r+1], [c],[ ["SW", "SO"],["NW", "NO"] ],"top",[0,-1,0]) :
switch_line_connection(switch_r,switch_t,[r,r+1], [c],[ ["SW", "SO"],["NW", "NO"] ],"top",[0,-1,0])
)
];
ctrl_pts_CROSS_IN = [
for(r=[0:len(switch_r)-2], c=[0:len(switch_r[r])-2])
switch_bz_connection_cross(switch_r,switch_t,[r+1,r], [c,c+1],[ [ "NO", "SO"],["NW", "SW"] ],"top",[1,0,0]),
for(r=[0:len(switch_r)-2], c=[0:len(switch_r[r])-2]) (
(bezier_between_keys == true) ?
switch_bz_connection_cross(switch_r,switch_t,[r+1,r], [c,c+1],[ [ "NO", "SO"],["NW", "SW"] ],"top",[1,0,0]) :
switch_line_connection_cross(switch_r,switch_t,[r+1,r], [c,c+1],[ [ "NO", "SO"],["NW", "SW"] ],"top",[1,0,0])
)
];
ctrl_pts = [

Loading…
Cancel
Save