Refactor, comments

This commit is contained in:
Roberto Alsina 2022-11-25 17:11:31 -03:00
parent bf1f0cc4ce
commit 6e8869363e
4 changed files with 29095 additions and 29102 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
import cadquery2 as cq import cadquery2 as cq
from cadquery2 import exporters from cadquery2 import exporters
# Dimensions copied from modelo.py, # Some dimensions copied from modelo.py,
# TODO refactor into a separate file # TODO refactor into a separate file
# Thickness of the outer material # Thickness of the outer material
@ -28,20 +28,17 @@ scr_h = 65
scr_thickness = 5.5 scr_thickness = 5.5
screen_cutout = cq.Sketch().trapezoid(scr_w, scr_h, 90, mode="a") screen_cutout = cq.Sketch().trapezoid(scr_w, scr_h, 90, mode="a")
# Circuit board and cable space # Circuit board and cable hole.
# This is in the back of the screen, and is a bit shorter in height than the
# screen. It's wider so it removes enough material to make the shape simpler.
board_cutout = cq.Sketch().trapezoid( board_cutout = cq.Sketch().trapezoid(
scr_w,
scr_h - 16,
90,
mode="a",
)
board_cutout_2 = cq.Sketch().trapezoid(
scr_w + 5, scr_w + 5,
scr_h - 10, scr_h - 10,
90, 90,
mode="a", mode="a",
) )
def model(): def model():
return ( return (
cq.Workplane("XY") cq.Workplane("XY")
@ -50,32 +47,28 @@ def model():
.faces(">Z") .faces(">Z")
.transformed(rotate=(45, 0, 0)) .transformed(rotate=(45, 0, 0))
.tag("slanted") .tag("slanted")
# Arbitrary huge trapezoid to cut off the material *in front*
# of the inclined screen
.placeSketch(cq.Sketch().trapezoid(1000, 1000, 90, mode="a")) .placeSketch(cq.Sketch().trapezoid(1000, 1000, 90, mode="a"))
.cutBlind(1000) .cutBlind(1000)
# Cut off viewport # Cut off viewport hole so we can see the screen
.workplaneFromTagged("slanted") .workplaneFromTagged("slanted")
.placeSketch(viewport_cutout) .placeSketch(viewport_cutout)
.cutBlind(-shell_t) .cutBlind(-shell_t)
# Make hole for screen assembly # Make hole for screen assembly so the whole screen fits
.workplaneFromTagged("slanted") .workplaneFromTagged("slanted")
.workplane(offset=-shell_t, centerOption="CenterOfBoundBox") .workplane(offset=-shell_t, centerOption="CenterOfBoundBox")
# Left bezel is 4mm wider than right one, so this hole is displaced to the left # Left bezel is 4mm wider than right one, so this hole is displaced to the left
# Cut for the scren assembly
.center(-4, 0) .center(-4, 0)
.placeSketch(screen_cutout) .placeSketch(screen_cutout)
.cutBlind(-scr_thickness) .cutBlind(-scr_thickness)
# Cut for the screen board and cables
# .workplaneFromTagged("slanted")
# .workplane(offset=-shell_t - scr_thickness, centerOption="CenterOfBoundBox")
# .placeSketch(board_cutout)
# .cutBlind(-1)
# Make it hollow # Make it hollow
.faces("<Z") .faces("<Z")
.shell(-2) .shell(-2)
# Cut AGAIN for the screen board and cables # Cut hole for the screen board and cables
.workplaneFromTagged("slanted") .workplaneFromTagged("slanted")
.workplane(offset=-scr_thickness, centerOption="CenterOfBoundBox") .workplane(offset=-scr_thickness, centerOption="CenterOfBoundBox")
.placeSketch(board_cutout_2) .placeSketch(board_cutout)
.cutBlind(-5) .cutBlind(-5)
) )

File diff suppressed because it is too large Load Diff