Skip to content

feat(assembly): 3d assembly pair - interpenetration, min clearance, per-feature radial clearance of threads/ribs, as printed from G-code (Refs #754, #574) - #756

Open
alex-mextner wants to merge 1 commit into
mainfrom
feat/assembly-pair-fit
Open

alex-mextner wants to merge 1 commit into
mainfrom
feat/assembly-pair-fit

Conversation

@alex-mextner

Copy link
Copy Markdown
Owner

What

3d assembly pair A B - do two parts mate? No spec file: two meshes (STL / 3MF / OBJ / PLY), each with a scale and a pose, are judged for

  • interpenetration - exact overlap volume and regions (a region thinner than --seat-tol is a seat contact, not a collision);
  • minimum clearance - exact, optionally only among surface samples inside a --zone (so a seat face does not hide the real gap);
  • per-feature radial clearance of a thread, ribs, a key or a bore: the surface radius of each part is read against the helical phase (z/pitch -+ theta/2pi; ribs: the angle) and slid against the other part. Reported: gap at the posed phase and at the best phase of screwing / clocking, free play (mm of axial travel / degrees), crest -> root clearances, handedness (a mismatch FAILs), pitch coherence (a wrong pitch is a warning, not a pass), coverage, concentricity. --screw-to-best turns B to the best phase before measuring (the turn keeps a seat face seated);
  • as printed - with --gcode-a/--gcode-b the same numbers from the printed OUTER WALL paths of the object (lib/gcode_walls.py), the model registered onto the printed object (translation-only Gauss-Newton on the signed distance, so the slicer's own placement is recovered), the per-layer wall-vs-model deviation, and the printed surface = centre line +- width/2.

Plus lib/gcode_walls.py: one reader of the wall lines of ONE object from Orca / Bambu / PrusaSlicer / Marlin G-code (object and layer labels from gcode_labels), refusing ambiguous names and several copies.

Refs #754 (this work), #574 (assembly toolkit), #553.

Cactus acceptance (rim = the ball's bore, plug = the bottom plug, both at scale 2.00493695, thread pitch 3.007)

model as printed (new top slice + first-print plug G-code)
bore radius (rim) 34.005 .. 35.695 34.003 .. 35.691
boss radius (plug) 33.209 .. 34.934 33.208 .. 34.933
tightest radial flank gap, best phase 0.600 mm 0.556 mm
free axial play 0.693 mm (0.231 turn) 0.643 mm (0.214 turn)
male crest -> female root / female crest -> male root 0.761 / 0.795 mm 0.758 / 0.794 mm
handedness right / right right / right
interpenetration at the best phase 0 mm3 (a 0.027 mm3 seat contact)

These are the numbers the ad-hoc verify/check_thread_fit.py of the garage-band cactus project gave (0.59 / 0.69 / 0.56 / 0.64), now from a generic command.

Tests

tests/test_gcode_walls.py, tests/test_assembly_pair.py, tests/e2e/test_assembly_pair.py - synthetic exact threads and ribs built with a known radial gap; each asserts a number read off the construction and has a teeth case (too tight, wrong handedness, wrong pitch, wrong phase, colliding pose, oversize print, wrong print pose, wrong object name).

…um clearance, per-feature radial clearance of threads and ribs, as printed from G-code walls (Refs #754, #574)

pair A B (STL/3MF/OBJ/PLY, scale + pose each): exact overlap volume with seat contacts split out, exact minimum gap
(optionally inside a zone), and per coaxial feature the radial clearance read from surface profiles against the helical
phase: gap at the posed and at the best phase of screwing/clocking, free play, crest/root clearances, handedness and
pitch coherence; --screw-to-best turns B to the best phase. With a G-code per part (lib/gcode_walls.py) the same numbers
from the printed outer walls, the model registered onto the printed object, per-layer wall-vs-model deviation, raft base.
Cactus rim+plug at x2.00493695: model gap 0.600 mm / play 0.693 mm, as printed 0.556 / 0.643 mm.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant