diff --git a/notebook_nueva/dimensions.py b/notebook_nueva/dimensions.py index fb28161..bde08b3 100644 --- a/notebook_nueva/dimensions.py +++ b/notebook_nueva/dimensions.py @@ -12,6 +12,11 @@ m3_hn_diam = 5.5 m3_hn_hole = 3 m3_hn_thickness = 2.5 +# Dimensions for countersunk M4 screws +m4_top = 9 +m4_bottom = 4 + + ## Keyboard dimensions kbd_height = 95.5 kbd_width = 305 @@ -93,3 +98,12 @@ hl_hinge_offset = max(p[1] for p in mounting_pillar_positions) + 6 hl_hinge_width = 25 # Base + this lid hl_full_thickness = 43 + + +## Dimensions for the simple lid +sl_lip_thickness = 1.5 +sl_height = ( + max([y for _, y in mounting_pillar_positions]) + 6 + shell_t + sl_lip_thickness +) +sl_thickness = shell_t +sl_front_lip = 8 diff --git a/notebook_nueva/hinged_lid.py b/notebook_nueva/hinged_lid.py index 30e28cf..927926a 100644 --- a/notebook_nueva/hinged_lid.py +++ b/notebook_nueva/hinged_lid.py @@ -3,7 +3,6 @@ from cadquery import exporters import dimensions as dim import keyboard -import screen_mount mounting_pillar_positions = [(x, -y) for x, y in dim.mounting_pillar_positions] mounting_pillars = ( @@ -239,20 +238,20 @@ def model(): .placeSketch( cq.Sketch() .trapezoid( - screen_mount.dim.scr_w + 2 * dim.hl_bezel_width, - screen_mount.dim.scr_h + 2 * dim.hl_bezel_height, + dim.scr_w + 2 * dim.hl_bezel_width, + dim.scr_h + 2 * dim.hl_bezel_height, 90, ) .vertices() .fillet(2) ) - .extrude(-2 - screen_mount.dim.scr_thickness) + .extrude(-2 - dim.scr_thickness) # Hole for screws .workplaneFromTagged("screen_plane") .workplane(offset=1) .rect( - screen_mount.dim.scr_w + 2 * dim.hl_bezel_width - dim.m3_hn_diam - 1, - screen_mount.dim.scr_h + 2 * dim.hl_bezel_height - dim.m3_hn_diam - 1, + dim.scr_w + 2 * dim.hl_bezel_width - dim.m3_hn_diam - 1, + dim.scr_h + 2 * dim.hl_bezel_height - dim.m3_hn_diam - 1, forConstruction=True, ) .vertices() @@ -261,8 +260,8 @@ def model(): .workplaneFromTagged("screen_plane") .workplane(offset=1) .rect( - screen_mount.dim.scr_w + 2 * dim.hl_bezel_width - dim.m3_hn_diam - 1, - screen_mount.dim.scr_h + 2 * dim.hl_bezel_height - dim.m3_hn_diam - 1, + dim.scr_w + 2 * dim.hl_bezel_width - dim.m3_hn_diam - 1, + dim.scr_h + 2 * dim.hl_bezel_height - dim.m3_hn_diam - 1, forConstruction=True, ) .vertices() @@ -271,19 +270,17 @@ def model(): .workplaneFromTagged("screen_plane") .placeSketch( cq.Sketch().trapezoid( - screen_mount.dim.scr_w - 40, - screen_mount.dim.scr_h + 2 * dim.hl_bezel_height, + dim.scr_w - 40, + dim.scr_h + 2 * dim.hl_bezel_height, 90, ) ) .cutBlind(-100) # Hole to place screen .workplaneFromTagged("screen_plane") - .workplane(offset=-screen_mount.dim.scr_thickness - 2) - .placeSketch( - cq.Sketch().trapezoid(screen_mount.dim.scr_w, screen_mount.dim.scr_h, 90) - ) - .cutBlind(screen_mount.dim.scr_thickness) + .workplane(offset=-dim.scr_thickness - 2) + .placeSketch(cq.Sketch().trapezoid(dim.scr_w, dim.scr_h, 90)) + .cutBlind(dim.scr_thickness) ) # Cut off shape of the base @@ -321,25 +318,21 @@ def front_bezel(): .placeSketch( cq.Sketch() .trapezoid( - screen_mount.dim.scr_w - + 2 * dim.hl_bezel_width - + 2 * dim.hl_bezel_thickness, - screen_mount.dim.scr_h - + 2 * dim.hl_bezel_height - + 2 * dim.hl_bezel_thickness, + dim.scr_w + 2 * dim.hl_bezel_width + 2 * dim.hl_bezel_thickness, + dim.scr_h + 2 * dim.hl_bezel_height + 2 * dim.hl_bezel_thickness, 90, ) .vertices() .fillet(2) ) - .extrude(-2 - screen_mount.dim.scr_thickness - dim.hl_bezel_thickness) + .extrude(-2 - dim.scr_thickness - dim.hl_bezel_thickness) .workplaneFromTagged("base") .workplane(offset=-dim.hl_bezel_thickness) .placeSketch( cq.Sketch() .trapezoid( - screen_mount.dim.scr_w + 2 * dim.hl_bezel_width, - screen_mount.dim.scr_h + 2 * dim.hl_bezel_height, + dim.scr_w + 2 * dim.hl_bezel_width, + dim.scr_h + 2 * dim.hl_bezel_height, 90, ) .vertices() @@ -349,8 +342,8 @@ def front_bezel(): # Holes for screws .workplaneFromTagged("base") .rect( - screen_mount.dim.scr_w + 2 * dim.hl_bezel_width - dim.m3_hn_diam - 1, - screen_mount.dim.scr_h + 2 * dim.hl_bezel_height - dim.m3_hn_diam - 1, + dim.scr_w + 2 * dim.hl_bezel_width - dim.m3_hn_diam - 1, + dim.scr_h + 2 * dim.hl_bezel_height - dim.m3_hn_diam - 1, forConstruction=True, ) .vertices() @@ -360,8 +353,8 @@ def front_bezel(): .placeSketch( cq.Sketch() .trapezoid( - screen_mount.dim.vis_w, - screen_mount.dim.vis_h, + dim.vis_w, + dim.vis_h, 90, ) .vertices() @@ -370,13 +363,13 @@ def front_bezel(): .cutBlind("last") # Cable gap .workplaneFromTagged("base") - .workplane(offset=-screen_mount.dim.scr_thickness - dim.hl_bezel_thickness) + .workplane(offset=-dim.scr_thickness - dim.hl_bezel_thickness) .center(0, 10) .placeSketch( cq.Sketch() .trapezoid( - screen_mount.dim.vis_w, - screen_mount.dim.vis_h, + dim.vis_w, + dim.vis_h, 90, ) .vertices() diff --git a/notebook_nueva/hinged_lid.stl b/notebook_nueva/hinged_lid.stl index acf70bc..6311f01 100644 Binary files a/notebook_nueva/hinged_lid.stl and b/notebook_nueva/hinged_lid.stl differ diff --git a/notebook_nueva/hinged_lid.svg b/notebook_nueva/hinged_lid.svg index 8391e69..75431f5 100644 --- a/notebook_nueva/hinged_lid.svg +++ b/notebook_nueva/hinged_lid.svg @@ -6,39 +6,29 @@ height="240.0" > - + - - - + + - - - - - - - - - - + - + + - + - @@ -51,34 +41,38 @@ + + + + + + + + + + + - + + - - - - - - - - - - + + @@ -87,19 +81,34 @@ - + + + + + + + + - + - + + + + + + + + + @@ -108,15 +117,15 @@ - - - + + + @@ -125,7 +134,7 @@ - + @@ -138,17 +147,29 @@ - + + + + + + + + + + + + + + - + + - - @@ -156,48 +177,25 @@ - - + + - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + @@ -206,7 +204,18 @@ - + + + + + + + + + + + + @@ -216,12 +225,32 @@ + + + + + + + + + + + + + + + + + + + + - + @@ -246,13 +275,13 @@ - + + + - - - + @@ -261,22 +290,21 @@ - + + - - - - - + + + @@ -294,16 +322,22 @@ + + - + + + + - - - + + + + @@ -311,37 +345,15 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - @@ -355,26 +367,62 @@ - + + + + + - + + + - - + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + diff --git a/notebook_nueva/left_hinged_lid.stl b/notebook_nueva/left_hinged_lid.stl index 90994e0..5348182 100644 Binary files a/notebook_nueva/left_hinged_lid.stl and b/notebook_nueva/left_hinged_lid.stl differ diff --git a/notebook_nueva/left_screen_mount.stl b/notebook_nueva/left_screen_mount.stl index ac638fd..84a0f8f 100644 Binary files a/notebook_nueva/left_screen_mount.stl and b/notebook_nueva/left_screen_mount.stl differ diff --git a/notebook_nueva/lid.py b/notebook_nueva/lid.py index 16cd769..f8f1a39 100644 --- a/notebook_nueva/lid.py +++ b/notebook_nueva/lid.py @@ -4,41 +4,28 @@ from cadquery import exporters import dimensions as dim from utils import extrude_shape2, hex_vents, punch_hole -# Dimensions for countersunk M4 screws -m4_top = 9 -m4_bottom = 4 - - -lip_thickness = 1.5 -# Position of pillar + shell_t + pillar "radius" + lip -dim.height = ( - max([y for _, y in dim.mounting_pillar_positions]) + 6 + dim.shell_t + lip_thickness -) -thickness = dim.shell_t -front_lip = 8 - def model(): # Create the basic shape of the case lid model = ( cq.Workplane("XY") # Hollow box - .box(dim.width, dim.height, thickness) + .box(dim.width, dim.sl_height, dim.sl_thickness) .edges("|Z and >Y") .fillet(2) ) # Make many holes - vent = hex_vents(size=6, width=dim.width * 0.9, height=dim.height * 0.9)[0] + vent = hex_vents(size=6, width=dim.width * 0.9, height=dim.sl_height * 0.9)[0] model = punch_hole( model=model, face=">Z", w=dim.width, - h=dim.height, + h=dim.sl_height, x_offset=0.05 * dim.width, - y_offset=0.05 * dim.height, + y_offset=0.05 * dim.sl_height, hole=vent, - depth=thickness, + depth=dim.sl_thickness, ) # Add screw holes @@ -47,16 +34,18 @@ def model(): model.faces(">Z") .workplane(centerOption="CenterOfBoundBox") .center( - -dim.width / 2 + position[0], dim.height / 2 - position[1] - dim.shell_t + -dim.width / 2 + position[0], + dim.sl_height / 2 - position[1] - dim.shell_t, ) - .placeSketch(cq.Sketch().circle(m4_top / 2 + 1.5)) - .extrude(-thickness) + .placeSketch(cq.Sketch().circle(dim.m4_top / 2 + 1.5)) + .extrude(-dim.sl_thickness) .faces(">Z") .workplane(centerOption="CenterOfBoundBox") .center( - -dim.width / 2 + position[0], dim.height / 2 - position[1] - dim.shell_t + -dim.width / 2 + position[0], + dim.sl_height / 2 - position[1] - dim.shell_t, ) - .cskHole(m4_bottom, m4_top, 82, depth=None) + .cskHole(dim.m4_bottom, dim.m4_top, 82, depth=None) ) # Add front lip @@ -64,11 +53,11 @@ def model(): model = ( model.faces(">Z") .workplane(centerOption="CenterOfBoundBox") - .center(0, -dim.height / 2 + lip_thickness / 2) + .center(0, -dim.sl_height / 2 + dim.sl_lip_thickness / 2) .placeSketch( - cq.Sketch().trapezoid(dim.width - 2 * dim.shell_t, lip_thickness, 90) + cq.Sketch().trapezoid(dim.width - 2 * dim.shell_t, dim.sl_lip_thickness, 90) ) - .extrude(-front_lip - thickness) + .extrude(-dim.sl_front_lip - dim.sl_thickness) ) return model @@ -76,18 +65,18 @@ def model(): def decorative_cover(): # A decorative thingie to cover the ugly seam in the middle - model = cq.Workplane("XY").box(10, dim.height, 1).edges("|Z").fillet(1) + model = cq.Workplane("XY").box(10, dim.sl_height, 1).edges("|Z").fillet(1) vent = hex_vents( - size=6, width=dim.width * 0.9, height=dim.height * 0.9, density=0.775 + size=6, width=dim.width * 0.9, height=dim.sl_height * 0.9, density=0.775 )[0] model = extrude_shape2( model=model, face=">Z", w=dim.width, - h=dim.height, + h=dim.sl_height, x_offset=0.05 * dim.width, - y_offset=0.05 * dim.height, + y_offset=0.05 * dim.sl_height, hole=vent, depth=3, ) diff --git a/notebook_nueva/right_hinged_lid.stl b/notebook_nueva/right_hinged_lid.stl index 645d30c..f4655d6 100644 Binary files a/notebook_nueva/right_hinged_lid.stl and b/notebook_nueva/right_hinged_lid.stl differ diff --git a/notebook_nueva/right_screen_mount.stl b/notebook_nueva/right_screen_mount.stl index 02ffa2e..301cc97 100644 Binary files a/notebook_nueva/right_screen_mount.stl and b/notebook_nueva/right_screen_mount.stl differ diff --git a/notebook_nueva/screen_mount.stl b/notebook_nueva/screen_mount.stl index 17aeb91..9874bcb 100644 Binary files a/notebook_nueva/screen_mount.stl and b/notebook_nueva/screen_mount.stl differ