Fix ShapeGenerator::getHexagonAngle index calculation and side 2 pattern#586
Merged
chrxh merged 1 commit intofeatures/ConstructionSequencesfrom Apr 8, 2026
Merged
Conversation
- Use 1-based indexing with firstIndex = 1 + 3*(k-1)*k instead of --n - Fix ring-finding loop to start at k=1 with condition 1 + 3*k*(k+1) <= n - Fix side 2 for odd k: alternating -120/+120 with last two values +60, +120 Agent-Logs-Url: https://github.com/chrxh/alien/sessions/5baa12cc-b860-4ab1-8d9e-d91dd10a8aec Co-authored-by: chrxh <73127001+chrxh@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
chrxh
April 8, 2026 14:11
View session
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.
getHexagonAngleproduced incorrect angles for hexagon construction due to wrong indexing and a flipped pattern on side 2.Changes
--ndecrement that shifted to 0-based indexing. Now uses 1-based formulafirstIndex = 1 + 3*(k-1)*kand ring-finding starts atk=1with1 + 3*k*(k+1) <= n.[-120, +60, alternating...]— corrected to[alternating -120/+120..., +60, +120]where the special values are at positionsk-2andk-1(end of side), not positions 0 and 1 (start).Before (side 2, odd k):
After: