diff --git a/guardacosas/modelo.py b/guardacosas/modelo.py new file mode 100644 index 0000000..d1d431a --- /dev/null +++ b/guardacosas/modelo.py @@ -0,0 +1,37 @@ +import cadquery2 as cq +from cadquery2 import exporters + + +# The hole for the "peg" where this goes +peg_front = 9.5 +peg_side = 9 +peg_height = 12 + +# General size of the handle +width = 20 +length = 70 +height = 16 + +# General shape of the handle seen from above + +handle_shape_top = cq.Sketch().trapezoid(width, length, 85).vertices().fillet(3) +hole_shape = cq.Sketch().trapezoid(peg_front, peg_side, 90) +bottom_cutout = cq.Sketch().trapezoid(width, length - width, 90) + +handle = ( + cq.Workplane("XY") + .placeSketch(handle_shape_top) + .extrude(height) + .faces("Z") + .shell(-shell_t) + # Make the lower part solid to mount the kbd + # .faces("Z") + .workplane(centerOption="CenterOfBoundBox") + .center(-width/2, 17) + .transformed(rotate=cq.Vector(kbd_angle, 0, 0)) + .tag("sloped") + .placeSketch(pillars) + .extrude(-1000) + # Remove the excess extrusion + .workplaneFromTagged("mid_height") + .transformed(offset=cq.Vector(0, 0, -thickness / 2)) + .split(keepTop=True) + # Slope for the beyboard + .workplaneFromTagged("sloped") + .split(keepBottom=True) +) + +exporters.export(model, "model.stl")