ok, just wanted to update a little.
after a few extended hours of problem solving i have got a solution that is configurable and working.
int matrix54[9][12] = {
{ 54, 54, 54, 54, 54, 54, 42, 43, 44, 51, 52, 53 },
{ 54, 54, 54, 54, 54, 54, 39, 40, 41, 48, 49, 50 },
{ 54, 54, 54, 54, 54, 54, 36, 37, 38, 45, 46, 47 },
{ 54, 54, 54, 24, 25, 26, 33, 34, 35, 54, 54, 54 },
{ 54, 54, 54, 21, 22, 23, 30, 31, 32, 54, 54, 54 },
{ 54, 54, 54, 18, 19, 20, 27, 28, 29, 54, 54, 54 },
{ 6, 7, 8, 15, 16, 17, 54, 54, 54, 54, 54, 54 },
{ 3, 4, 5, 12, 13, 14, 54, 54, 54, 54, 54, 54 },
{ 0, 1, 2, 9, 10, 11, 54, 54, 54, 54, 54, 54 }
};
so whilst this looks messy, its the pattern shown as in the picture, although reversed. the leds are wired from the back, but then coded to the front, but the concept is the same.
instead of trying to work out how to link 6 x 3x3 grids, and then using weird maths and lots of if statements to work out the top of 1 side, to the bottom of another, i made the matrix as 1 large piece, 4x 3x3 grids across, and 3x 3x3 tall.
then all the grid spaces that are not used are filled with the address 54 (the length of the strip is 54 leds [0-53 are leds, 54 is the non-existant led at the end]
i can now use leds[matrix54[posY][posX] to specify an x and y position to light a specific led
with a strange, but welcomed result, that when trying to light led 54, there is no time loss? i was expecting that if light the leds in sequence, x, x+1, x+2, x+3, x+4 etc, then when the leds hit the 54’s there would be pauses in the light, but it doesn’t respond like that.
also, if i need to tweak the specific twists and turns of the cube when folded up, i can change a few numbers and all works out!