summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2024-08-15 02:06:49 +0200
committerLouis Burda <quent.burda@gmail.com>2024-08-15 02:06:49 +0200
commitaeb9844a224d45bc8b228381c28a5d4594414725 (patch)
tree1089d20ac57b751889bc9859c65bd7a2b2d8ac66
parent67b90d330bab091e40a93855b2874377dcf272d6 (diff)
downloaddesk-andon-aeb9844a224d45bc8b228381c28a5d4594414725.tar.gz
desk-andon-aeb9844a224d45bc8b228381c28a5d4594414725.zip
Adjust usbc board dimensions and move into wall for access
-rw-r--r--model/main.py30
1 files changed, 19 insertions, 11 deletions
diff --git a/model/main.py b/model/main.py
index 35ee36a..cfeb514 100644
--- a/model/main.py
+++ b/model/main.py
@@ -5,7 +5,7 @@ from math import sin, cos, pi
if "show_object" not in globals():
show_object = lambda v: ()
-nothing = 0.0001
+nothing = 0.00001
origin = (0, 0, 0)
XY = Workplane("XY")
center_xy = (True, True, False)
@@ -63,15 +63,19 @@ def build_usbc(width, height, depth, tol):
bounds = gen(tol).translate((0, -height / 2, 0)).rotate(origin, (1, 0, 0), -90)
return Ext(part, bounds)
-def build_usbc_board(board, usbc, tol, usbc_overhang, hole_radius, hole_offset, bolt_radius, bolt_depth):
+def build_usbc_board(board, usbc, tol, usbc_overhang, hole_radius, hole_offset,
+ bolt_radius, bolt_head_radius, bolt_depth, usbc_height):
def gen(tol):
part = box(*(board + V3(tol, tol, tol) * 2).xyz()).translate((0, 0, -tol))
part_usbc = build_usbc(**usbc.__dict__)
if tol != 0:
part_usbc = part_usbc.bounds
- part = part.union(part_usbc.rotate(origin, (0, 0, 1), 180).translate((0, board.y / 2 + usbc_overhang, board.z)))
+ part = part.union(part_usbc.rotate(origin, (0, 0, 1), 180)\
+ .translate((0, board.y / 2 + usbc_overhang, usbc_height)))
for x in (-1, 1):
if tol != 0:
+ part = part.union(cylinder(bolt_head_radius, 10)
+ .translate((x * (board.x / 2 - hole_offset), board.y / 2 - hole_offset, board.z + tol)))
part = part.union(cylinder(bolt_radius, board.z + 2 * tol + bolt_depth)
.translate((x * (board.x / 2 - hole_offset), board.y / 2 - hole_offset, -tol-bolt_depth)))
else:
@@ -135,7 +139,7 @@ def build_antenna(radius, height, top_offset, top_space, top_radius, tol, hex_he
return part
return Ext(gen(0), gen(tol))
-def build_base(base, rod, rod_shaft, usbc_board, bolt, wall, tol, lid):
+def build_base(base, rod, rod_shaft, usbc_board, bolt, wall, tol, lid, debug=False):
outer = base
inner = outer - V3(2 * wall.x, 2 * wall.y, wall.z) + V21(tol)
@@ -190,7 +194,7 @@ def build_base(base, rod, rod_shaft, usbc_board, bolt, wall, tol, lid):
part = part.cut(build_lid(**lid.__dict__).bounds.translate((0, 0, base.z - lid.base.z)))
board_hole = V(outer = 3, inner = 2.9 / 2 + tol, height = 4)
- board_space = V3(40 - wall.x, 60, 0)
+ board_space = V3(40 - wall.x, 50, 0)
print("Board Space", board_space)
board_space_inner = board_space - V3(2 * board_hole.outer, 2 * board_hole.outer, 0)
board_center = V3(0, -inner.y / 2 + board_space.y / 2, floor)
@@ -203,8 +207,12 @@ def build_base(base, rod, rod_shaft, usbc_board, bolt, wall, tol, lid):
part = part.cut(cylinder(board_hole.inner, board_hole.height).translate(pos.xyz()))
part_usbc = build_usbc_board(**usbc_board.__dict__)
- part = part.union(box(usbc_board.board.x, usbc_board.board.y, 4).translate((0, inner.y / 2 - usbc_board.board.y / 2, floor)))
- part = part.cut(part_usbc.bounds.translate((0, inner.y / 2, floor + 4)))
+ usbc_board_pos = V3(0, outer.y / 2 - usbc_board.usbc_overhang, floor + 4)
+ part = part.union(box(usbc_board.board.x, usbc_board.board.y, 4)\
+ .translate((usbc_board_pos - V3(0, usbc_board.board.y / 2, 4)).xyz()))
+ part = part.cut(part_usbc.bounds.translate(usbc_board_pos.xyz()))
+ if debug:
+ part = part.union(part_usbc.translate(usbc_board_pos.xyz()))
return part
@@ -303,7 +311,7 @@ def main():
usbc = V(width = 9, height = 3, depth = 7.3, tol = tol)
usbc_board = V(usbc = usbc, board = V3(22, 13, 2), usbc_overhang = 1,
hole_radius = 3.2/2, hole_offset = 2.8, tol = tol,
- bolt_radius = 3/2, bolt_depth = 4)
+ bolt_radius = 3/2, bolt_head_radius = 3, bolt_depth = 4, usbc_height = 1.60)
#show_object(build_rod(rod).translate((0, 0, 10)))
@@ -311,14 +319,14 @@ def main():
#show_object(build_sheath(**sheath_ctx.__dict__).translate((-100, 0, 0)))
lid_ctx = V(base=lid, rod=rod, rod_shaft=rod_shaft,
- wall=thin_wall, bolt=bolt, bolt_depth=bolt_depth, tol=tol,
+ wall=thin_wall, bolt=bolt, bolt_depth=bolt_depth, tol=tol*2,
hole_spacing=lid_hole_spacing, oled=oled, oled_offset=V3(0, 20, 0),
antenna=antenna, antenna_offset=V3(-30, 20, 0))
- show_object(build_lid(**lid_ctx.__dict__).translate((0, 0, 50)))
+ #show_object(build_lid(**lid_ctx.__dict__).translate((0, 0, 50)))
base_ctx = V(base=base, rod=rod, rod_shaft=rod_shaft, bolt=bolt,
wall=base_wall, tol=tol, usbc_board=usbc_board)
- #show_object(build_base(**base_ctx.__dict__, lid=lid_ctx))
+ show_object(build_base(**base_ctx.__dict__, lid=lid_ctx))
#show_object(build_oled(**oled.__dict__))