Example: Compound of a Cube and Octahedron
The example is used to present a variety modelling techniques. A short
way of making the model is given at the end.
1. Make a cube
This can be done with unipoly, which can be used to make all
the uniform polyhedra.
unipoly cube > cube.off
Display with
off2pov -o cube.pov cube.off
povray +a +p cube.pov
2. Make the dual octahedron
pol_recip is used for making duals by polar reciprocation.
To make a nice compound the radius of the sphere used for reciprocation needs
to be the distance from the cube centre to the mid-point of an edge, and
the sphere centre must be the centre of the cube.
unipoly has centred the cube on (0, 0, 0), but pol_recip
will find this appropriate reciprocation centre by default.
The radius can be specified using the
-r option and passing two adjacent vertex index numbers of the cube.
Again, pol_recip will find the appropriate radius by default,
but for this example the radius will be specified in the command.
You can use off2pov with the -n option to display the cube
with its vertex numbers.
off2pov -x f -n -o cube.pov cube.off
povray +a +p cube.pov
If you have antiview available then that is the easier option
antiview -x f -n v cube.off
Vertices 3 and 5 are adjacent, so make the dual octahedron like this, and
display it.
pol_recip -r 3,5 cube.off > oct.off
off2pov -o oct.pov oct.off
povray +a +p oct.pov
3. Merge the polyhedra
OFF files are merged with off_util
off_util cube.off oct.off > cub_oct.off
Display the result.
off2pov -o cub_oct.pov cub_oct.off
povray +a +p cub_oct.pov
4. Use colours
To make it clearer that this is a compound of a cube and octahedron
the two polyhedra could be given different colours using off_color.
Colour the cube faces red, and the octahedron faces green. The
colours can be given as values, or by their colour names.
off_color -f 1.0,0.0,0.0 cube.off > red_cube.off
off_color -f green oct.off > green_oct.off
Now merge and display as before, this time making the edge and
vertex elements smaller than the defaults
off_util red_cube.off green_oct.off > color_cub_oct.off
off2pov -v 0.02 -e 0.016 -o color_cub_oct.pov color_cub_oct.off
povray +a +p color_cub_oct.pov
5. A shorter way to make the model
The cube is included as a
resource model
called cube. The pol_recip defaults are just right for this
model. off2pov accepts multiple off files so there is no need to
merge them.
The model and ray-traced image can be made with
off_color -f red cube > cube_red.off
pol_recip cube | off_color -f green > oct_green.off
off2pov -v 0.02 -R 20,10,0 -o color_cub_oct.pov cube_red.off oct_green.off
povray +a +p color_cub_oct.pov
Next:
Example: Icosahelix
Up:
Examples Using the Programs
|