This commit is contained in:
breitenbach76 2026-06-09 12:52:46 +02:00
parent 61b6ec23eb
commit 96b86ce340
6 changed files with 117 additions and 170 deletions

View file

@ -7,30 +7,33 @@
import bpy, math, os
# ----------------------------- Parameter (mm) -----------------------------
R_BOARD, BASE_H = 104.0, 14.0
R_BOARD, BASE_H = 130.0, 14.0
EDGE_BEVEL, EDGE_SEG = 1.6, 3
CHIP_D, CHIP_DEP = 50.0, 2.2 # Mittelmulde Ø50 (Chip)
NOTCH_D = 14.0
SOCK_D, SOCK_DEP = 32.8, 2.0 # Figuren-Sockel Ø32 + 0,8 Spiel
RING_R = 72.0
RING_R = 88.0
PHASE_NAME, PHASE_COLOR = "DESIGN", (0.184, 0.502, 0.788, 1) # #2f80c9
# Sektor: Name, Label-Mittenwinkel, Sockel-Winkel (Grad; 90=oben, Top frei fuer Karte).
# Lücken zwischen den Sektoren (34-36°) > Lücken innerhalb (28°) -> Gruppen klar sichtbar.
# B+ : symmetrisches 90°-Kreuz (Trennlinien bei 0/90/180/270), Sektoren in den
# Diagonalen, Sockel je Sektor gleichmaessig ueber den Sektor verteilt. Karte oben.
SECTORS = [
("RESPONSIBLE", 150, [118, 150, 182]),
("ACCOUNTABLE", 66, [66]),
("CONSULTED", -34, [30, -2, -34, -66]),
("INFORMED", -118, [-102, -134]),
("RESPONSIBLE", 135, [98, 135, 172]),
("ACCOUNTABLE", 45, [45]),
("CONSULTED", -45, [-8, -33, -57, -82]),
("INFORMED", -135, [-98, -172]),
]
DIVIDERS = [0, 90, 180, 270]
WORD_R = RING_R + SOCK_D/2 + 9 # Labels ausserhalb der Sockel
WORD_SIZE, WORD_DEP = 6.0, 0.9
DESIGN_SIZE, DESIGN_DEP, DESIGN_POS = 9.0, 1.0, (0, -44)
DESIGN_SIZE, DESIGN_DEP, DESIGN_POS = 9.0, 1.0, (0, -48)
CARD_CY, CARD_BW, CARD_BD, CARD_BH = 82.0, 72.0, 20.0, 16.0
SLOT_W, SLOT_T, SLOT_DEPTH, SLOT_TILT = 63.0, 7.0, 15.0, 12.0
CARD_CY, CARD_BW, CARD_BD, CARD_BH = 116.0, 84.0, 22.0, 16.0
SLOT_W, SLOT_T, SLOT_DEPTH, SLOT_TILT = 70.0, 5.0, 27.0, 12.0 # tief bis ~3 mm vorm Boden
TOP = BASE_H
@ -72,9 +75,10 @@ def apply_bevel(obj, width=EDGE_BEVEL, seg=EDGE_SEG, ang=30):
bpy.context.view_layer.objects.active = obj
bpy.ops.object.modifier_apply(modifier=m.name)
def engrave(board, body, x, y, rotz=0, size=WORD_SIZE, dep=WORD_DEP):
def engrave(board, body, x, y, rotz=0, size=WORD_SIZE, dep=WORD_DEP, ztop=None):
z0 = (TOP if ztop is None else ztop) - dep
try:
bpy.ops.object.text_add(location=(x, y, TOP - dep))
bpy.ops.object.text_add(location=(x, y, z0))
t = bpy.context.object; t.data.body = body; t.data.size = size
t.data.extrude = dep + 1.5; t.data.align_x='CENTER'; t.data.align_y='CENTER'
t.rotation_euler = (0, 0, math.radians(rotz))
@ -101,7 +105,16 @@ for _, _, angles in SECTORS:
boolean(base, cyl(SOCK_D, 6, (RING_R*math.cos(math.radians(a)),
RING_R*math.sin(math.radians(a)), TOP - SOCK_DEP + 3)), 'DIFFERENCE')
# Action-Card-Schlitz (oben offen, 7 mm breit, 15 mm tief, leicht nach hinten geneigt)
# Sektor-Trennlinien — symmetrisches Kreuz (0/90/180/270), flach graviert
_di, _do = CHIP_D/2 + 5, RING_R + SOCK_D/2 + 6
for a in DIVIDERS:
g = cube(_do - _di, 2.6, 1.4, (0, 0, 0))
g.rotation_euler = (0, 0, math.radians(a))
g.location = (((_di+_do)/2)*math.cos(math.radians(a)),
((_di+_do)/2)*math.sin(math.radians(a)), TOP - 0.7)
boolean(base, g, 'DIFFERENCE')
# Action-Card-Schlitz (oben offen, 70x5 mm, tief bis ~3 mm vorm Boden, leicht geneigt)
_sb = BASE_H + CARD_BH - SLOT_DEPTH; _sh = SLOT_DEPTH + 20
slot = cube(SLOT_W, SLOT_T, _sh, (0, CARD_CY, _sb + _sh/2))
slot.rotation_euler = (math.radians(-SLOT_TILT), 0, 0); bpy.ops.object.transform_apply(rotation=True)
@ -114,12 +127,11 @@ boolean(base, rim, 'DIFFERENCE')
# Sektor-Labels (gleich gross): links/rechts vertikal, oben/unten waagerecht -> lesbar & passt
for name, wc, _ in SECTORS:
c = math.cos(math.radians(wc))
rot = -90 if c > 0.7 else (90 if c < -0.7 else 0)
rot = (wc - 90) if math.sin(math.radians(wc)) >= 0 else (wc + 90) # tangential, lesbar
engrave(base, name, WORD_R*math.cos(math.radians(wc)), WORD_R*math.sin(math.radians(wc)), rot)
# Phasenname unten im Innenkreis
engrave(base, PHASE_NAME, DESIGN_POS[0], DESIGN_POS[1], 0, DESIGN_SIZE, DESIGN_DEP)
# Phasenname in die Chip-Mulde (Boden) graviert — durch den klaren Chip sichtbar
engrave(base, PHASE_NAME, 0, 0, 0, DESIGN_SIZE, DESIGN_DEP, ztop=TOP - CHIP_DEP)
base.name = "RACI-Board"
try: bpy.ops.object.shade_auto_smooth(angle=math.radians(30))
@ -150,7 +162,7 @@ try:
bpy.ops.object.light_add(type='AREA', location=(-140, -60, 180))
bpy.context.object.data.energy = 9000; bpy.context.object.data.size = 320
bpy.ops.object.empty_add(location=(0, 0, 5)); tgt = bpy.context.object
bpy.ops.object.camera_add(location=(275, -345, 310)); cam = bpy.context.object
bpy.ops.object.camera_add(location=(330, -410, 370)); cam = bpy.context.object
cam.data.lens = 50
con = cam.constraints.new('TRACK_TO'); con.target = tgt
con.track_axis = 'TRACK_NEGATIVE_Z'; con.up_axis = 'UP_Y'