From f42566d13a4ca71ff4b2e87824f977b74aee8b9f Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Fri, 22 Jul 2022 18:23:27 -0300 Subject: [PATCH] Started on the hinge --- monitor/{modelo.py => case.py} | 39 +++-------------------- monitor/hinge.py | 49 +++++++++++++++++++++++++++++ monitor/parameters.py | 31 +++++++++++++++++++ monitor/rear_mount.py | 56 ++++++++++++++++++++++++++++++++++ 4 files changed, 140 insertions(+), 35 deletions(-) rename monitor/{modelo.py => case.py} (70%) create mode 100644 monitor/hinge.py create mode 100644 monitor/parameters.py create mode 100644 monitor/rear_mount.py diff --git a/monitor/modelo.py b/monitor/case.py similarity index 70% rename from monitor/modelo.py rename to monitor/case.py index e39e2de..905ad19 100644 --- a/monitor/modelo.py +++ b/monitor/case.py @@ -1,38 +1,7 @@ import cadquery2 as cq from cadquery2 import exporters -# Shell thickness -shell_t = 3.5 - -# width, length VISIBLE WITHIN THE BEZEL -screen_w = 223 -screen_l = 57 -# Distance from the left of the case to screen cutout -screen_left_margin = 7 + shell_t # (7 is bezel width on that side) -# width, length, height INCLUDING_BEZEL -display_w = 233 -display_l = 65 -display_h = 5 - -width = 250 -height = display_h + 2 * shell_t + 1 -length = display_l + 2 * shell_t + 1 -fillet_s = 2 - - -# Distance from the left of the case to display end -display_left_margin = screen_left_margin - 7 -# Distance from the right of the case to display end -display_right_margin = width - display_left_margin - display_w -# Distance from the top of the case to display top -display_top_margin = (length - display_l) / 2 -display_bottom_margin = display_top_margin # Symmetrical - - -# Threaded insert hole dimensions -ti_radius = 2.35 -ti_depth = 6.5 - +from parameters import * screen_cutout = ( cq.Sketch().trapezoid(screen_w, screen_l, 90, mode="a").reset().vertices().fillet(1) @@ -70,8 +39,8 @@ back_reinforcement = ( threaded_inserts = cq.Sketch().rarray(width / 8, 0, 4, 1).circle(ti_radius, mode="a") -# Holder for the screen (other half of the case) -screen_base = ( +# Case for the screen +case = ( # Basic filleted box shape cq.Workplane("bottom") .lineTo(-width, 0) @@ -120,4 +89,4 @@ screen_base = ( .cutBlind(-ti_depth) ) -exporters.export(screen_base, "screen_base.stl") +exporters.export(case, "case.stl") diff --git a/monitor/hinge.py b/monitor/hinge.py new file mode 100644 index 0000000..aceb53a --- /dev/null +++ b/monitor/hinge.py @@ -0,0 +1,49 @@ +import cadquery2 as cq +from cadquery2 import exporters + +from parameters import * + +# M3x20 screw +screw_l = 22 +screw_shaft = 20 +screw_head_h = 2.5 +screw_head_radius = 3.5 +screw_radius = 1.5 + +hinge_s = 7.5 +hinge_t = 5 +hinge_gap = screw_shaft - 2 * hinge_t + +hinge_profile_1 = ( + cq.Sketch() + .segment((0, 0), (0, hinge_s)) + .arc((0, hinge_s), (hinge_s / 2, 1.5 * hinge_s), (hinge_s, hinge_s)) + .segment((hinge_s, 0)) + .close() + .arc((hinge_s / 2, hinge_s), screw_radius, 0, 360) + .assemble() +) + +hinge_profile_2 = ( + cq.Sketch() + .segment((0, 0), (0, hinge_s)) + .arc((0, hinge_s), (hinge_s / 2, 1.5 * hinge_s), (hinge_s, hinge_s)) + .segment((hinge_s, 0)) + .close() + .arc((hinge_s / 2, hinge_s), ti_radius, 0, 360) + .assemble() +) + +# TODO countersink +# TODO proper threaded insert depth sizing + +hinge = ( + cq.Workplane("bottom") + .placeSketch(hinge_profile_1) + .extrude(hinge_t) + .workplane(offset=hinge_gap) + .placeSketch(hinge_profile_2) + .extrude(hinge_t) +) + +exporters.export(hinge, "hinge.stl") diff --git a/monitor/parameters.py b/monitor/parameters.py new file mode 100644 index 0000000..6bbd86e --- /dev/null +++ b/monitor/parameters.py @@ -0,0 +1,31 @@ +# Shell thickness +shell_t = 3.5 + +# width, length VISIBLE WITHIN THE BEZEL +screen_w = 223 +screen_l = 57 +# Distance from the left of the case to screen cutout +screen_left_margin = 7 + shell_t # (7 is bezel width on that side) +# width, length, height INCLUDING_BEZEL +display_w = 233 +display_l = 65 +display_h = 5 + +width = 250 +height = display_h + 2 * shell_t + 1 +length = display_l + 2 * shell_t + 1 +fillet_s = 2 + + +# Distance from the left of the case to display end +display_left_margin = screen_left_margin - 7 +# Distance from the right of the case to display end +display_right_margin = width - display_left_margin - display_w +# Distance from the top of the case to display top +display_top_margin = (length - display_l) / 2 +display_bottom_margin = display_top_margin # Symmetrical + + +# Threaded insert hole dimensions +ti_radius = 2.35 +ti_depth = 6.5 diff --git a/monitor/rear_mount.py b/monitor/rear_mount.py new file mode 100644 index 0000000..a171641 --- /dev/null +++ b/monitor/rear_mount.py @@ -0,0 +1,56 @@ +import cadquery2 as cq +from cadquery2 import exporters + +from parameters import * + +# Small M3x8 screw +screw_l = 10 +screw_shaft = 8 +screw_head_h = 2.5 +screw_head_radius = 3.5 +screw_radius = 1.5 + + +reinforcement_height = 1 + 1 + ti_depth - shell_t + +back_reinforcement_cutout = ( + cq.Sketch() + .trapezoid(width / 2 + 1, 15 + 1, 90, mode="a") + .reset() + .vertices() + .fillet(2) +) + +back_reinforcement_outer = ( + cq.Sketch() + .trapezoid(width / 2 + 2 * shell_t, 15 + 2 * shell_t, 90, mode="a") + .reset() + .vertices() + .fillet(2) +) + +screw_holes = cq.Sketch().rarray(width / 8, 0, 4, 1).circle(screw_radius, mode="a") +screw_countersinks = ( + cq.Sketch().rarray(width / 8, 0, 4, 1).circle(screw_head_radius, mode="a") +) + +rear_mount = ( + # Basic filleted box shape + cq.Workplane("bottom") + .placeSketch(back_reinforcement_outer) + .extrude(reinforcement_height + screw_head_h + shell_t) + .faces(">Y") + .workplane(centerOption="CenterOfBoundBox") + .placeSketch(back_reinforcement_cutout) + .cutBlind(-reinforcement_height) + .faces("