-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add 3D cube topology support and wrapping animations #5604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
palatter
wants to merge
3
commits into
wled:main
Choose a base branch
from
palatter:feature/3d-cube-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fx != 1branches silently remap out-of-rangexinstead of letting the caller drop it.Inside the
fy == 0andfy == 2blocks, the third branch usesfx != 1with a comment indicating the intent isfx == 3(Top/Bottom-Back gap). However,fxcan also be-1(whenx < 0) or>= 4(whenx >= 4*n), because nothing earlier in the function boundsx. For those cases, this branch still fires and remaps the coordinate onto a valid Top/Bottom face cell:x = -1, y in [0, n)→fx = -1, hitsfx != 1, mapped onto top face's left column.x >= 4n, y in [0, n)→fx >= 4, hitsfx != 1, mapped onto top face.fy == 2.This contradicts the design that out-of-cube-net coordinates should remain out of range so the caller's
(unsigned)x >= vWidth()check discards them (the same rationale used to remove the earlier[0,4n) x [0,3n)clamp). Effects that occasionally probe just off the segment edges with cube mode active may paint stray pixels onto Top/Bottom face borders.Tightening to an exact
fx == 3keeps the back-gap fix but lets truly out-of-range writes/reads fall through to the caller's bounds check:🛠️ Proposed fix
} else if (fy == 0) { if (fx == 0) { // Top-Left gap -> maps to Top face left edge x = n + (n - 1 - v); y = u; } else if (fx == 2) { // Top-Right gap -> maps to Top face right edge x = n + v; y = n - 1 - u; - } else if (fx != 1) { // fx == 3 (Top-Back gap) -> maps to Top face top edge + } else if (fx == 3) { // Top-Back gap -> maps to Top face top edge x = 2 * n - 1 - u; y = n - 1 - v; } } else if (fy == 2) { if (fx == 0) { // Bottom-Left gap -> maps to Bottom face left edge x = n + v; y = 3 * n - 1 - u; } else if (fx == 2) { // Bottom-Right gap -> maps to Bottom face right edge x = 2 * n - 1 - v; y = 2 * n + u; - } else if (fx != 1) { // fx == 3 (Bottom-Back gap) -> maps to Bottom face bottom edge + } else if (fx == 3) { // Bottom-Back gap -> maps to Bottom face bottom edge x = 2 * n - 1 - u; y = 3 * n - 1 - v; } }🤖 Prompt for AI Agents