import cadquery2 as cq from cadquery2 import exporters from parameters import * screen_cutout = ( cq.Sketch().trapezoid(screen_w, screen_l, 90, mode="a").reset().vertices().fillet(1) ) board_cutout = ( cq.Sketch().trapezoid(55, 50, 90, mode="a").reset().vertices("X") .shell(-shell_t) .edges("|X") .fillet(fillet_s) # Cutout room for plugs to slide in and be exposed .faces(">X") .workplane(centerOption="CenterOfBoundBox") .center(0, -5) .placeSketch(plug_cutout) .cutBlind(-width / 2) # Cutout visible screen area from top face .faces(">Z") .workplane(centerOption="CenterOfBoundBox") .center((width - screen_w) / 2 - screen_left_margin, 0) .placeSketch(screen_cutout) .cutBlind(-shell_t) # Cutout for segment breaks .faces(">Z") .workplane(centerOption="CenterOfBoundBox") .center(0, length / 2) .placeSketch(segment_breaks_top) .cutBlind(-1000) .center(0, -length) .placeSketch(segment_breaks_bottom) .cutBlind(-1000) # Cutout for the circuit board .faces("X").workplane(offset=-width / 2).split(keepTop=True) exporters.export(top_case, "case_1.stl") bottom_case = case().faces(">X").workplane(offset=-width / 2).split(keepBottom=True) exporters.export(bottom_case, "case_2.stl")