Переглянути джерело

Besser druckbarer Overhang und Connector für Zellhalter

Silas Gruen 11 місяців тому
батько
коміт
f31bd6293b
2 змінених файлів з 32 додано та 18 видалено
  1. 2 2
      segment_gehauese/spacer.py
  2. 30 16
      segment_gehauese/zellhalter_v2.py

+ 2 - 2
segment_gehauese/spacer.py

@@ -1,7 +1,7 @@
 import cadquery as cq
 from cadquery.occ_impl.exporters import ExportTypes
 
-#from ocp_vscode import show, show_object
+from ocp_vscode import show, show_object
 import math
 
 
@@ -64,7 +64,7 @@ if cut_height > 0:
 
 ############
 
-#show_object(spacer)
+show_object(spacer)
 
 with open(r"spacer_2.5.step", "w") as fp:
    cq.exporters.exportShape(spacer, ExportTypes.STEP, fp)

+ 30 - 16
segment_gehauese/zellhalter_v2.py

@@ -36,12 +36,13 @@ strip_locs = [(-cell_diam/4, y * space_rows) for y in range(0, rows)]
 connector_locs = [(x * space_single * 2, (y + 0.5) * space_rows) for x in range(0, int(cells_per_row/2)) for y in range(0, rows-1)]
 
 cell_edge = cell_diam/2 - 1.5
-board_con_locs = [
-   (-.5 * space_single, -cell_edge),
-   (-.5 * space_single, space_rows + cell_edge),
-   (1.5 * space_single, space_rows - cell_edge),
-   (5.5 * space_single, cell_edge),
-   (5.5 * space_single, space_rows - cell_edge)
+
+board_con_locs_with_rot = [
+   ((-.5 * space_single, -cell_edge), 0),
+   ((-.5 * space_single, space_rows + cell_edge), 180),
+   ((1.5 * space_single, space_rows - cell_edge), 0),
+   ((5.5 * space_single, cell_edge), 180),
+   ((5.5 * space_single, space_rows - cell_edge), 0),
 ]
 
 # Zellkreise
@@ -82,6 +83,13 @@ strips_cut = (
          cq.Workplane().workplane(offset=print_height-2*wall_thick)
          .rect(space_all + cell_diam/2+wall_thick, strip_width, centered=(False, True))
          .extrude(wall_thick*2)
+         # Dreieckiger Ausschnitt für besseres bridging
+         .faces("<Z")
+         .workplane()
+         .rect(space_all + cell_diam/2+wall_thick, strip_width, centered=(False, True))
+         .workplane(offset=wall_thick*2)
+         .rect(space_all + cell_diam/2+wall_thick, eps, centered=(False, True))
+         .loft()
          .val()
          .located(loc)
       )
@@ -126,12 +134,13 @@ board_con = (
    cq.Workplane()
    .rect(connector_width, connector_width)
    .extrude(board_connector_length)
+   .faces("+Y")
+   .edges("|Z")
+   .chamfer(wall_thick)
    .faces("<Z")
    .workplane()
-   .rect(connector_width+lip_width, connector_width+lip_width)
+   .rect(connector_width+lip_width, connector_width)
    .extrude(lip_width)
-   .edges("|Z")
-   .chamfer(wall_thick)
    .faces(">Z")
    .workplane()
    .circle(hole_diam/2)
@@ -139,10 +148,8 @@ board_con = (
 )
 board_con_outside = (
    cq.Workplane()
-   .rect(connector_width + eps, connector_width + eps)
+   .rect(connector_width + 2 * eps, connector_width + 2 * eps)
    .extrude(print_height)
-   .edges("|Z")
-   .chamfer(wall_thick)
 )
 board_con_hull = (
    cq.Workplane()
@@ -153,13 +160,20 @@ board_con_hull = (
 )
 
 con_placed = []
-for loc in board_con_locs:
-   con = board_con.translate(loc)
-   con_outside = board_con_outside.translate(loc)
+for location, angle in board_con_locs_with_rot:
+   # Connector nur für Visualisierung
+   con = board_con.translate(location)
+   con = con.rotateAboutCenter((0,0,1), angle)
+   # Ausschnitt für den Connector
+   chamfer_face = "-Y" if angle >= 180 else "+Y"
+   con_outside = board_con_outside.faces(chamfer_face).edges("|Z").chamfer(wall_thick)
+   con_outside = con_outside.translate(location)
    con_placed.append(con)
-   hull = board_con_hull.translate(loc).cut(cell_base).cut(strips_cut)
+   # Verdickte Hülle für den Connector
+   hull = board_con_hull.translate(location).cut(cell_base).cut(strips_cut)
    base_connected = base_connected.union(hull).cut(con_outside)
 
+# Begrenzungsbox für den gesamten Zellhalter (sonst schneidet man den nächsten Halter)
 boundary_box = (
    base_connected.workplane(centerOption="CenterOfBoundBox")
    .box(1000, dist_segments, 1000,combine=False)