/************************************************************************** LATTICE GENERATOR FOR POV-Ray 3.1 (Demo file) Created by: Thomas de Groot (the Netherlands) e-mail: t.degroot@inter.nl.net On: 20 January 1998 Revised: 29 September 1998 Updated: 01 May 1999 Contains: Demo file for use with 'Lattice.inc' and 'DifShapes.inc' Copyright: May be freely used and modified. Please acknowledge author. ************************************************************************** DESCRIPTION: With the help of the two include files 'Lattice.inc' and 'DifShapes.inc', you can easily construct a 2-D or 3-D lattice of hollow pipes. The pipes are hollow so that they can also be used for inside views (e.g. a space station). 'DifShapes.inc' (include file 1) contains seven different pipe lengths (Pipe1 to Pipe7) and the different pipe joints needed. Pipe diameters however, are identical for all pipes. 'Lattice.inc' (include file 2) calculates the lattice you have selected, provided you feed it with a few parameters: - X, Y, Z: are the pipe lengths in the three dimensions. Lengths vary between 1 - 7. - RowIteration, ColIteration, LevIteration: are the number of rows, columns, or levels, of pipes in each direction. Default values are: '1' for all three dimensions, and '4' for all iterations. You can choose between five types of Lattices: 'SquareLattice' (2-D), 'CubeLattice' (3-D), 'FlatLattice' (2-D), 'SpaceLattice' (3-D) and 'CageLattice' (3-D), to be declared in your main program. This Demo shows the use of 'Lattice.inc'. **************************************************************************/ #version 3.1; // CAMERA POSITION camera { right < 1.33, 0, 0 > up < 0, 1, 0 > direction < 0, 0, 1 > location <-150, 80, -140> look_at <0, 80, 0> angle 75 } #include "colors.inc" light_source { < -150, 400, -150 > color White } background { color Gray90 } //------------------- include file 1 ---------------------- #include "DifShapes.inc" //------------------- lattice parameters --------------------- // First, declare the parameters for your lattice: #declare X = 5; // Pipe length to use: X direction (1 - 7) #declare Y = 3; // 3-D: Pipe length to use: Y direction (1 - 7) #declare Z = 2; // Pipe length to use: Z direction (1 - 7) #declare RowIteration = 6; // number of rows. In the example: 6 rows #declare ColIteration = 4; // number of columns. In the example: 4 colums #declare LevIteration = 5; // 3-D: number of levels. In the example: 5 levels //------------------- include file 2 ---------------------- #include "Lattice.inc" //---------------------- lattice type ------------------------ /* Indicate now the Lattice you want ('SquareLattice', 'CubeLattice', 'FlatLattice', 'SpaceLattice' or 'CageLattice')*/ object { SpaceLattice pigment {rgb <0.8, 0.4, 0.6>} }