Compare commits

..

No commits in common. "539583ac8f0d5dd1c84ad79cc103c8b4a03dab84" and "21faab26d00b068ac6dfae3bb2c6cbd483405ce0" have entirely different histories.

3 changed files with 132 additions and 272 deletions

View File

@ -13,7 +13,7 @@ from modelo import (
shell_t,
)
import screen_mount
from screen_mount import height_bottom
import keyboard
@ -25,7 +25,7 @@ hinge_width = 25
thickness = 43
mounting_pillar_positions = [(x, -y) for x, y in mounting_pillar_positions]
mounting_pillar_positions = [(x, -y) for x, y in mounting_pillar_positions[:-2]]
mounting_pillars = (
cq.Sketch()
.push(mounting_pillar_positions)
@ -48,7 +48,6 @@ def model():
# Hollow box
.workplane(offset=-thickness / 2)
.box(width, height, thickness)
.tag("base")
.edges("|X and >Z and <Y")
.fillet(10)
.edges("|X and >Z and >Y")
@ -64,11 +63,7 @@ def model():
# Outer surface of the hinge
.workplaneFromTagged("rightSide")
.placeSketch(cq.Sketch().circle(hinge_radius))
.extrude(-hinge_width)
.workplaneFromTagged("rightSide")
.workplane(offset=-width + hinge_width)
.placeSketch(cq.Sketch().circle(hinge_radius))
.extrude(-hinge_width)
.extrude(-width)
# Cut middle section between the hinges
.workplaneFromTagged("rightSide")
.workplane(offset=-hinge_width)
@ -87,24 +82,10 @@ def model():
)
)
.cutBlind(-width + 2 * hinge_width - 1)
# Pillars to attach to base
.workplaneFromTagged("base")
.workplane(
centerOption="CenterOfBoundBox", offset=model_thickness - thickness / 2
)
.workplaneFromTagged("base")
.workplane(offset=thickness / 2 - shell_t)
.center(-width / 2, height / 2 - shell_t)
.placeSketch(mounting_pillars)
.extrude(-10)
# Hole for screws
.workplaneFromTagged("rightSide")
.placeSketch(cq.Sketch().circle(screw_radius))
.cutBlind(-hinge_width)
.workplaneFromTagged("rightSide")
.workplane(offset=-width + hinge_width)
.placeSketch(cq.Sketch().circle(screw_radius))
.cutBlind(-hinge_width)
.cutBlind(-width)
# Holes for rings & screw heads
.workplaneFromTagged("rightSide")
.placeSketch(cq.Sketch().circle(ring_radius))
@ -228,45 +209,6 @@ def model():
.cutBlind(-hinge_width / 2 - 1)
)
# Screen mount
model = (
model.workplaneFromTagged("base")
.center(0, -32)
.tag("screen_plane")
.workplane(offset=thickness / 2 - shell_t)
.placeSketch(
cq.Sketch()
.trapezoid(
screen_mount.scr_w + 2 * shell_t, screen_mount.scr_h + 2 * shell_t, 90
)
.vertices()
.fillet(2)
)
.extrude(-9)
.workplaneFromTagged("screen_plane")
.workplane(offset=thickness / 2 - shell_t)
.placeSketch(
cq.Sketch()
.trapezoid(screen_mount.vis_w, screen_mount.vis_h, 90)
.vertices()
.fillet(2)
)
.cutBlind(-9)
.workplaneFromTagged("screen_plane")
.workplane(offset=thickness / 2 - shell_t)
.placeSketch(
cq.Sketch()
.trapezoid(screen_mount.scr_w - 40, screen_mount.scr_h + 2 * shell_t, 90)
.vertices()
.fillet(2)
)
.cutBlind(-9)
.workplaneFromTagged("screen_plane")
.workplane(offset=thickness / 2 - shell_t - screen_mount.scr_thickness - 2)
.placeSketch(cq.Sketch().trapezoid(screen_mount.scr_w, screen_mount.scr_h, 90))
.cutBlind(screen_mount.scr_thickness)
)
# Cut off shape of the base
model = (
@ -289,6 +231,14 @@ def model():
.cutBlind(-1000)
)
model = (
model.faces(">Z")
.workplane(offset=-model_thickness)
.center(-width, height)
.placeSketch(mounting_pillars)
.extrude(10)
)
return model

Binary file not shown.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 153 KiB

After

Width:  |  Height:  |  Size: 102 KiB