12 Commits

Author SHA1 Message Date
Bob
0fc43fa0d7 use inside() to avoid stems protruding out the sides 2022-02-21 12:38:53 -05:00
Bob
fbcf9b2c63 Merge pull request #47 from asdacap/master
Ensure stem does not come out of the key
2022-02-21 12:36:55 -05:00
Bob
edfc02e27b Merge pull request #132 from rsheldiii/v1/g20-spacebar-fix
V1: Fix g20 spacebar having closed bottom
2022-02-19 20:31:43 -05:00
Bob
65bb577473 fix g20 spacebar having closed bottom 2022-02-19 20:30:15 -05:00
Bob
bf4ee0426a Merge pull request #131 from rsheldiii/v1/side-sculpting-scope-fix
V1: Fix lexical scope bug in sculpted_square
2022-02-19 20:14:40 -05:00
Bob
42361f5c25 fix lexical scope bug in sculpted_square 2022-02-19 20:13:13 -05:00
Bob
7edecd7d67 Merge pull request #130 from rsheldiii/v1/stem-slop-fix
V1 stem slop fix
2022-02-19 20:05:04 -05:00
Bob
160c47150d backport stem slop fix 2022-02-19 20:03:54 -05:00
Bob
a1ec4c3cac Merge pull request #129 from rsheldiii/v1/tines-support-fix
V1/tines support fix
2022-02-19 19:49:56 -05:00
Bob
28680924b4 remove bad include - its messing up my post commit hook 2022-02-19 19:48:16 -05:00
Bob
8ad81d3b61 stop tines from protruding out oem keycaps 2022-02-19 19:47:17 -05:00
Muhammad Amirul Ashraf
d62afcd878 Ensure stem does not come out of the key 2020-05-31 09:48:38 +08:00
11 changed files with 1951 additions and 296 deletions

View File

@@ -1,36 +0,0 @@
name: CI
on:
push:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# x11 server needed for png output lol
- name: Setup xvfb (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0
# start xvfb in the background
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &
- name: Install openscad
run: sudo apt-get install openscad
- run: mkdir tests/output/
- run: touch tests/empty.scad
- run: 'openscad -o "tests/output/test.stl" "tests/test.scad"'
- run: openscad tests/empty.scad -D 'color(0.5,0,0,0.5)import("test.stl");color(0,0.5,0,0.5)import("output/test.stl");' -o output.png
# - run: du -B 1 output.stl
- uses: actions/upload-artifact@v2
with:
name: test-output
path: output.png
# - run: |
# git config --global user.name 'KeyV2 GHA Bot'
# git config --global user.email 'keyv2-gha-bot@users.noreply.github.com'
# git add -A
# git commit -m "Update test stls"
# git push

File diff suppressed because it is too large Load Diff

View File

@@ -399,20 +399,9 @@ module key(inset = false) {
if ($clearance_check) %clearance_check(); if ($clearance_check) %clearance_check();
} }
// both stem and support are optional inside() {
if ($stem_type != "disable" || ($stabilizers != [] && $stabilizer_type != "disable")) { translate([0, 0, $stem_inset]) {
dished($keytop_thickness, $inverted_dish) { if ($support_type != "disable"){
translate([0, 0, $stem_inset]) {
if ($stabilizer_type != "disable") stems_for($stabilizers, $stabilizer_type);
if ($stem_type != "disable") stems_for($stem_positions, $stem_type);
}
}
}
if ($support_type != "disable"){
inside() {
translate([0, 0, $stem_inset]) {
if ($stabilizer_type != "disable") support_for($stabilizers, $stabilizer_type); if ($stabilizer_type != "disable") support_for($stabilizers, $stabilizer_type);
// always render stem support even if there isn't a stem. // always render stem support even if there isn't a stem.
@@ -420,6 +409,12 @@ module key(inset = false) {
// so if you want a hollow keycap you'll have to turn support off entirely // so if you want a hollow keycap you'll have to turn support off entirely
support_for($stem_positions, $stem_type); support_for($stem_positions, $stem_type);
} }
if ($stem_type != "disable" || ($stabilizers != [] && $stabilizer_type != "disable")) {
if ($stabilizer_type != "disable") stems_for($stabilizers, $stabilizer_type);
if ($stem_type != "disable") stems_for($stem_positions, $stem_type);
}
} }
} }
} }

View File

@@ -92,26 +92,26 @@ module blank() {
children(); children();
} }
module cherry(slop) { module cherry(slop = undef) {
$stem_slop = slop ? slop : $stem_slop; $stem_slop = slop != undef ? slop : $stem_slop;
$stem_type = "cherry"; $stem_type = "cherry";
children(); children();
} }
module alps(slop) { module alps(slop = undef) {
$stem_slop = slop ? slop : $stem_slop; $stem_slop = slop != undef ? slop : $stem_slop;
$stem_type = "alps"; $stem_type = "alps";
children(); children();
} }
module rounded_cherry(slop) { module rounded_cherry(slop = undef) {
$stem_slop = slop ? slop : $stem_slop; $stem_slop = slop != undef ? slop : $stem_slop;
$stem_type = "rounded_cherry"; $stem_type = "rounded_cherry";
children(); children();
} }
module box_cherry(slop) { module box_cherry(slop = undef) {
$stem_slop = slop ? slop : $stem_slop; $stem_slop = slop != undef ? slop : $stem_slop;
$stem_type = "box_cherry"; $stem_type = "box_cherry";
children(); children();
} }

