Fix Subaru DSD435 asymmetric cut count (4 top / 5 bottom) - #1
Closed
ellygaytor wants to merge 1 commit into
Closed
Conversation
DSD 435 is a 9-cut bitting (4 on the top track, 5 on the bottom), not 10 cuts as the previous config assumed. Drop the phantom 5th top cut and teach drawInternalCutPinsWithUnderline to handle a keyConfig.topCutCount that differs from pins.length / 2, so the rendered blade ends the top groove at the 4th cut while the bottom groove continues to the 5th. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UwD1dmEjBVYQdvQW21wV4d
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.
Summary
The DSD: 435 spec (Subaru Forester / XV Crosstrek, TOY48P) lists the example bitting with 4 cuts on the top track (
1 2 3 1) and 5 cuts on the bottom (3 2 1 3 2) — 9 cuts total, not 10. The currentSubaruconfig declares"10 cuts/TOY48P", which forces the user to enter a phantom 5th cut on the top track that doesn't exist on a real key.Changes
Subaruoutline →"9 cuts/TOY48P", plus a newtopCutCount: 4field on the config so the renderer knows the top track is shorter than the bottom.drawInternalCutPinsWithUnderlineno longer assumespins.length / 2cuts per side. It now readstopCutCountfrom the key config (falling back to an even split for keys that don't set it) and evaluates the two milled tracks independently, so the top groove ends after cut 4 while the bottom continues to cut 5.Test plan
9 cuts/TOY48P→ Decode and confirm 4 number cells appear on the top row, 5 on the bottom.topCutCount) — the even-split fallback should keep their rendering unchanged.Generated by Claude Code