From 68c452efcd99ad27d034989251361a2601fd69a6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Apr 2026 21:19:22 +0200 Subject: [PATCH] Fix getHexagonRequiredNodeId3 for high n values in hexagon generation Agent-Logs-Url: https://github.com/chrxh/alien/sessions/736fd9ad-aed1-401d-acd9-077f206c31f8 Co-authored-by: chrxh <73127001+chrxh@users.noreply.github.com> --- source/EngineInterface/ShapeGenerator.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/source/EngineInterface/ShapeGenerator.h b/source/EngineInterface/ShapeGenerator.h index 777756c2d..4af66fc0e 100644 --- a/source/EngineInterface/ShapeGenerator.h +++ b/source/EngineInterface/ShapeGenerator.h @@ -742,7 +742,7 @@ HOST_DEVICE int ShapeGenerator::getHexagonRequiredNodeId3(int n) return -1; } if (pos % 2 == 1 && pos <= k - 3) { - return 3 * k * k - 5 * k - 1 - ((pos - 1) / 2); + return 3 * k * k - 5 * k - pos; } return -1; case 3: @@ -752,8 +752,8 @@ HOST_DEVICE int ShapeGenerator::getHexagonRequiredNodeId3(int n) } return -1; } - if (pos == 2) { - return 3 * k * k - 6 * k + 2; + if (pos >= 2 && pos % 2 == 0) { + return 3 * k * k - 6 * k + 2 - (pos - 2); } return -1; case 4: @@ -764,13 +764,7 @@ HOST_DEVICE int ShapeGenerator::getHexagonRequiredNodeId3(int n) return -1; } if (pos % 2 == 0) { - if (k == 2) { - if (pos == 0) { - return 2; - } - return -1; - } - return 3 * k * k - 6 * k - pos; + return 3 * k * k - 7 * k + 4 - pos; } return -1; case 5: