Started on the hinge

This commit is contained in:
Roberto Alsina 2022-07-22 18:23:27 -03:00
parent 265d50e329
commit f42566d13a
4 changed files with 140 additions and 35 deletions

View File

@ -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")

49
monitor/hinge.py Normal file
View File

@ -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")

31
monitor/parameters.py Normal file
View File

@ -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

56
monitor/rear_mount.py Normal file
View File

@ -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("<Y")
.workplane(centerOption="CenterOfBoundBox")
.placeSketch(screw_holes)
.cutBlind(-1000)
.faces("<Y")
.workplane(centerOption="CenterOfBoundBox")
.placeSketch(screw_countersinks)
.cutBlind(-screw_head_h)
)
exporters.export(rear_mount, "rear_mount.stl")