next up previous
Next: Demonstration Up: Implementation Previous: 3D Tetris:

``Glue''

A relatively short script written in PERL integrates the two programs:

  1. Reads the state of the 3D Tetris game from the aforementioned pipe
  2. Builds element connectivity matrix and compiles a list of nodes
  3. Formats the problem into a text file that SLFFEA can read
  4. Assign boundary conditions and loads to the nodes in a modular fashion (so different types of games could be played)
  5. Run SLFFEA automatically, and parse the output file to see if engineering objectives have been achieved (also modular, to allow different types of projects... e.g. buildings, bridges, etc.)
Some of the challenges involved in writing this script:

  1. Digging through the Gnome 3D Tetris code to find out how the internal state was represented - evidently it displays everything in 4 quadrants with 4 separate coordinate systems.
  2. Each brick element has connectivity to 8 nodes, each with a unique ID, which are also shared with adjacent bricks. To keep track of node IDs and avoid duplicates, they were stored in a hash (PERLance for dictionary) somewhat counterintuitively: with the 3D coordinates served as key that stored the unique ID as data.
  3. The specification the nodes of each brick element had to proceed in a certain order, so that successive nodes were joined by an edge of the cube (and not a diagonal). Otherwise, SLFFEA complains of inverted elements and cannot provide a solution. That accounts for the weird looping of the variables $i and $j in the script.


next up previous
Next: Demonstration Up: Implementation Previous: 3D Tetris:
Rowin Andruscavage 2001-04-30