Fix CNC layout Y-positioning and X-spacing for parts d1, d6, d8, f1, f2, f11, f12, h1, h2, h7, h8, and a6 #16
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.
Problem
Several parts in the CNC layout SVG were positioned incorrectly, causing them to be misaligned along the Y-axis. Additionally, there was a bug in the X-positioning calculations where
f11xwas used instead off11yafter the part's 90-degree rotation, leading to incorrect spacing for subsequent parts.The affected parts (d1, d6, d8, f12, f1, f2, h1, h2, h7, h8, f11, and a6) were all positioned with Y=0, causing them to align to the edge rather than being properly centered on the cutting sheet.
Solution
Modified
~CNCLAYOUT.scadto:Add Y-axis centering offsets for the 12 affected parts by using half their X-dimension as the Y-offset (e.g.,
d1x/2,f1x/2,h1x/2). Since these parts are rotated 90 degrees, their original X dimension becomes their Y dimension after rotation, so centering them requires offsetting by half that dimension.Fix X-positioning bug by changing
f11xtof11yin the positioning calculations for parts f12, f13, f14, h1, h2, h7, and h8. After f11 is rotated 90 degrees, its height along the layout's X-axis isf11y, notf11x.Regenerated cnclayout.svg using OpenSCAD with the corrected positioning.
Results
Before:

After:

Improvements:
Fixes positioning issues described in the issue where parts needed to be "shifted in the y" and addresses the "f11 might need to be shifted in the x" concern by fixing the dimension reference used for X-spacing calculations.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com/usr/lib/apt/methods/https(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Fixes #15
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.