Valid XHTML 1.0 Strict

VisualCube

Generate custom Rubik's cube visualisations from your browser address bar.

Instructions

Simply point your browser to visualcube.png to create a cube image.
A range of parameters can be set to customise the cube visualisation.
Click the link below for an example:

          cube.crider.co.uk/visualcube.png?size=150&pzl=2&alg=R2F2R2


Examples

The following images were generated by VisualCube.

Example 0 Example 1 Example 2 Example3 Example4
Click each cube to see how it was generated..


Features


To Do

The following features/bug fixes are planned for the future (ordered by priority).

Source Code

The source code for this script is available under the GNU Lesser General Public License at sourceforge.net/projects/vcube.


Parameters

VariableDescriptionValue RangeDefaultComment
.script extension .png | .gif | .jpg | .svg | .tiff | .ico .png The extension used in the script url dictates the format of the image generated. For example: visiting /visualcube.jpg will create a jpeg image.
fmtImage Format png | gif | jpg | svg | tiff | ico .png Used as an alternative to using an image extension as above.
pzlPuzzle Type1 to 93 Values from N=(1 to 9) represent an NxNxN cube. Currently only regular cubes are modelled
sizeSize of generated image0 to 1024128 Images produced are square, so size specifies both width and height of the final image in pixels.
viewSpecial Viewplan|trans  The view parameter allows special views to facilitate interpretation of different case aspects.
plan rotates cube to expose U face, while showing the sides of the top layer
trans sets the cube base colour to transparent, and hides any masked or undefined faces
stageStage Maskfl | f2l | ll | cll | ell | oll | coll | ocell  Sets parts of the cube to be masked from being coloured.
rRotation Sequence([xyz]-?[0-9][0-9]?[0-9]?)+y45x-34 Each entry in the sequence is an axis (x, y or z), followed by the number of degrees to rotate in a clockwise direction. Negative values are permitted. Any number of rotations is possible.
State Definitions
algAlgorithm to apply[UDLRFBudlrfbMESxyz'2 ]*  The system applies the algorithm to the cube and displays the resulting state.

NOTE: Currently unavailable for 4x4 cubes or above
caseAlgorithm to solve case[UDLRFBudlrfbMESxyz'2 ]*  The system displays the cube state which is solved by applying the algorithm (algorithm inverse).

NOTE: Currently unavailable for 4x4 cubes or above
fdFacelet Definition[udlrfbnot]* uuuuuuuuu rrrrrrrrr fffffffff ddddddddd lllllllll bbbbbbbbb Defines the cube state in terms of facelet positions. u stands for a 'U' facelet (and likewise with rfdlb). Defining a cube state using this method means the cube will be coloured according to the scheme defined by the sch variable. Three special characters are used to indicate the following:
n: This is a blank face (coloured grey)
o: This is an 'oriented' face (coloured silver)
t: This is a transparent face, and will not appear on the cube
fcFacelet Colours[ndlswyrobgmpt]* yyyyyyyyy rrrrrrrrr bbbbbbbbb wwwwwwwww ooooooooo ggggggggg Defines the cube state in terms of facelet colours, as an alternative to using fd. fc takes precedence over fd if both are defined.

See the 'sch' variable below for an explanation of the colour codes.
Cube Style
schColour Scheme [ndlswyrobgmp]*6

OR

Comma separated list containing 6x one of:
black | dgrey | grey | silver | white | yellow | red | orange | blue | green | purple | pink | [0-9a-fA-F]*3 | [0-9a-fA-F]*6
yrbwog The order of the colours specified represent the faces in this order:

U R F D L B

The letters used in shorthand notation map to the generic face colours as follows: n=black (noir), d=dark grey, l=light grey, s=silver (lighter grey), w=white, y=yellow, r=red, o=orange, b=blue, g=green, m=purple (magenta), p=pink, t=transparent

Where longhand notation is used, 3 or 6-digit hex codes can be used to specify the exact colour. for example C80000 would be a dark red colour.
bgBackground Colour of image[ndlswyrobgmpt]

OR

black | dgrey | grey | silver | white | yellow | red | orange | blue | green | purple | pink | [0-9a-fA-F]*3 | [0-9a-fA-F]*6
FFFThe value t represents transparent, and is only valid for png and gif images.
ccCube Coloursee aboveblackThis is the cube's base colour.
coCube Opacity0 to 99100 Setting this value causes the base cube to be transparent. It means facelets at the back of the cube will also be rendered. A value of 0 gives complete transparency.
foFacelet Opacity0 to 99100 Setting this value causes the facelets to be rendered with transparency.