Skip to content

Commit

Permalink
Just a bunch of small adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
mryndzionek committed Oct 30, 2023
1 parent 399dcdf commit c8587b1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ jobs:
- name: Build
run: |
set -ex
wget https://github.com/CadQuery/cq-cli/releases/download/v2.2-beta.3/cq-cli-Linux-x86_64.zip
unzip cq-cli-Linux-x86_64.zip
chmod u+x cq-cli/cq-cli
python3 -m venv cq-editor
source cq-editor/bin/activate
pip3 install --upgrade pip
pip3 install git+https://github.com/CadQuery/cq-cli.git
mkdir configs
python3 gen_configs.py
python3 gen_3dfiles.py
Expand All @@ -52,4 +53,5 @@ jobs:
name: png
path: |
output/*.png
GALLERY.md
2 changes: 1 addition & 1 deletion gen_3dfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def process(fn):

ofp = os.path.join("output", o_file + ".stl")

ret = subprocess.run(["./cq-cli/cq-cli", "--codec", "stl", "--infile", "keyboard.py",
ret = subprocess.run(["cq-cli", "--codec", "stl", "--infile", "keyboard.py",
"--outfile", ofp,
"--params", "i:{}".format(fn)])

Expand Down
11 changes: 5 additions & 6 deletions gen_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ def __init__(self, nc, nr, cs=19, rs=19, switchHoleSize=13.97,
self.rowSpacing = rs
self.switchHoleSize = switchHoleSize
if not hOffset:
self.hOffset = (self.nRows * self.rowSpacing *
math.sin(math.radians(self.angle))) + 20
if self.hOffset < 35:
self.hOffset = 35
self.hOffset = (self.nRows * (self.rowSpacing + self.switchHoleSize) /
2) * math.sin(math.radians(self.angle)) * 2
if self.hOffset < 45:
self.hOffset = 45
else:
self.hOffset = hOffset
self.plateThickness = plateThickness
Expand All @@ -70,8 +70,7 @@ def update_name(self):
('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)
name2 = str(self.angle) + str(self.staggering)
m = hashlib.sha1()
m.update(name2.encode('utf-8'))
self.name = name + "_" + m.hexdigest()[:7]
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_5b320d0.json'
fn = 'configs/atreus_52l_print_97a7fee.json'

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

0 comments on commit c8587b1

Please sign in to comment.