Add panel-to-PCB mounting system with M3 standoffs
Panel alignment: - PCB offset 10mm from panel top - Component holes aligned: OLED@25mm, jacks@45mm, button@58mm - 4x M3 standoff holes at corners (5,5), (35,5), (5,75), (35,75) Updates: - Panel SVG and spec aligned with PCB layout - Mounting holes added to PCB (Edge.Cuts layer) - Regenerated Gerbers with mounting holes - Updated autoroute.py to add mounting holes automatically DRC: 0 unconnected, 7 cosmetic errors (courtyard overlaps)
This commit is contained in:
@@ -33,6 +33,15 @@ DRC_FILE = "DRC.rpt"
|
||||
FREEROUTING_JAR = "/tmp/freerouting.jar"
|
||||
FREEROUTING_URL = "https://github.com/freerouting/freerouting/releases/download/v2.0.1/freerouting-2.0.1.jar"
|
||||
|
||||
# Mounting hole positions (M3, 3.2mm diameter)
|
||||
# Bottom holes moved up to avoid power section
|
||||
MOUNTING_HOLES = [
|
||||
(5, 5), # Top left
|
||||
(35, 5), # Top right
|
||||
(5, 75), # Bottom left (above power section)
|
||||
(35, 75), # Bottom right (above power section)
|
||||
]
|
||||
|
||||
# Component positions for 8HP (40mm x 100mm) layout v2
|
||||
PLACEMENTS = {
|
||||
# Top - OLED display
|
||||
@@ -124,6 +133,29 @@ def main():
|
||||
placed += 1
|
||||
print(f" Placed {placed} components")
|
||||
|
||||
# Step 4b: Add mounting holes
|
||||
print("\n[4b/9] Adding mounting holes...")
|
||||
# Remove existing mounting holes first
|
||||
for drawing in list(board.GetDrawings()):
|
||||
if drawing.GetClass() == "PCB_SHAPE":
|
||||
if drawing.GetShape() == pcbnew.SHAPE_T_CIRCLE:
|
||||
# Check if it's a mounting hole (on Edge.Cuts, 3.2mm diameter)
|
||||
if drawing.GetLayer() == pcbnew.Edge_Cuts:
|
||||
radius = pcbnew.ToMM(drawing.GetRadius())
|
||||
if 1.5 < radius < 1.7: # ~3.2mm diameter
|
||||
board.Delete(drawing)
|
||||
|
||||
# Add new mounting holes
|
||||
for x, y in MOUNTING_HOLES:
|
||||
hole = pcbnew.PCB_SHAPE(board)
|
||||
hole.SetShape(pcbnew.SHAPE_T_CIRCLE)
|
||||
hole.SetCenter(place(x, y))
|
||||
hole.SetEnd(place(x + 1.6, y)) # Radius = 1.6mm (3.2mm diameter)
|
||||
hole.SetLayer(pcbnew.Edge_Cuts)
|
||||
hole.SetWidth(mm(0.15))
|
||||
board.Add(hole)
|
||||
print(f" Added {len(MOUNTING_HOLES)} mounting holes (M3, 3.2mm)")
|
||||
|
||||
# Step 5: Export DSN
|
||||
print("\n[5/9] Exporting Specctra DSN...")
|
||||
board.Save(PCB_FILE) # Save first
|
||||
|
||||
Reference in New Issue
Block a user