Skip to content

Unify hexagon construction data: merge angle + nodeId methods into single flow#590

Merged
chrxh merged 4 commits intofeatures/ConstructionSequencesfrom
copilot/fix-get-hexagon-required-nodeid
Apr 9, 2026
Merged

Unify hexagon construction data: merge angle + nodeId methods into single flow#590
chrxh merged 4 commits intofeatures/ConstructionSequencesfrom
copilot/fix-get-hexagon-required-nodeid

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

getHexagonAngle and getHexagonRequiredNodeIds were separate methods with independent decomposition schemes (ring-based for angles, shell-based for node IDs) despite always being called together for the same node index. This made the hexagon construction sequence harder to follow and maintain.

Changes

  • Unified base table for n ≤ 21: single BaseEntry array with angle + all three node IDs, replacing two separate lookup tables
  • Merged decompositions into one method body: ring decomposition (angle) and shell decomposition (node IDs) flow together without separate scoped blocks
  • Inlined into generateNextConstructionDataForHexagon: eliminated the intermediate getHexagonConstructionData helper — one method now handles the full hexagon construction sequence
  • Removed declarations for getHexagonAngle, getHexagonRequiredNodeIds, and getHexagonConstructionData from the class
// Before: two separate helpers + wrapper
result.angle = getHexagonAngle(n);
getHexagonRequiredNodeIds(n, result.requiredNodeId1, result.requiredNodeId2, result.requiredNodeId3);

// After: single self-contained method
HOST_DEVICE ShapeGeneratorResult ShapeGenerator::generateNextConstructionDataForHexagon()
{
    int n = _nodePos;
    // base table for n <= 21, then ring decomposition (angle) + shell decomposition (nodeIds)
    // ...connection counting...
    ++_nodePos;
    return result;
}

Copilot AI and others added 3 commits April 9, 2026 10:46
Replace three separate getHexagonRequiredNodeId1/2/3 methods with a single
unified getHexagonRequiredNodeIds method implementing the correct algorithm.

Two key fixes from the original pseudocode:
1. All n-relative references use n-2/n-3 instead of n-1/n-2
2. C2 segment formulas use D+5s-2 based calculations instead of Dp-based

Agent-Logs-Url: https://github.com/chrxh/alien/sessions/b719d3ee-28a1-4698-8bed-6fa47d8a5ca2

Co-authored-by: chrxh <73127001+chrxh@users.noreply.github.com>
…xagonConstructionData method

Merge the two separate hexagon helper methods into a single
getHexagonConstructionData(int n) that returns a complete
ShapeGeneratorResult with both angle and required node IDs.
Uses a shared base table for n<=21 containing both angle and
node ID data, eliminating the separate lookup tables.

Agent-Logs-Url: https://github.com/chrxh/alien/sessions/26b8ddd9-67b1-46f8-a642-d7f54aaeba32

Co-authored-by: chrxh <73127001+chrxh@users.noreply.github.com>
…rHexagon

Merge the separate helper method into the single hexagon construction
method. Ring decomposition (angle) and shell decomposition (node IDs)
now flow together in one method without separate scoped blocks.

Agent-Logs-Url: https://github.com/chrxh/alien/sessions/e3cb635f-3518-449e-92cb-7503c19f6df4

Co-authored-by: chrxh <73127001+chrxh@users.noreply.github.com>
@chrxh chrxh marked this pull request as ready for review April 9, 2026 14:56
@chrxh chrxh merged commit 33a640d into features/ConstructionSequences Apr 9, 2026
@chrxh chrxh deleted the copilot/fix-get-hexagon-required-nodeid branch April 9, 2026 14:56
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.

2 participants