W/o fillet donw

This commit is contained in:
Till Schmidt 2026-06-26 22:25:15 +02:00
parent 762c84e813
commit 55a1df1d9b

View file

@ -2,39 +2,39 @@ from build123d import *
from ocp_vscode import show from ocp_vscode import show
# ========================================== # ==========================================
# --- MASTER PARAMETER --- # --- MASTER PARAMETERS ---
# Defines the outer diameter in mm. model_size = 31.0 # Outer diameter of the ring
# Change this single value to scale the entire model! overhang = model_size * (3.0 / model_size) # How many mm the bolt sticks out past the ring
model_size = 35.0
# ========================================== # ==========================================
# --- Derived Parameters --- # --- Derived Parameters ---
# All dimensions are calculated as fractions of the original 35mm baseline
outer_diameter = model_size outer_diameter = model_size
inner_diameter = model_size * (29.0 / 35.0) inner_diameter = model_size * (25.4 / model_size)
thickness = model_size * (2.0 / 35.0) thickness = model_size * (2.3 / model_size)
# Pin dimensions pin_diameter = model_size * (3.1 / model_size)
pin_diameter = model_size * (2.0 / 35.0) pin_length = model_size * (10.8 / model_size)
pin_length = model_size * (5.0 / 35.0) pin_spacing = model_size * (14.0 / model_size)
pin_spacing = model_size * (14.0 / 35.0) # Distance from center to each pin pin_height_offset = model_size * (1.55 / model_size)
fillet_radius = model_size * (0.5 / model_size)
# --- Lightning Bolt Proportions --- # --- Lightning Bolt Proportions ---
# W is a safe overhang width (guaranteed to be outside the ring for clean intersection) # W is now the radius of the ring PLUS your desired flat overhang
W = outer_diameter * 1.2 W = (outer_diameter / 2) + overhang
# Vertical (Y) heights for the horizontal bars # --- Lightning Bolt Proportions (The Vintage "Z" Fix) ---
y_top_outer = model_size * (4.0 / 35.0) # We use a massive bounding box to draw the Z, then use your Circle(W) to cleanly trim it.
y_top_inner = model_size * (2.0 / 35.0) bound = model_size
y_bot_outer = model_size * (-4.0 / 35.0)
y_bot_inner = model_size * (-2.0 / 35.0)
# Horizontal (X) positions mapping the central diagonal cut # Vertical (Y) coordinates for the horizontal bars
x_inner_left = model_size * (-2.0 / 35.0) # H_outer defines the overall height. H_inner defines where the cutouts stop.
x_diag_bot = model_size * (-6.0 / 35.0) H_outer = model_size * (3.1 / model_size)
x_inner_right = model_size * (2.0 / 35.0) H_inner = model_size * (0.5 / model_size)
x_diag_top = model_size * (6.0 / 35.0)
# Horizontal (X) coordinates for the zigzag points
# X_point is the sharp outer tip. X_inner is how deeply the diagonal cuts past center.
X_point = model_size * (5.8 / model_size)
X_inner = model_size * (2.7 / model_size)
with BuildPart() as opel_pin: with BuildPart() as opel_pin:
# 1. Base Ring # 1. Base Ring
@ -43,31 +43,29 @@ with BuildPart() as opel_pin:
Circle(inner_diameter / 2, mode=Mode.SUBTRACT) Circle(inner_diameter / 2, mode=Mode.SUBTRACT)
extrude(amount=thickness) extrude(amount=thickness)
# 2. Lightning Bolt Profile (Fully Parametric) # 2. Lightning Bolt Profile (Aggressive Z-Shape)
with BuildSketch() as bolt_sketch: with BuildSketch() as bolt_sketch:
# Drawing the Z-shape using our dynamic variables
pts = [ pts = [
(-W, y_top_outer), # 1. Top-left outer edge (-bound, H_outer), # 1. Top-left outer edge
(-W, y_bot_inner), # 2. Bottom-left outer edge (-bound, -H_inner), # 2. Bottom-left outer edge of upper bar
(x_inner_left, y_bot_inner), # 3. Inner bottom-left corner (-X_inner, -H_inner), # 3. Inner bottom corner (cuts right, past center)
(x_diag_bot, y_bot_outer), # 4. Diagonal drop to the lower bar (-X_point, -H_outer), # 4. Sharp bottom-left point (diagonals back left)
(W, y_bot_outer), # 5. Bottom-right outer edge (bound, -H_outer), # 5. Bottom-right outer edge
(W, y_top_inner), # 6. Top-right outer edge (bound, H_inner), # 6. Top-right outer edge of lower bar
(x_inner_right, y_top_inner), # 7. Inner top-right corner (X_inner, H_inner), # 7. Inner top corner (cuts left, past center)
(x_diag_top, y_top_outer) # 8. Diagonal rise back to the upper bar (X_point, H_outer) # 8. Sharp top-right point (diagonals back right)
] ]
Polygon(*pts) Polygon(*pts)
# Cleanly slice off the overhangs using the outer circle # Cleanly slice off the overhangs using your dynamic W radius
Circle(outer_diameter / 2, mode=Mode.INTERSECT) Circle(W, mode=Mode.INTERSECT)
extrude(amount=thickness) extrude(amount=thickness)
# 3. Mounting Pins (on the back face) # 3. Mounting Pins (on the back face)
bottom_face = opel_pin.faces().sort_by(Axis.Z)[0] bottom_face = opel_pin.faces().sort_by(Axis.Z)[0]
with BuildSketch(bottom_face) as pin_sketch: with BuildSketch(bottom_face) as pin_sketch:
# Place pins dynamically based on the scale with Locations((-pin_spacing, -pin_height_offset), (pin_spacing, pin_height_offset)):
with Locations((-pin_spacing, 0), (pin_spacing, 0)):
Circle(pin_diameter / 2) Circle(pin_diameter / 2)
extrude(amount=pin_length) extrude(amount=pin_length)