Contraction simply merges neighboring points in a triangle mesh until the desired reduced triangle count is achieved. Currently the algorithm has poor results on shapes with edges, it does well on complete shapes.
Contraction can be performed on input triangle and point data from a file, or on generated data.
The option used to control triangle count is --triangles or -t.
The basic sphere has 5582 triangles, lets see what it looks like with only 500 triangles:
$ meteor -e "x*x + y*y + z*z = .8" -t 500
Compare the contracted version (500 triangles) on the left to the non contracted version (35808 triangles) right
The wireframe version (specify -kl, or press 'l' in the viewer)
Contraction can also be interleaved with generation to reduce overall memory requirements. The contraction algorithm produces poorer results if it is forced to contract before finishing, so it is recommended to specify a higher triangle count than the desired final triangle count, then perform final contraction once generation is complete. The count is specified with --max-triangles. While generating, the triangle count should not exceed this value. Due to the O(n*logn) nature of the contraction algorithm, using --max-triangles increases the overall speed.
This example is easy to demonstrate:
$ meteor -e "x*x + y*y + z*z = .8" -s.01 -vn --max-triangles 10000 -t 1000 compiling 'x*x + y*y + z*z = .8'... 0.051916 seconds No normal function, will use input function to approximate building... 4.272659 seconds merging triangles: 0.029741 seconds Points: 502/5002/451058 Triangles: 1000/10000/902112 $ meteor -e "x*x + y*y + z*z = .8" -s.01 -vn -t 1000 compiling 'x*x + y*y + z*z = .8'... 0.052305 seconds No normal function, will use input function to approximate building... 1.901114 seconds merging triangles: 5.072709 seconds Points: 502/451058 Triangles: 1000/902112
The first version takes longer to build because it is performing contraction at the same time. Overall it is much faster. Both versions are of similar quality.