1 Commits

Author SHA1 Message Date
Bob
cc8892364c fix minkowski top_placement and additive artisans 2022-02-21 16:34:06 -05:00
6 changed files with 21 additions and 35 deletions

View File

@@ -1,6 +1,5 @@
TODO:
* Make flat stem support default
* make flat inner shape default
* support repositioning to print on the back surface of the keycap
* implement regular polygon for skin extrusions
* switch to skin-shaped extrusions by default

View File

@@ -1130,7 +1130,7 @@ module upside_down() {
module sideways() {
$key_shape_type = "flat_sided_square";
$dish_overdraw_width = abs(extra_keytop_length_for_flat_sides());
extra_y_rotation = atan2($width_difference/2,$total_depth); // TODO assumes centered top
extra_y_rotation = atan2($width_difference/2,$total_depth);
translate([0,0,cos(extra_y_rotation) * total_key_width()/2])
rotate([0,90 + extra_y_rotation ,0]) children();
}
@@ -1158,14 +1158,7 @@ module auto_place() {
translate_u(x,-y) children(child_index);
}
}
// suggested settings for resin prints
module resin() {
$stem_slop = 0;
$stem_inner_slop = 0;
$stem_support_type = "disable";
children();
}module arrows(profile, rows = [4,4,4,3]) {
module arrows(profile, rows = [4,4,4,3]) {
positions = [[0, 0], [1, 0], [2, 0], [1, 1]];
legends = ["←", "↓", "→", "↑"];
@@ -3315,7 +3308,7 @@ function unit_length(length) = $unit * (length - 1) + 18.16;
// extra length to the vertical tine of the inside cherry cross
// splits the stem into halves - allows easier fitment
extra_vertical = 100;
extra_vertical = 0.6;
module inside_cherry_cross(slop) {
// inside cross
@@ -3501,7 +3494,7 @@ function unit_length(length) = $unit * (length - 1) + 18.16;
// extra length to the vertical tine of the inside cherry cross
// splits the stem into halves - allows easier fitment
extra_vertical = 100;
extra_vertical = 0.6;
module inside_cherry_cross(slop) {
// inside cross
@@ -3697,7 +3690,7 @@ function unit_length(length) = $unit * (length - 1) + 18.16;
// extra length to the vertical tine of the inside cherry cross
// splits the stem into halves - allows easier fitment
extra_vertical = 100;
extra_vertical = 0.6;
module inside_cherry_cross(slop) {
// inside cross
@@ -4056,7 +4049,7 @@ function unit_length(length) = $unit * (length - 1) + 18.16;
// extra length to the vertical tine of the inside cherry cross
// splits the stem into halves - allows easier fitment
extra_vertical = 100;
extra_vertical = 0.6;
module inside_cherry_cross(slop) {
// inside cross
@@ -4299,7 +4292,7 @@ function unit_length(length) = $unit * (length - 1) + 18.16;
// extra length to the vertical tine of the inside cherry cross
// splits the stem into halves - allows easier fitment
extra_vertical = 100;
extra_vertical = 0.6;
module inside_cherry_cross(slop) {
// inside cross
@@ -4368,7 +4361,7 @@ module tines_support(stem_type, stem_support_height, slop) {
}
// 2 vertical tines holding either side of the cruciform
for (x = [2, -2]) {
for (x = [1.15, -1.15]) {
translate([x,0,$stem_support_height / 2]) {
cube([
0.5,
@@ -6093,7 +6086,6 @@ module shape(thickness_difference, depth_difference=0){
}
}
// Not currently used due to CGAL errors. Rounds the shape via minkowski
module rounded_shape() {
color($primary_color) minkowski(){
// half minkowski in the z direction
@@ -6182,9 +6174,9 @@ module top_placement(depth_difference=0) {
top_tilt_by_height = -$top_tilt / $key_height;
top_tilt_y_by_length = $double_sculpted ? (-$top_tilt_y / $key_length) : 0;
minkowski_height = $rounded_key ? $minkowski_radius : 0;
// minkowski_height = $rounded_key ? $minkowski_radius : 0;
translate([$top_skew_x + $dish_skew_x, $top_skew + $dish_skew_y, $total_depth - depth_difference + minkowski_height/2]){
translate([$top_skew_x + $dish_skew_x, $top_skew + $dish_skew_y, $total_depth - depth_difference]){
rotate([top_tilt_by_height, top_tilt_y_by_length,0]){
children();
}
@@ -6304,7 +6296,9 @@ module outer_total_shape(inset=false) {
// takes all the bits and glues them together. requires configuration with special variables.
module key(inset=false) {
difference(){
outer_total_shape(inset);
outer_total_shape(inset) {
children();
};
if ($inner_shape_type != "disable") {
translate([0,0,-SMALLEST_POSSIBLE]) {

View File

@@ -24,7 +24,6 @@ module shape(thickness_difference, depth_difference=0){
}
}
// Not currently used due to CGAL errors. Rounds the shape via minkowski
module rounded_shape() {
color($primary_color) minkowski(){
// half minkowski in the z direction
@@ -113,9 +112,9 @@ module top_placement(depth_difference=0) {
top_tilt_by_height = -$top_tilt / $key_height;
top_tilt_y_by_length = $double_sculpted ? (-$top_tilt_y / $key_length) : 0;
minkowski_height = $rounded_key ? $minkowski_radius : 0;
// minkowski_height = $rounded_key ? $minkowski_radius : 0;
translate([$top_skew_x + $dish_skew_x, $top_skew + $dish_skew_y, $total_depth - depth_difference + minkowski_height/2]){
translate([$top_skew_x + $dish_skew_x, $top_skew + $dish_skew_y, $total_depth - depth_difference]){
rotate([top_tilt_by_height, top_tilt_y_by_length,0]){
children();
}
@@ -235,7 +234,9 @@ module outer_total_shape(inset=false) {
// takes all the bits and glues them together. requires configuration with special variables.
module key(inset=false) {
difference(){
outer_total_shape(inset);
outer_total_shape(inset) {
children();
};
if ($inner_shape_type != "disable") {
translate([0,0,-SMALLEST_POSSIBLE]) {

View File

@@ -195,7 +195,7 @@ module upside_down() {
module sideways() {
$key_shape_type = "flat_sided_square";
$dish_overdraw_width = abs(extra_keytop_length_for_flat_sides());
extra_y_rotation = atan2($width_difference/2,$total_depth); // TODO assumes centered top
extra_y_rotation = atan2($width_difference/2,$total_depth);
translate([0,0,cos(extra_y_rotation) * total_key_width()/2])
rotate([0,90 + extra_y_rotation ,0]) children();
}
@@ -223,11 +223,3 @@ module auto_place() {
translate_u(x,-y) children(child_index);
}
}
// suggested settings for resin prints
module resin() {
$stem_slop = 0;
$stem_inner_slop = 0;
$stem_support_type = "disable";
children();
}

View File

@@ -36,7 +36,7 @@ module tines_support(stem_type, stem_support_height, slop) {
}
// 2 vertical tines holding either side of the cruciform
for (x = [2, -2]) {
for (x = [1.15, -1.15]) {
translate([x,0,$stem_support_height / 2]) {
cube([
0.5,

View File

@@ -2,7 +2,7 @@ include <../functions.scad>
// extra length to the vertical tine of the inside cherry cross
// splits the stem into halves - allows easier fitment
extra_vertical = 100;
extra_vertical = 0.6;
module inside_cherry_cross(slop) {
// inside cross