merged
This commit is contained in:
commit
0b605c19fe
@ -10,33 +10,31 @@ screw_head_h = 2.5
|
|||||||
screw_head_radius = 3.5
|
screw_head_radius = 3.5
|
||||||
screw_radius = 1.5
|
screw_radius = 1.5
|
||||||
|
|
||||||
hinge_s = 7.5
|
hinge_w = 7.5
|
||||||
hinge_t = 5
|
hinge_h = 15
|
||||||
|
hinge_t = ti_depth - 1
|
||||||
hinge_gap = screw_shaft - 2 * hinge_t
|
hinge_gap = screw_shaft - 2 * hinge_t
|
||||||
|
# The side of the screw head
|
||||||
hinge_profile_1 = (
|
hinge_profile_1 = (
|
||||||
cq.Sketch()
|
cq.Sketch()
|
||||||
.segment((0, 0), (0, hinge_s))
|
.segment((0, 0), (0, hinge_h))
|
||||||
.arc((0, hinge_s), (hinge_s / 2, 1.5 * hinge_s), (hinge_s, hinge_s))
|
.arc((0, hinge_h), (hinge_w / 2, hinge_h + hinge_w / 2), (hinge_w, hinge_h))
|
||||||
.segment((hinge_s, 0))
|
.segment((hinge_w, 0))
|
||||||
.close()
|
.close()
|
||||||
.arc((hinge_s / 2, hinge_s), screw_radius, 0, 360)
|
.arc((hinge_w / 2, hinge_h), screw_radius, 0, 360)
|
||||||
.assemble()
|
.assemble()
|
||||||
)
|
)
|
||||||
|
|
||||||
hinge_profile_2 = (
|
hinge_profile_2 = (
|
||||||
cq.Sketch()
|
cq.Sketch()
|
||||||
.segment((0, 0), (0, hinge_s))
|
.segment((0, 0), (0, hinge_h))
|
||||||
.arc((0, hinge_s), (hinge_s / 2, 1.5 * hinge_s), (hinge_s, hinge_s))
|
.arc((0, hinge_h), (hinge_w / 2, hinge_h + hinge_w / 2), (hinge_w, hinge_h))
|
||||||
.segment((hinge_s, 0))
|
.segment((hinge_w, 0))
|
||||||
.close()
|
.close()
|
||||||
.arc((hinge_s / 2, hinge_s), ti_radius, 0, 360)
|
.arc((hinge_w / 2, hinge_h), ti_radius, 0, 360)
|
||||||
.assemble()
|
.assemble()
|
||||||
)
|
)
|
||||||
|
|
||||||
# TODO countersink
|
|
||||||
# TODO proper threaded insert depth sizing
|
|
||||||
|
|
||||||
hinge = (
|
hinge = (
|
||||||
cq.Workplane("bottom")
|
cq.Workplane("bottom")
|
||||||
.placeSketch(hinge_profile_1)
|
.placeSketch(hinge_profile_1)
|
||||||
@ -46,4 +44,4 @@ hinge = (
|
|||||||
.extrude(hinge_t)
|
.extrude(hinge_t)
|
||||||
)
|
)
|
||||||
|
|
||||||
exporters.export(hinge, "hinge.stl")
|
# exporters.export(hinge, "hinge.stl")
|
||||||
|
49
monitor/lower_arm.py
Normal file
49
monitor/lower_arm.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# This is the arm from the tripod to the "elbow"
|
||||||
|
|
||||||
|
import cadquery2 as cq
|
||||||
|
from cadquery2 import exporters
|
||||||
|
|
||||||
|
from hinge import hinge_gap, hinge_w
|
||||||
|
|
||||||
|
# monitor hinge dimensions
|
||||||
|
inner_monitor_hinge = 3.2 / 2
|
||||||
|
outer_monitor_hinge = hinge_w / 2
|
||||||
|
|
||||||
|
# tripod hinge dimensions
|
||||||
|
inner_tripod_hinge = 7.5 / 2
|
||||||
|
outer_tripod_hinge = 17.5 / 2
|
||||||
|
tripod_hinge_width = 5.5
|
||||||
|
|
||||||
|
|
||||||
|
monitor_hinge_shape = (
|
||||||
|
cq.Sketch().circle(outer_monitor_hinge).circle(inner_monitor_hinge, mode="s")
|
||||||
|
)
|
||||||
|
|
||||||
|
tripod_hinge_shape = (
|
||||||
|
cq.Sketch().circle(outer_tripod_hinge).circle(inner_tripod_hinge, mode="s")
|
||||||
|
)
|
||||||
|
|
||||||
|
arm_width = min(tripod_hinge_width, hinge_gap)
|
||||||
|
arm_length = 150
|
||||||
|
|
||||||
|
lower_arm = (
|
||||||
|
cq.Workplane("XY")
|
||||||
|
.rect(arm_width, arm_width)
|
||||||
|
.extrude(arm_length)
|
||||||
|
.edges("|Z or <Z or >Z")
|
||||||
|
.fillet(0.25)
|
||||||
|
.faces(">Y")
|
||||||
|
# Add hinge that connects to the monitor
|
||||||
|
.workplane(centerOption="CenterOfBoundBox", offset=(hinge_gap - arm_width) / 2)
|
||||||
|
.center(0, arm_length / 2 + (outer_monitor_hinge - inner_monitor_hinge))
|
||||||
|
.placeSketch(monitor_hinge_shape)
|
||||||
|
.extrude(-hinge_gap)
|
||||||
|
.center(0, -(arm_length + outer_tripod_hinge))
|
||||||
|
# Undo previous offset + new offset
|
||||||
|
.workplane(offset=-(hinge_gap - arm_width - tripod_hinge_width + arm_width) / 2)
|
||||||
|
# Add hinge that connects to the tripod
|
||||||
|
.placeSketch(tripod_hinge_shape)
|
||||||
|
.extrude(-tripod_hinge_width)
|
||||||
|
)
|
||||||
|
|
||||||
|
exporters.export(lower_arm, "lower_arm.stl")
|
@ -10,9 +10,13 @@ screw_head_h = 2.5
|
|||||||
screw_head_radius = 3.5
|
screw_head_radius = 3.5
|
||||||
screw_radius = 1.5
|
screw_radius = 1.5
|
||||||
|
|
||||||
|
from hinge import hinge_profile_1, hinge_profile_2, hinge_t, hinge_gap, hinge_w
|
||||||
|
|
||||||
reinforcement_height = 1 + 1 + ti_depth - shell_t
|
reinforcement_height = 1 + 1 + ti_depth - shell_t
|
||||||
|
|
||||||
|
rear_mount_thickness = reinforcement_height + screw_head_h + shell_t
|
||||||
|
rear_mount_width = width / 2 + 2 * shell_t
|
||||||
|
|
||||||
back_reinforcement_cutout = (
|
back_reinforcement_cutout = (
|
||||||
cq.Sketch()
|
cq.Sketch()
|
||||||
.trapezoid(width / 2 + 1, 15 + 1, 90, mode="a")
|
.trapezoid(width / 2 + 1, 15 + 1, 90, mode="a")
|
||||||
@ -23,22 +27,25 @@ back_reinforcement_cutout = (
|
|||||||
|
|
||||||
back_reinforcement_outer = (
|
back_reinforcement_outer = (
|
||||||
cq.Sketch()
|
cq.Sketch()
|
||||||
.trapezoid(width / 2 + 2 * shell_t, 15 + 2 * shell_t, 90, mode="a")
|
.trapezoid(rear_mount_width, 15 + 2 * shell_t, 90, mode="a")
|
||||||
.reset()
|
.reset()
|
||||||
.vertices()
|
.vertices()
|
||||||
.fillet(2)
|
.fillet(2)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# FIXME: use counterbore holes function instead
|
||||||
|
|
||||||
screw_holes = cq.Sketch().rarray(width / 8, 0, 4, 1).circle(screw_radius, mode="a")
|
screw_holes = cq.Sketch().rarray(width / 8, 0, 4, 1).circle(screw_radius, mode="a")
|
||||||
screw_countersinks = (
|
screw_countersinks = (
|
||||||
cq.Sketch().rarray(width / 8, 0, 4, 1).circle(screw_head_radius, mode="a")
|
cq.Sketch().rarray(width / 8, 0, 4, 1).circle(screw_head_radius, mode="a")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
rear_mount = (
|
rear_mount = (
|
||||||
# Basic filleted box shape
|
# Basic filleted box shape
|
||||||
cq.Workplane("bottom")
|
cq.Workplane("bottom")
|
||||||
.placeSketch(back_reinforcement_outer)
|
.placeSketch(back_reinforcement_outer)
|
||||||
.extrude(reinforcement_height + screw_head_h + shell_t)
|
.extrude(rear_mount_thickness)
|
||||||
.faces(">Y")
|
.faces(">Y")
|
||||||
.workplane(centerOption="CenterOfBoundBox")
|
.workplane(centerOption="CenterOfBoundBox")
|
||||||
.placeSketch(back_reinforcement_cutout)
|
.placeSketch(back_reinforcement_cutout)
|
||||||
@ -51,6 +58,18 @@ rear_mount = (
|
|||||||
.workplane(centerOption="CenterOfBoundBox")
|
.workplane(centerOption="CenterOfBoundBox")
|
||||||
.placeSketch(screw_countersinks)
|
.placeSketch(screw_countersinks)
|
||||||
.cutBlind(-screw_head_h)
|
.cutBlind(-screw_head_h)
|
||||||
|
# Hinge integration
|
||||||
|
.faces(">X")
|
||||||
|
.workplane(centerOption="CenterOfBoundBox", offset=-(rear_mount_width - 20) / 2)
|
||||||
|
.transformed(rotate=cq.Vector(0, 0, 90))
|
||||||
|
.center(-hinge_w / 2, rear_mount_thickness / 2)
|
||||||
|
.tag("hingeplane")
|
||||||
|
.placeSketch(hinge_profile_1)
|
||||||
|
.extrude(-hinge_t)
|
||||||
|
.workplaneFromTagged("hingeplane")
|
||||||
|
.workplane(offset=-hinge_t - hinge_gap)
|
||||||
|
.placeSketch(hinge_profile_2)
|
||||||
|
.extrude(-hinge_t)
|
||||||
)
|
)
|
||||||
|
|
||||||
exporters.export(rear_mount, "rear_mount.stl")
|
exporters.export(rear_mount, "rear_mount.stl")
|
||||||
|
54
monitor/upper_arm.py
Normal file
54
monitor/upper_arm.py
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
# This is the arm from the monitor to the "elbow"
|
||||||
|
|
||||||
|
import cadquery2 as cq
|
||||||
|
from cadquery2 import exporters
|
||||||
|
|
||||||
|
from hinge import hinge_gap, hinge_w, hinge_profile_1, hinge_profile_2, hinge_t
|
||||||
|
|
||||||
|
# monitor hinge dimensions
|
||||||
|
inner_monitor_hinge = 3.2 / 2
|
||||||
|
outer_monitor_hinge = hinge_w / 2
|
||||||
|
|
||||||
|
monitor_hinge_shape = (
|
||||||
|
cq.Sketch().circle(outer_monitor_hinge).circle(inner_monitor_hinge, mode="s")
|
||||||
|
)
|
||||||
|
|
||||||
|
# Both hinges are the same shape, just one is outer and the other inner
|
||||||
|
elbow_hinge_shape = (
|
||||||
|
cq.Sketch().circle(outer_monitor_hinge).circle(inner_monitor_hinge, mode="s")
|
||||||
|
)
|
||||||
|
|
||||||
|
arm_length = 150
|
||||||
|
arm_width = hinge_gap
|
||||||
|
|
||||||
|
upper_arm = (
|
||||||
|
cq.Workplane("XY")
|
||||||
|
.rect(hinge_w, hinge_gap)
|
||||||
|
.extrude(arm_length)
|
||||||
|
.edges("|Z or <Z or >Z")
|
||||||
|
.fillet(0.25)
|
||||||
|
.faces(">Y")
|
||||||
|
# Add hinge that connects to the monitor
|
||||||
|
.workplane(centerOption="CenterOfBoundBox")
|
||||||
|
.center(0, arm_length / 2 + (outer_monitor_hinge - inner_monitor_hinge))
|
||||||
|
.placeSketch(monitor_hinge_shape)
|
||||||
|
.extrude(-hinge_gap)
|
||||||
|
.center(0, -(arm_length + outer_monitor_hinge))
|
||||||
|
# Add hinge that connects to the elbow
|
||||||
|
.transformed(rotate=cq.Vector(0, 0, 180))
|
||||||
|
.workplane(offset=(20 - arm_width) / 2)
|
||||||
|
.center(-hinge_w / 2, 0)
|
||||||
|
.tag("hingeplane")
|
||||||
|
.placeSketch(hinge_profile_1)
|
||||||
|
.extrude(-hinge_t)
|
||||||
|
.workplaneFromTagged("hingeplane")
|
||||||
|
.workplane(offset=-hinge_t - hinge_gap)
|
||||||
|
.placeSketch(hinge_profile_2)
|
||||||
|
.extrude(-hinge_t)
|
||||||
|
.workplaneFromTagged("hingeplane")
|
||||||
|
.center(+hinge_w / 2, 0)
|
||||||
|
.rect(hinge_w, hinge_w + 6)
|
||||||
|
.extrude(-(2 * hinge_t + hinge_gap))
|
||||||
|
)
|
||||||
|
|
||||||
|
exporters.export(upper_arm, "upper_arm.stl")
|
Loading…
Reference in New Issue
Block a user