17 Commits

Author SHA1 Message Date
Bob
3b7ee03c78 Update test.yml 2021-08-02 17:59:49 -04:00
Bob
4d4282313a Update test.yml 2021-08-02 17:56:28 -04:00
Bob
ff0352c299 } 2021-08-02 17:52:18 -04:00
Bob
7686e1d589 Update test.yml 2021-08-02 17:48:51 -04:00
Bob
4c8b460823 Update test.stl 2021-08-02 17:41:38 -04:00
Bob
10352f6979 Update test.yml 2021-08-02 17:36:58 -04:00
Bob
b36bceaa65 Merge branch 'github-actions' of https://github.com/rsheldiii/KeyV2 into github-actions 2021-08-02 17:34:19 -04:00
Bob
7dbc466682 more advanced 2021-08-02 17:34:11 -04:00
KeyV2 GHA Bot
aa2087cd96 Update test stls 2021-08-02 21:20:40 +00:00
Bob
22b7e29da5 Update test.yml 2021-08-02 17:19:57 -04:00
Bob
df4686974e git add -A 2021-08-02 17:13:58 -04:00
Bob
45eaab2b1c Create test.stl 2021-08-02 17:01:55 -04:00
Bob
f579143f9b Update test.yml 2021-08-02 16:55:14 -04:00
Bob
b675a8f66f Update test.yml 2021-08-02 16:31:46 -04:00
Bob
d288e53e77 Update test.yml 2021-08-02 16:26:51 -04:00
Bob
67991c238e Update test.yml 2021-08-02 16:08:38 -04:00
Bob
269fa2361c test github actions workflow 2021-08-02 16:05:19 -04:00
11 changed files with 279 additions and 1934 deletions

36
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,36 @@
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,9 +399,20 @@ module key(inset = false) {
if ($clearance_check) %clearance_check();
}
inside() {
translate([0, 0, $stem_inset]) {
if ($support_type != "disable"){
// both stem and support are optional
if ($stem_type != "disable" || ($stabilizers != [] && $stabilizer_type != "disable")) {
dished($keytop_thickness, $inverted_dish) {
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);
// always render stem support even if there isn't a stem.
@@ -409,12 +420,6 @@ module key(inset = false) {
// so if you want a hollow keycap you'll have to turn support off entirely
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();
}
module cherry(slop = undef) {
$stem_slop = slop != undef ? slop : $stem_slop;
module cherry(slop) {
$stem_slop = slop ? slop : $stem_slop;
$stem_type = "cherry";
children();
}
module alps(slop = undef) {
$stem_slop = slop != undef ? slop : $stem_slop;
module alps(slop) {
$stem_slop = slop ? slop : $stem_slop;
$stem_type = "alps";
children();
}
module rounded_cherry(slop = undef) {
$stem_slop = slop != undef ? slop : $stem_slop;
module rounded_cherry(slop) {
$stem_slop = slop ? slop : $stem_slop;
$stem_type = "rounded_cherry";
children();
}
module box_cherry(slop = undef) {
$stem_slop = slop != undef ? slop : $stem_slop;
module box_cherry(slop) {
$stem_slop = slop ? slop : $stem_slop;
$stem_type = "box_cherry";
children();
}

View File

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

View File

@@ -1,18 +1,18 @@
// rounded square shape with additional sculpting functions to better approximate
// 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
corner_sculpting_factor = 1;
$corner_sculpting_factor = 1;
// 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
// 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
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) {
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) {
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,
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) {

View File

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

View File

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

0
tests/empty.scad Normal file
View File

3
tests/test.scad Normal file
View File

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

BIN
tests/test.stl Normal file

Binary file not shown.