Welcome to cube3d’s documentation!

Welcome to cube3d’s documentation!

This is just a fun project.

Built your own Virtual 3-D Rubik Cube. and use it for further development.

Welcome to cube3d’s API Documentation!

input

Sample Execution Fuction, to read the Cube position, colors from an excel file. and create necessary cube object.

Uses pandas to read Excel

cube3d.input.get_cube(file)

read the cube details from excel. Excel should have six different side details (‘front’, ‘back’, ‘top’, ‘bottom’, ‘left’, ‘right’) assuming facing front.

Args:

file (str): Excel file name, where cube detail is stored.

Returns:

Cube: Cube object

base

Model defining 0D, 1D, 2D, 3D elements requirements for cube and its rotation methods.

class cube3d.base.Band(*arg)

Bases: Members

A One-Dimentional; Line object and its properties

class cube3d.base.Cube(*arg)

Bases: Members

A Three-Dimentional; Cube object and its properties

change_to(view)

Turn the whole cube, i.e. Turn cube such face it faces now towards give view side.

Args:

view (str): face name to turn towards

Returns:

Cube: updated cube after move

change_to_back()

Turn the whole cube, i.e. Turn cube such face it faces now towards back Square.

Returns:

Cube: updated cube after move

change_to_bottom()

Turn the whole cube, i.e. Turn cube such face it faces now towards bottom Square.

Returns:

Cube: updated cube after move

change_to_left()

Turn the whole cube, i.e. Turn cube such face it faces now towards left Square.

Returns:

Cube: updated cube after move

change_to_right()

Turn the whole cube, i.e. Turn cube such face it faces now towards right Square.

Returns:

Cube: updated cube after move

change_to_top()

Turn the whole cube, i.e. Turn cube such face it faces now towards top Square.

Returns:

Cube: updated cube after move

is_solved()

check is cube in solved position

Returns:

bool: True if solved, else False

rotate_square(view, clockwise=True)

rotate a side/view of cube in given direction perspective to that face.

Args:

view (str): face name to be rotated clockwise (bool, optional): True will rotate clockwise False will rotate anti-clockwise. Defaults to True.

set_initial_views()

set all six faces of cube. faces are (front, back, left, right, top, bottom)

show(view)

return the face of cube. view=face=side faces are (front, back, left, right, top, bottom)

Args:

view (str): face of a cube

Returns:

list: Two dimentional Square Object detail

update_view(view, updated_sqr)

update face of cube with given updated Square

Args:

view (str): face of a cube updated_sqr (Square): Square object, numpy array of array

class cube3d.base.Members(*arg)

Bases: object

Common Methods and properties defining multiple member types Initialize different kinds of objects by providing respective arguments.

Common properties/methods available are:
  • len()

  • getitem

  • reversed()

  • iterate over

class cube3d.base.Point(**kwargs)

Bases: object

A Zero-Dimentional; Single Point Object and its properties.

set(**kwargs)

set the Point objects co-ordinates and colors.

class cube3d.base.Square(*arg)

Bases: Members

A Two-Dimentional; Square object and its properties

Indices and tables