Good upper arm

This commit is contained in:
Roberto Alsina 2022-07-23 14:05:21 -03:00
parent 84cb4ee0ed
commit e61be357ee

View File

@ -1,4 +1,4 @@
# This is the arm from the tripod to the "elbow" # This is the arm from the monitor to the "elbow"
import cadquery2 as cq import cadquery2 as cq
from cadquery2 import exporters from cadquery2 import exporters
@ -9,52 +9,46 @@ from hinge import hinge_gap, hinge_w, hinge_profile_1, hinge_profile_2, hinge_t
inner_monitor_hinge = 3.2 / 2 inner_monitor_hinge = 3.2 / 2
outer_monitor_hinge = hinge_w / 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 = ( monitor_hinge_shape = (
cq.Sketch().circle(outer_monitor_hinge).circle(inner_monitor_hinge, mode="s") cq.Sketch().circle(outer_monitor_hinge).circle(inner_monitor_hinge, mode="s")
) )
tripod_hinge_shape = ( # Both hinges are the same shape, just one is outer and the other inner
cq.Sketch().circle(outer_tripod_hinge).circle(inner_tripod_hinge, mode="s") elbow_hinge_shape = (
cq.Sketch().circle(outer_monitor_hinge).circle(inner_monitor_hinge, mode="s")
) )
arm_width = min(tripod_hinge_width, hinge_gap)
arm_length = 150 arm_length = 150
arm_width = hinge_gap
lower_arm = ( lower_arm = (
cq.Workplane("XY") cq.Workplane("XY")
.rect(arm_width, arm_width) .rect(hinge_w, hinge_gap)
.extrude(arm_length) .extrude(arm_length)
.edges("|Z or <Z or >Z") .edges("|Z or <Z or >Z")
.fillet(0.25) .fillet(0.25)
.faces(">Y") .faces(">Y")
# Add hinge that connects to the monitor # Add hinge that connects to the monitor
.workplane( .workplane(centerOption="CenterOfBoundBox")
centerOption="CenterOfBoundBox", offset=(hinge_gap - arm_width) / 2
)
.center(0, arm_length / 2 + (outer_monitor_hinge - inner_monitor_hinge)) .center(0, arm_length / 2 + (outer_monitor_hinge - inner_monitor_hinge))
.placeSketch(monitor_hinge_shape) .placeSketch(monitor_hinge_shape)
.extrude(-hinge_gap) .extrude(-hinge_gap)
.center(0, -(arm_length + outer_tripod_hinge)) .center(0, -(arm_length + outer_monitor_hinge))
# Undo previous offset + new offset # Add hinge that connects to the elbow
.workplane( .transformed(rotate=cq.Vector(0, 0, 180))
offset=-(hinge_gap - arm_width - tripod_hinge_width + arm_width) / 2 .workplane(offset=(20 - arm_width) / 2)
) .center(-hinge_w / 2, 0)
# Add hinge that connects to the tripod .tag("hingeplane")
# Hinge integration
.transformed(rotate=cq.Vector(0, 0, 90))
.center(-hinge_w / 2, 0).tag("hingeplane")
.placeSketch(hinge_profile_1) .placeSketch(hinge_profile_1)
.extrude(-hinge_t) .extrude(-hinge_t)
.workplaneFromTagged("hingeplane") .workplaneFromTagged("hingeplane")
.workplane(offset=-hinge_t - hinge_w) .workplane(offset=-hinge_t - hinge_gap)
.placeSketch(hinge_profile_2) .placeSketch(hinge_profile_2)
.extrude(-hinge_t) .extrude(-hinge_t)
.workplaneFromTagged("hingeplane")
.center(+hinge_w / 2, 0)
.rect(hinge_w, hinge_w + 6)
.extrude(-(2 * hinge_t + hinge_gap))
) )
exporters.export(lower_arm, "upper_arm.stl") exporters.export(lower_arm, "upper_arm.stl")