Function Repository Resource:

# ChessVoxels

Graphics3D primitives for a set of voxelated chess pieces

 ResourceFunction["ChessVoxels"][piece] represents a voxel chess piece centered at {x,y}={0,0} with base height z=0. ResourceFunction["ChessVoxels"][piece,{x,y,z}] represents a voxel chess piece centered at {x,y} with base height z. ResourceFunction["ChessVoxels"][piece,{x,y,z},θ] also rotates the piece counter-clockwise around the vertical by θ radians. ResourceFunction["ChessVoxels"][piece,{x,y,z},θ,scale] also scales linear dimensions by a factor scale. ResourceFunction["ChessVoxels"][piece,{x,y,z},θ,scale,v] also rotates the piece vertical vector from {0,0,1} to v. ResourceFunction["ChessVoxels"][] lists allowable values for the input piece. ResourceFunction["ChessVoxels"]["StandardGame"] gives inputs for setting up a standard chess game on an 8×8 board.

## Details

Voxels are initially scaled to be size (1/8)3 so that each piece fits squarely on a unit square, by default[0,1]×[0,1] at vertical height 0. Setting scale=8 obtains unit-edge voxels if necessary.
Each piece is returned as a two-element list of graphics primitives, which allows pieces to be given two-tone coloring styles (see examples).
The "StandardGame" return separates pieces by player, i.e. has the form: {player1,player2}={{p11,p12,…},{p21,p22,…}} with pxy being the yth piece of player x.

## Examples

### Basic Examples (5)

Obtain the primitive Polyhedron objects for a chess Knight:

 In[1]:=
 Out[1]=

Plot the Knight at the origin:

 In[2]:=
 Out[2]=

 In[3]:=
 Out[3]=

Plot all pieces using isomorphic perspective:

 In[4]:=
 Out[4]=

Arrange the chess pieces on a board in the usual way:

 In[5]:=
 Out[5]=

### Scope (2)

Pieces can be scaled to smaller or larger sizes:

 In[6]:=
 Out[6]=

Pieces can be rotated in three dimensions by setting a vertical vector:

 In[7]:=
 Out[7]=

### Neat Examples (1)

Put the chess pieces in a scene with a non-trivial height map:

 In[8]:=
 Out[8]=

## Version History

• 1.0.0 – 09 December 2022