Next: Demonstration
Up: Implementation
Previous: 3D Tetris:
A relatively short script written in PERL integrates the two programs:
- Reads the state of the 3D Tetris game from the aforementioned pipe
- Builds element connectivity matrix and compiles a list of nodes
- Formats the problem into a text file that SLFFEA can read
- Assign boundary conditions and loads to the nodes in a modular fashion (so different
types of games could be played)
- 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:
- 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.
- 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.
- 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: Demonstration
Up: Implementation
Previous: 3D Tetris:
Rowin Andruscavage
2001-04-30