Skip to content

Commit

Permalink
Two minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
mryndzionek committed Oct 31, 2023
1 parent 9c644f4 commit 45af647
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gen_3dfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def process(fn):
"--outfile", ofp,
"--params", "i:{}".format(fn)])

assert(ret.returncode == 0)
assert ret.returncode == 0, "Failed to gen. 3d file: {}".format(fn)
assert os.path.isfile(ofp), "File {} doesn't exist".format(ofp)

return o_file
Expand Down
10 changes: 6 additions & 4 deletions keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,11 @@ def generate(config: Config, odir='output', switch_mesh=False):
else:
# counterbored holes for threaded inserts
# TODO add dimensions for screws different than M3
insert_len = 4
spacerPlate = spacerPlate.faces("<Z").workplane().pushPoints(shp_bottom).cboreHole(
config.screwHoleDiameter + 0.8, config.screwHoleDiameter + 1.2, 1, 6)
config.screwHoleDiameter + 0.8, config.screwHoleDiameter + 1.2, 1, insert_len)
spacerPlate = spacerPlate.faces("<Z").workplane().pushPoints(
shp_bottom).hole(config.screwHoleDiameter, 6)

if switch_mesh:
switchPlate = meshify(
Expand Down Expand Up @@ -333,9 +336,8 @@ def generate(config: Config, odir='output', switch_mesh=False):
pts = [(shp_bottom[0][0] - 8, shp_bottom[0][1] - 8), (shp_bottom[1][0] + 8,
shp_bottom[1][1] - 8), (shp_bottom[2][0] + 8, shp_bottom[2][1] + 8)]

bottomPlate = bottomPlate.faces("<Z").workplane().pushPoints(
pts).circle(5.5).circle(5).extrude(1).mirror("ZY", union=True)
bottomPlate = bottomPlate.faces("<Z").edges().fillet(0.2)
pts += [(-x, y) for x, y in pts]
bottomPlate = bottomPlate.faces("<Z").pushPoints(pts).hole(10, 0.5)

topPlate = topPlate.faces(">Z").edges().fillet(0.7)
topPlate = spacerPlate\
Expand Down

0 comments on commit 45af647

Please sign in to comment.