feat(isogrid): Add DRAW_HOLES flag to skip bolt holes in NX import

Default: DRAW_HOLES = False (holes already exist in the solid body).

Config block in import_profile.py is now:
  DRAW_OUTER_BOUNDARY = False  (sandbox perimeter — not needed for subtract)
  DRAW_HOLES          = False  (bolt holes — already in existing body)

Sketch now imports ONLY the rib pocket profiles, ready for Subtract extrude.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-18 09:49:08 -05:00
parent 98774453b3
commit a9c40368d3

View File

@@ -44,6 +44,9 @@ DEFAULT_RIB_THICKNESS = 10.0 # mm, fallback if not in profile JSON
# Set to True only for standalone plate creation (no existing body). # Set to True only for standalone plate creation (no existing body).
DRAW_OUTER_BOUNDARY = False DRAW_OUTER_BOUNDARY = False
# Set to False to skip bolt hole circles (they already exist in the solid body).
DRAW_HOLES = False
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Geometry helpers # Geometry helpers
@@ -878,7 +881,8 @@ def main():
lister.WriteLine(f"[import] Pockets done: {total_lines} lines + {total_arcs} arcs") lister.WriteLine(f"[import] Pockets done: {total_lines} lines + {total_arcs} arcs")
# Holes (bolt circles) — drawn as two semicircular arcs each # Holes (bolt circles)
if DRAW_HOLES:
holes = profile.get("holes", []) holes = profile.get("holes", [])
if holes: if holes:
holes_drawn = 0 holes_drawn = 0
@@ -901,6 +905,8 @@ def main():
except Exception as exc: except Exception as exc:
lister.WriteLine(f"[import] WARN: hole failed: {exc}") lister.WriteLine(f"[import] WARN: hole failed: {exc}")
lister.WriteLine(f"[import] Holes: {holes_drawn}/{len(holes)} drawn ({holes_drawn*2} arcs)") lister.WriteLine(f"[import] Holes: {holes_drawn}/{len(holes)} drawn ({holes_drawn*2} arcs)")
else:
lister.WriteLine(f"[import] Holes skipped (DRAW_HOLES=False)")
lister.WriteLine(f"[import] Total: {total_lines} lines + {total_arcs} arcs") lister.WriteLine(f"[import] Total: {total_lines} lines + {total_arcs} arcs")
@@ -928,6 +934,7 @@ def main():
lister.WriteLine(f"[import] Done: {total_lines} lines in sketch") lister.WriteLine(f"[import] Done: {total_lines} lines in sketch")
# Holes for legacy fallback # Holes for legacy fallback
if DRAW_HOLES:
holes = profile.get("holes", []) holes = profile.get("holes", [])
if holes: if holes:
holes_drawn = 0 holes_drawn = 0
@@ -946,7 +953,7 @@ def main():
p4_3d = unproject_point_to_3d(p4, transform) p4_3d = unproject_point_to_3d(p4, transform)
_draw_arc_3pt(work_part, p3_3d, p4_3d, p1_3d) _draw_arc_3pt(work_part, p3_3d, p4_3d, p1_3d)
holes_drawn += 1 holes_drawn += 1
total_lines += 2 # counting as arcs but reusing counter total_lines += 2
except Exception as exc: except Exception as exc:
lister.WriteLine(f"[import] WARN: hole {hole.get('index','?')} failed: {exc}") lister.WriteLine(f"[import] WARN: hole {hole.get('index','?')} failed: {exc}")
lister.WriteLine(f"[import] Holes: {holes_drawn}/{len(holes)} drawn") lister.WriteLine(f"[import] Holes: {holes_drawn}/{len(holes)} drawn")