@@ -900,7 +900,66 @@ module dss_row(n=3, column=0) {
900900 children();
901901 }
902902}
903+ // a safe theoretical distance between two vertices such that they don't collapse. hard to use
904+ SMALLEST_POSSIBLE = 1 /128 ;
905+ $ fs= 0.1 ;
906+ $ unit= 19.05 ;
907+ // Regular polygon shapes CIRCUMSCRIBE the sphere of diameter $bottom_key_width
908+ // This is to make tiling them easier, like in the case of hexagonal keycaps etc
903909
910+ // this function doesn't set the key shape, so you can't use it directly without some fiddling
911+ module typewriter_row(n=3, column=0) {
912+ $ bottom_key_width = $ unit - 0.5 ;
913+ $ bottom_key_height = $ unit - 0.5 ;
914+ $ width_difference = 0 ;
915+ $ height_difference = 0 ;
916+ $ dish_type = "spherical" ;
917+ $ key_shape_type = "circular" ;
918+ $ inverted_dish = true ;
919+ $ stem_inset = - 4.5 ;
920+ $ stem_throw = 5 ;
921+ $ dish_depth = 1 ;
922+ $ dish_skew_x = 0 ;
923+ $ dish_skew_y = 0 ;
924+ $ top_skew = 0 ;
925+ $ height_slices = 1 ;
926+ $ stem_support_type = "disable" ;
927+ // $corner_radius = 1;
928+
929+ // this is _incredibly_ intensive
930+ /* $rounded_key = true; */
931+
932+ $ top_tilt_y = side_tilt(column);
933+ extra_height = $ double_sculpted ? extra_side_tilt_height(column) : 0 ;
934+
935+ base_depth = 3.5 ;
936+ if (n <= 1 ){
937+ $ total_depth = base_depth + 2.5 + extra_height;
938+ $ top_tilt = - 13 ;
939+
940+ children();
941+ } else if (n == 2 ) {
942+ $ total_depth = base_depth + 0.5 + extra_height;
943+ $ top_tilt = - 7 ;
944+
945+ children();
946+ } else if (n == 3 ) {
947+ $ total_depth = base_depth + extra_height;
948+ $ top_tilt = 0 ;
949+
950+ children();
951+ } else if (n == 4 ){
952+ $ total_depth = base_depth + 0.5 + extra_height;
953+ $ top_tilt = 7 ;
954+
955+ children();
956+ } else {
957+ $ total_depth = base_depth + extra_height;
958+ $ top_tilt = 0 ;
959+
960+ children();
961+ }
962+ }
904963// man, wouldn't it be so cool if functions were first order
905964module key_profile(key_profile_type, row, column=0) {
906965 if (key_profile_type == "dcs" ) {
@@ -921,6 +980,8 @@ module key_profile(key_profile_type, row, column=0) {
921980 hipro_row(row, column) children();
922981 } else if (key_profile_type == "grid" ) {
923982 grid_row(row, column) children();
983+ } else if (key_profile_type == "typewriter" ) {
984+ typewriter_row(row, column) children();
924985 } else if (key_profile_type == "hexagon" ) {
925986 hexagonal_row(row, column) children();
926987 } else if (key_profile_type == "octagon" ) {
@@ -3296,6 +3357,8 @@ module key_shape(size, delta, progress = 0) {
32963357 regular_polygon_shape(size, delta, progress);
32973358 } else if ($ key_shape_type == "octagon" ) {
32983359 regular_polygon_shape(size, delta, progress, sides= 8 );
3360+ } else if ($ key_shape_type == "circular" ) {
3361+ regular_polygon_shape(size, delta, progress, sides= 36 );
32993362 } else {
33003363 echo ("Warning: unsupported $key_shape_type" );
33013364 }
@@ -4877,7 +4940,7 @@ module keytext(text, position, font_size, depth) {
48774940 woffset = (top_total_key_width()/3.5 ) * position[0 ];
48784941 hoffset = (top_total_key_height()/3.5 ) * - position[1 ];
48794942 translate ([woffset, hoffset, - depth]){
4880- color ($ tertiary_color) linear_extrude(height= 2 ){
4943+ color ($ tertiary_color) linear_extrude(height=$ dish_depth + depth ){
48814944 text(text= text, font=$ font, size= font_size, halign= "center" , valign= "center" );
48824945 }
48834946 }
0 commit comments