fix(tool-support): measure a Fusion holder by the shape it exported - #114
Merged
Merged
Conversation
Autodesk defines a holder's `gaugeLength` as the height below the gauge line, so it is a reading of the segment stack rather than a fact standing beside it. The measured arm already worked that way — `belowGageLine` makes the cut and the last vertex is the answer — but a published holder was written with the vendor's own figure against a stack built from the vendor's dimensions, and on a V-flange holder those are two different lengths. REGO-FIX publishes `B4`, nose to gauge line, beside `B3`, nose to the flange face, and `B4 - B3` is 48.4 mm on every BT 30: the gauge-line-to-flange distance from the vendor's own standards table. `B3` is what `fromPublished` can draw, because no vendor publishes the shape of the flange above it. So a BT 30 collet chuck went out declared 98.4 mm below the gauge line and drawn 50 mm long, and `assemblyGaugeLength` — the stickout plus the holder's gauge length — put the tool 48.4 mm from the gauge line it was drawn against. The stack's own height is now what is exported, and the vendor's figure is reported instead: a `dropped` note naming both numbers where they disagree. `fromPublished` accumulates that height as it places the steps rather than summing it back off them, because a segment's height has already been converted into the export's unit and rounded. Where a vendor publishes no gauge length the holder no longer goes out without the key — its shape is fully drawn and its height therefore known — and a `filled` note says the number was read off the geometry. A `nose`-datumed profile still omits `gaugeLength`, because its silhouette is the whole holder rather than the part below the gauge line. Both fixtures covering this published a `projection` and a `gaugeLength` that were equal, so no test could tell the two readings apart, and the existing test asserted the identity as though the stack had proved it. One that does prove it is added: four of its five cases fail against the previous behaviour.
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.
Found by @dementive in toolpath-template#11. That PR is against the copy of this exporter that lived in the template before it moved into this package, so it cannot land there; this is the same finding against the code that now owns it.
The defect
Autodesk defines a holder's
gaugeLengthas the height below the gauge line, so it is a reading of the segment stack rather than a fact standing beside it.The measured arm already worked that way —
belowGageLinemakes the cut and the last vertex is the answer. The published arm did not: it wrote the vendor's owngaugeLengthagainst a stack built byfromPublishedfrom the vendor's dimensions, and on a V-flange holder those are two different lengths.REGO-FIX publishes
B4, nose to gauge line, besideB3, nose to the flange face, andB4 - B3is 48.4 mm on every BT 30 — the gauge-line-to-flange distance from the vendor's own standards table.B3is whatfromPublishedcan draw, because no vendor publishes the shape of the flange above it.So a BT 30 collet chuck went out declared 98.4 mm below the gauge line and drawn 50 mm long.
assemblyGaugeLengthis the stickout plus that figure, so the tool was placed 48.4 mm from the gauge line it was drawn against.The fix
The stack's own height is what is exported, on both arms. The vendor's figure is reported instead of written:
droppednote onholder.gaugeLengthnaming both numbers;fillednote says the number was read off the geometry;nose-datumed profile still omitsgaugeLengthentirely, because its silhouette is the whole holder, taper and retention knob included, rather than the part below the gauge line.fromPublishednow accumulates that height as it places the steps rather than summing it back off them: a segment's height has already been converted into the export's unit and rounded, and adding those up would put a conversion and six decimal places between the stack and the number meant to measure it.Why no test caught it
Both fixtures covering this — here and in the template — published a
projectionand agaugeLengththat were equal, so nothing could tell the two readings apart. The existing test even asserted the identity as though the stack had proved it:It summed to 50 because the fixture said 50 twice. That comment is corrected, and a
describeblock added for a holder where the two differ. Four of its five cases fail against the previous behaviour; the fifth covers the agreeing case and passes on both, which is the point of it.Downstream
@toolpath/tool-supportis consumed bytoolpath-template's catalog throughapp/shared/fusion-input.ts. Its fixture has the sameprojection === gaugeLengthblind spot, and one of its tests asserts the old'the vendor publishes no gauge length'warning, which this changes. That follow-up lands there once this releases.Checks
tool-support340 passed,app-support21,tool-drawing174.check-typesacross 9 packages,lint:js,knip,fusion:verifyandformat:checkall clean. Fullpnpm checknot run — it needs Docker forgenerate:checkand a Chromium install for the Playwright suite, neither touched here.Minor bump: exported values change.