diff --git a/notebook_nueva/hinged_lid.py b/notebook_nueva/hinged_lid.py index ec83b5c..3c6d7c6 100644 --- a/notebook_nueva/hinged_lid.py +++ b/notebook_nueva/hinged_lid.py @@ -25,7 +25,7 @@ hinge_width = 25 thickness = 43 -mounting_pillar_positions = [(x, -y) for x, y in mounting_pillar_positions[:-2]] +mounting_pillar_positions = [(x, -y) for x, y in mounting_pillar_positions] mounting_pillars = ( cq.Sketch() .push(mounting_pillar_positions) @@ -48,6 +48,7 @@ def model(): # Hollow box .workplane(offset=-thickness / 2) .box(width, height, thickness) + .tag("base") .edges("|X and >Z and Z and >Y") @@ -63,7 +64,11 @@ def model(): # Outer surface of the hinge .workplaneFromTagged("rightSide") .placeSketch(cq.Sketch().circle(hinge_radius)) - .extrude(-width) + .extrude(-hinge_width) + .workplaneFromTagged("rightSide") + .workplane(offset=-width + hinge_width) + .placeSketch(cq.Sketch().circle(hinge_radius)) + .extrude(-hinge_width) # Cut middle section between the hinges .workplaneFromTagged("rightSide") .workplane(offset=-hinge_width) @@ -82,10 +87,22 @@ def model(): ) ) .cutBlind(-width + 2 * hinge_width - 1) + # Pillars to attach to base + .workplaneFromTagged("base") + .workplane( + centerOption="CenterOfBoundBox", offset=model_thickness - thickness / 2 + ) + .center(-width / 2, height / 2 - shell_t) + .placeSketch(mounting_pillars) + .extrude(10) # Hole for screws .workplaneFromTagged("rightSide") .placeSketch(cq.Sketch().circle(screw_radius)) - .cutBlind(-width) + .cutBlind(-hinge_width) + .workplaneFromTagged("rightSide") + .workplane(offset=-width + hinge_width) + .placeSketch(cq.Sketch().circle(screw_radius)) + .cutBlind(-hinge_width) # Holes for rings & screw heads .workplaneFromTagged("rightSide") .placeSketch(cq.Sketch().circle(ring_radius)) @@ -231,14 +248,6 @@ def model(): .cutBlind(-1000) ) - model = ( - model.faces(">Z") - .workplane(offset=-model_thickness) - .center(-width, height) - .placeSketch(mounting_pillars) - .extrude(10) - ) - return model diff --git a/notebook_nueva/hinged_lid.stl b/notebook_nueva/hinged_lid.stl index 7ffbd6c..1da7ffa 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 7aea4ef..767184e 100644 --- a/notebook_nueva/hinged_lid.svg +++ b/notebook_nueva/hinged_lid.svg @@ -27,13 +27,13 @@ + + + - - - @@ -73,14 +73,40 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -101,115 +127,86 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - + + + + - + + + + + + + + + + + + + + - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + @@ -218,7 +215,6 @@ - @@ -237,7 +233,6 @@ - @@ -247,6 +242,7 @@ + @@ -268,12 +264,14 @@ - + + + @@ -282,9 +280,7 @@ - - - + @@ -292,17 +288,14 @@ - - - + + + + + + - - - - - - - +