mirror of
https://github.com/rsheldiii/KeyV2.git
synced 2026-01-14 22:37:56 -05:00
Compare commits
12 Commits
github-act
...
v1.1.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0fc43fa0d7 | ||
|
|
fbcf9b2c63 | ||
|
|
edfc02e27b | ||
|
|
65bb577473 | ||
|
|
bf4ee0426a | ||
|
|
42361f5c25 | ||
|
|
7edecd7d67 | ||
|
|
160c47150d | ||
|
|
a1ec4c3cac | ||
|
|
28680924b4 | ||
|
|
8ad81d3b61 | ||
|
|
d62afcd878 |
36
.github/workflows/test.yml
vendored
36
.github/workflows/test.yml
vendored
@@ -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
|
|
||||||
2146
customizer.scad
2146
customizer.scad
File diff suppressed because it is too large
Load Diff
23
src/key.scad
23
src/key.scad
@@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
include <../includes.scad>
|
|
||||||
|
|
||||||
key();
|
|
||||||
BIN
tests/test.stl
BIN
tests/test.stl
Binary file not shown.
Reference in New Issue
Block a user