Skip to content

Methods

Thibaut Breton edited this page Dec 17, 2023 · 3 revisions

matFlat(self, matrix)

Convert a matrix into a list.

Parameter Type Optional Default Description
matrix list[list[Any]] A matrix of integer

returns : list[Any] cube pattern centered on the top face

matDist(self, matrix)

Get the distance from the center of an even or odd matrix.

Parameter Type Optional Default Description
matrix list[list[int]] A matrix of integer

returns : list[list[int]] cube pattern centered on the top face

matRot(self, matrix, n)

Convert a matrix into a list.

Parameter Type Optional Default Description
matrix list[list[Any]] A matrix of integer
n int an integer corresponding to the number of rotations by 90

returns : list[list[Any]] cube pattern centered on the top face

createCubeTopView(self)

Create a cube centered on the top face using the face attributes imported when the object was created.

Parameter Type Optional Default Description
No Parameter

returns : list[list[int]] cube pattern centered on the top face

createCubeNorthView(self)

Create a cube centered on the north face using the matRot function and the face attributes imported when the object was created.

Parameter Type Optional Default Description
No Parameter

returns : list[list[int]] cube pattern centered on the north face

createCubeSouthView(self)

Create a cube centered on the south face using the matRot function and the face attributes imported when the object was created.

Parameter Type Optional Default Description
No Parameter

returns : list[list[int]] cube pattern centered on the south face

createCubeEastView(self)

Create a cube centered on the east face using the matRot function and the face attributes imported when the object was created.

Parameter Type Optional Default Description
No Parameter

returns : list[list[int]] cube pattern centered on the east face

createCubeWestView(self)

Create a cube centered on the west face using the matRot function and the face attributes imported when the object was created.

Parameter Type Optional Default Description
No Parameter

returns : list[list[int]] cube pattern centered on the west face

createRaimbow(self)

Create a rainbow sequence on the north face using the matDist function and the face attributes imported when the object was created.

Parameter Type Optional Default Description
No Parameter

returns : list[list[int]]

updateRaimbowColor(self)

Update variable RAIMBOW_COLOR using RAIMBOW_INCREASE variable every tick.

Parameter Type Optional Default Description
No Parameter

returns : None

updateBrightness(self)

Update variable BRIGHTNESS using BRIGHTNESS_INCREASE variable every tick.

Parameter Type Optional Default Description
No Parameter

returns : None

detectFace(self, key)

Returns the view centered on the face matrix and the (x, y) coordinates of a key.

Parameter Type Optional Default Description
key int the integer corresponding to a key value

returns : list[list[list[int]], tuple(int)]

rippleEffect(self, tab, actual, previous, counter)

Recursive function to create the ripple effect.

Parameter Type Optional Default Description
tab int the view centered on a face matrix
actual list[tuple(int)] list of coordinates pixel to update
previous list[list[tuple(int)]] Yes [] sequence of all list of all steps of update
counter int Yes 0 steps of the effect

returns : list[list[list[int]], tuple(int)]