Add geometry-loop + Move advisories to validation#52
Open
YLZha wants to merge 1 commit into
Open
Conversation
Two advisory-only validation checks (never affect pass/fail), closing gaps surfaced building the Moravian workbench: - Geometry-loop advisory (helpers/sp/deps.py): AST-scans the tracked build script for for/while loops that create geometry (sketches/extrudes/combines/ cyl_/box_) and nudges toward a Rectangular Pattern or Mirror. This is the source-level complement to validate_design's body-congruence replication advisory, which can't see a loop of identical CUTs (e.g. dog-hole arrays remove voids, not add bodies). Resolves the script path up-front so it runs even when an explicit metadata_path is passed. - Move advisory (addin/tools/validate_design.py): flags Move/rotate features that likely orient a part to an angled reference; prefer building in place (or a two-section loft for compound splay). Opt out a legit roll / measured alignment with a `_norep` substring in the feature name. - docs/angled-construction.md: documents the parametric two-section Loft as the Move-free way to do compound splay (and why a Loft, not an off-axis extrude), plus the "check_interference after a Move" reflex. - tests/test_deps_loops.py: offline unit test for the loop detector. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two advisory-only validation checks (never affect pass/fail), from lessons building the Moravian workbench.
1. Geometry-loop advisory —
helpers/sp/deps.pyAST-scans the tracked build script for
for/whileloops that create geometry (sketches.add, extrudes,combine,cyl_/box_helpers) and nudges toward a Rectangular Pattern or Mirror feature.Why:
validate_design's existing replication advisory groups congruent bodies — so a loop of identical cuts (dog-hole / mortise / hole arrays, which remove voids rather than add bodies) is invisible to it. That's exactly why the workbench's dog holes were first built one-by-one in a loop with nothing flagging it. The AST sees both body-loops and cut-loops. A loop that builds a list then patterns/mirrors it is not flagged. Script path is now resolved up-front so the lint runs even when an explicitmetadata_pathis passed.2. Move advisory —
addin/tools/validate_design.pyFlags
Move/rotate features that likely orient a part to an angled reference. A Move bakes a non-parametric transform and can hide sizing bugs until the part is in place (it masked an oversized vise collar in the workbench build). Prefer building in place; for compound splay use a two-section loft. Opt out a legitimate roll / measured-alignment Move with a_norepsubstring in its name.3. Docs —
docs/angled-construction.mdDocuments the parametric two-section Loft as the Move-free way to do compound splay (and why a Loft, not an off-axis extrude — Fusion extrudes only normal to the profile plane), plus the "run
check_interferenceafter a Move" reflex.4. Test —
tests/test_deps_loops.pyOffline unit test for the detector (cut-loop, sketch-loop, helper-loop flagged; pattern-loop / no-geometry-loop / bad-source not flagged). Existing
test_deps_anchoring.pystill 12/12.Both advisories are non-failing and opt-out-able, consistent with the existing replication advisory — a working build is never forced into a redo.
🤖 Generated with Claude Code