Skip to content

Commit

Permalink
Some small file naming adjustments + one more config
Browse files Browse the repository at this point in the history
  • Loading branch information
mryndzionek committed Oct 30, 2023
1 parent 6f23ac6 commit 399dcdf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions gen_configs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import math
import hashlib

import json
from enum import IntEnum
from typing import Optional, Tuple
import math


class Shape(IntEnum):
Expand Down Expand Up @@ -62,12 +64,17 @@ def __init__(self, nc, nr, cs=19, rs=19, switchHoleSize=13.97,
self.mcu_footprint = mcu_footprint

def update_name(self):
self.name = 'atreus_{}{}_{}'.format(
name = 'atreus_{}{}_{}'.format(
2 * (self.nCols * self.nRows +
(len(self.thumbKeys) if self.thumbKeys else 0)),
('h' if self.shape == Shape.HULL else 'l') +
('s' if self.split else ''),
'cnc' if self.cnc else 'print')
name2 = str(self.hOffset) + \
str(self.angle) + str(self.staggering)
m = hashlib.sha1()
m.update(name2.encode('utf-8'))
self.name = name + "_" + m.hexdigest()[:7]


configs = [
Expand All @@ -90,14 +97,18 @@ def update_name(self):
Config(6, 3, hOffset=50, angle=18.5,
staggering=[8, 0, 5, 11, 6, 3, 2],
thumbKeys=[(-1, -1), (0, -1), (-1, -2), (1, -1)]),

Config(6, 4, angle=18.5,
staggering=[0, 5, 11, 6, 3, 2]),

Config(6, 4, angle=18.5,
staggering=[0, 0, 5, 11, 6, 3, 2],
thumbKeys=[(-1, 0), (1, -1)]),

Config(6, 4, hOffset=55, angle=15.0,
staggering=[-12, 0, 5, 11, 6, 3, 2],
thumbKeys=[(-1, 0), (-1, 1)]),

# # some bigger edge case :)
Config(10, 10, angle=18.5,
staggering=[0, 0, 5, 11, 6, 3, 2],
Expand Down
2 changes: 1 addition & 1 deletion keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def generate(config: Config, odir='output', switch_mesh=False):
if len(sys.argv) > 1:
fn = sys.argv[-1].split(':')[-1]
else:
fn = 'configs/atreus_52l_print.json'
fn = 'configs/atreus_52l_print_5b320d0.json'

with open(fn, 'r', encoding='utf-8') as f:
def config(): return None
Expand Down

0 comments on commit 399dcdf

Please sign in to comment.