Compare commits
No commits in common. "e9b3a425649c3c7f9faf7c3258559ed3aa6b4cf2" and "c5b2d68518e379fefd77a9d7bd9772a43172045a" have entirely different histories.
e9b3a42564
...
c5b2d68518
@ -1,28 +1,31 @@
|
|||||||
import cadquery2 as cq
|
import cadquery2 as cq
|
||||||
from cadquery2 import exporters
|
from cadquery2 import exporters
|
||||||
|
|
||||||
|
|
||||||
lower_stands = (
|
lower_stands = (
|
||||||
cq.Sketch().push([(0, 0), (58, 0), (58, 23), (0, 23)]).circle(3, mode="a")
|
cq.Sketch()
|
||||||
|
.push([(0,0), (58, 0), (58, 23), (0, 23)])
|
||||||
|
.circle(5, mode="a")
|
||||||
)
|
)
|
||||||
|
|
||||||
higher_stands = (
|
higher_stands = (
|
||||||
cq.Sketch().push([(0, 0), (58, 0), (58, 23), (0, 23)]).circle(2.65 / 2, mode="a")
|
cq.Sketch()
|
||||||
|
.push([(0,0), (58, 0), (58, 23), (0, 23)])
|
||||||
|
.circle(2.65, mode="a")
|
||||||
)
|
)
|
||||||
|
|
||||||
model = (
|
model = (
|
||||||
cq.Workplane("XY")
|
cq.Workplane("XY")
|
||||||
.workplane()
|
.workplane()
|
||||||
.box(75, 40, 2)
|
.box(75, 40, 2)
|
||||||
.edges("+Z")
|
|
||||||
.fillet(3)
|
|
||||||
.faces(">Z")
|
.faces(">Z")
|
||||||
.workplane(centerOption="CenterOfBoundBox")
|
.workplane(centerOption="CenterOfBoundBox")
|
||||||
.center(-29, -11.5)
|
.center(-29, -11.5)
|
||||||
.placeSketch(lower_stands)
|
.placeSketch(lower_stands)
|
||||||
.extrude(4)
|
.extrude(3)
|
||||||
.workplane()
|
.workplane()
|
||||||
.placeSketch(higher_stands)
|
.placeSketch(higher_stands)
|
||||||
.extrude(9)
|
.extrude(8)
|
||||||
)
|
)
|
||||||
|
|
||||||
exporters.export(model, "cpu_holder.stl")
|
exporters.export(model, "cpu_holder.stl")
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,121 +0,0 @@
|
|||||||
import cadquery2 as cq
|
|
||||||
from cadquery2 import exporters
|
|
||||||
|
|
||||||
# Dimensions copied from modelo.py,
|
|
||||||
# TODO refactor into a separate file
|
|
||||||
|
|
||||||
# Thickness of the outer material
|
|
||||||
shell_t = 3
|
|
||||||
|
|
||||||
# Size of the kbd board
|
|
||||||
kbd_height = 98
|
|
||||||
kbd_width = 286
|
|
||||||
kbd_angle = 5
|
|
||||||
|
|
||||||
# Size of the whole object
|
|
||||||
width = kbd_width + 2 * shell_t
|
|
||||||
height = 69
|
|
||||||
thickness = 10
|
|
||||||
|
|
||||||
# Visible screen size
|
|
||||||
vis_w = 220
|
|
||||||
vis_h = 58
|
|
||||||
viewport_cutout = cq.Sketch().trapezoid(vis_w, vis_h, 90, mode="a")
|
|
||||||
|
|
||||||
# Whole screen size
|
|
||||||
scr_w = 231
|
|
||||||
scr_h = 65
|
|
||||||
scr_thickness = 5.5
|
|
||||||
screen_cutout = cq.Sketch().trapezoid(scr_w, scr_h, 90, mode="a")
|
|
||||||
|
|
||||||
# Circuit board and cable space
|
|
||||||
board_cutout = cq.Sketch().polygon(
|
|
||||||
[
|
|
||||||
(0, 0),
|
|
||||||
(width / 2 - 10, 0),
|
|
||||||
(width / 2 - 10, vis_h - 20),
|
|
||||||
(0, vis_h - 20),
|
|
||||||
(0, 0),
|
|
||||||
],
|
|
||||||
mode="a",
|
|
||||||
)
|
|
||||||
board_cutout_2 = cq.Sketch().polygon(
|
|
||||||
[
|
|
||||||
(0, 0),
|
|
||||||
(width / 2 - 10 + 4, 0),
|
|
||||||
(width / 2 - 10 + 4, vis_h - 20 + 4),
|
|
||||||
(0, vis_h - 20 + 4),
|
|
||||||
(0, 0),
|
|
||||||
],
|
|
||||||
mode="a",
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def model():
|
|
||||||
return (
|
|
||||||
cq.Workplane("XY")
|
|
||||||
.workplane()
|
|
||||||
.box(width, 59, 59)
|
|
||||||
.faces(">Z")
|
|
||||||
.transformed(rotate=(45, 0, 0))
|
|
||||||
.tag("slanted")
|
|
||||||
.placeSketch(cq.Sketch().trapezoid(1000, 1000, 90, mode="a"))
|
|
||||||
.cutBlind(1000)
|
|
||||||
# Cut off viewport
|
|
||||||
.workplaneFromTagged("slanted")
|
|
||||||
.placeSketch(viewport_cutout)
|
|
||||||
.cutBlind(-shell_t)
|
|
||||||
# Make hole for screen assembly
|
|
||||||
.workplaneFromTagged("slanted")
|
|
||||||
.workplane(offset=-shell_t, centerOption="CenterOfBoundBox")
|
|
||||||
# Left bezel is 4mm wider than right one, so this hole is displaced to the left
|
|
||||||
# Cut for the scren assembly
|
|
||||||
.center(-4, 0)
|
|
||||||
.placeSketch(screen_cutout)
|
|
||||||
.cutBlind(-scr_thickness)
|
|
||||||
# Cut for the screen board and cables
|
|
||||||
.workplaneFromTagged("slanted")
|
|
||||||
.workplane(offset=-shell_t - scr_thickness, centerOption="CenterOfBoundBox")
|
|
||||||
.center(0, -(vis_h - 20) / 2)
|
|
||||||
.placeSketch(board_cutout)
|
|
||||||
.cutBlind(-5)
|
|
||||||
# Make it hollow
|
|
||||||
.faces("<Z")
|
|
||||||
.shell(-2)
|
|
||||||
# Cut AGAIN for the screen board and cables
|
|
||||||
.workplaneFromTagged("slanted")
|
|
||||||
.workplane(offset=-shell_t - scr_thickness, centerOption="CenterOfBoundBox")
|
|
||||||
.center(0, -(vis_h -20 + 4) / 2)
|
|
||||||
.placeSketch(board_cutout_2)
|
|
||||||
.cutBlind(-7)
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
exporters.export(model(), "screen_mount.stl")
|
|
||||||
|
|
||||||
left_cutout = cq.Sketch().polygon(
|
|
||||||
[(0, 0), (160, 0), (160, -100), (0, -100), (0, 0)],
|
|
||||||
mode="a",
|
|
||||||
)
|
|
||||||
|
|
||||||
right_side = (
|
|
||||||
model()
|
|
||||||
.faces("<Z")
|
|
||||||
.workplane(centerOption="CenterOfBoundBox", offset=3)
|
|
||||||
.center(-width / 2, height / 2)
|
|
||||||
.placeSketch(left_cutout)
|
|
||||||
.cutBlind(-100)
|
|
||||||
)
|
|
||||||
|
|
||||||
exporters.export(right_side, "right_screen_mount.stl")
|
|
||||||
|
|
||||||
left_side = (
|
|
||||||
model()
|
|
||||||
.faces("<Z")
|
|
||||||
.workplane(centerOption="CenterOfBoundBox", offset=3)
|
|
||||||
.center(0, height / 2)
|
|
||||||
.placeSketch(left_cutout)
|
|
||||||
.cutBlind(-100)
|
|
||||||
)
|
|
||||||
|
|
||||||
exporters.export(left_side, "left_screen_mount.stl")
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user