View File

@@ -1,8 +1,8 @@
include <functions.scad> include <functions.scad>
module spacebar() { module spacebar() {
$inverted_dish = true; $inverted_dish = $dish_type != "disable";
$dish_type = "sideways cylindrical"; $dish_type = $dish_type != "disable" ? "sideways cylindrical" : "disable";
6_25u() stabilized(mm=50) children(); 6_25u() stabilized(mm=50) children();
} }

View File

@@ -1,18 +1,18 @@
// rounded square shape with additional sculpting functions to better approximate // rounded square shape with additional sculpting functions to better approximate
// When sculpting sides, how much in should the tops come // When sculpting sides, how much in should the tops come
$side_sculpting_factor = 4.5; side_sculpting_factor = 4.5;
// When sculpting corners, how much extra radius should be added // When sculpting corners, how much extra radius should be added
$corner_sculpting_factor = 1; corner_sculpting_factor = 1;
// When doing more side sculpting corners, how much extra radius should be added // When doing more side sculpting corners, how much extra radius should be added
$more_side_sculpting_factor = 0.4; more_side_sculpting_factor = 0.4;
// side sculpting functions // side sculpting functions
// bows the sides out on stuff like SA and DSA keycaps // bows the sides out on stuff like SA and DSA keycaps
function side_sculpting(progress) = (1 - progress) * $side_sculpting_factor; function side_sculpting(progress) = (1 - progress) * side_sculpting_factor;
// makes the rounded corners of the keycap grow larger as they move upwards // makes the rounded corners of the keycap grow larger as they move upwards
function corner_sculpting(progress) = pow(progress, 2) * $corner_sculpting_factor; function corner_sculpting(progress) = pow(progress, 2) * corner_sculpting_factor;
module sculpted_square_shape(size, delta, progress) { module sculpted_square_shape(size, delta, progress) {
width = size[0]; width = size[0];
@@ -37,7 +37,7 @@ module sculpted_square_shape(size, delta, progress) {
offset(r = extra_corner_radius_this_slice, $fa=360/$shape_facets) { offset(r = extra_corner_radius_this_slice, $fa=360/$shape_facets) {
offset(r = -extra_corner_radius_this_slice) { offset(r = -extra_corner_radius_this_slice) {
side_rounded_square(square_size, r = $more_side_sculpting_factor * progress); side_rounded_square(square_size, r = more_side_sculpting_factor * progress);
} }
} }
} }
@@ -92,7 +92,7 @@ function skin_sculpted_square_shape(size, delta, progress, thickness_difference)
width - extra_width_this_slice - thickness_difference, width - extra_width_this_slice - thickness_difference,
height - extra_height_this_slice - thickness_difference height - extra_height_this_slice - thickness_difference
] ]
) new_side_rounded_square(square_size, $more_side_sculpting_factor * progress, extra_corner_radius_this_slice); ) new_side_rounded_square(square_size, more_side_sculpting_factor * progress, extra_corner_radius_this_slice);
module side_rounded_square(size, r) { module side_rounded_square(size, r) {

View File

@@ -4,14 +4,14 @@ include <../stems/cherry.scad>
module centered_tines(stem_support_height) { module centered_tines(stem_support_height) {
if ($key_length < 2) { if ($key_length < 2) {
translate([0,0,$stem_support_height / 2]) { translate([0,0,$stem_support_height / 2]) {
cube([total_key_width(), 0.5, $stem_support_height], center = true); cube([total_key_width() -$wall_thickness/2, 0.5, $stem_support_height], center = true);
} }
} }
translate([0,0,$stem_support_height / 2]) { translate([0,0,$stem_support_height / 2]) {
cube([ cube([
1, 1,
total_key_height(), total_key_height() -$wall_thickness/2,
$stem_support_height $stem_support_height
], ],
center = true); center = true);

View File

@@ -4,7 +4,6 @@ include <stems/box_cherry.scad>
include <stems/alps.scad> include <stems/alps.scad>
include <stems/filled.scad> include <stems/filled.scad>
include <stems/cherry_stabilizer.scad> include <stems/cherry_stabilizer.scad>
include <stems/custom.scad>
//whole stem, alps or cherry, trimmed to fit //whole stem, alps or cherry, trimmed to fit

View File

View File

@@ -1,3 +0,0 @@
include <../includes.scad>
key();

Binary file not shown.