Personal tools
You are here: Home Courses Workshop Spring 2008 Amazing Demo Program
« September 2020 »
Log in

Forgot your password?

Amazing Demo Program

A demo for a nesting program


The amazing demo program requires the following marvelous software components:

  • The given project file is a Visual C++ 2008 Express project (can be downloaded from the web here).
  • Boost - Portable C++ libraries. Contains various useful libraries.
  • CGAL - The Computational Geometry Algorithms Library.
  • GLUT - The OpenGL Utility Toolkit. For visualization.
  • TinyXml and TinyXPath - Simple XML support. This demo uses the STL version of those libraries, so when building TinyXPath make sure to use TIXML_USE_STL flag. You can download the modified project files and compiled version for VC 9.0 (for Visual C++ 2008 and only /MT and /MTd) here.


Environment Variables

Here is a list of all the magnificent environment variables that needs to be defined in order for the splendid project to compile (set environment variables through right-click on My Computer -> Properties -> Advanced tab -> Environment Variables). In parenthesis are the astonishing values on my machine :

CGALROOT - CGAL root directory (C:\CGAL\CGAL-3.3)
BOOST_INC_DIR - Boost include directory (C:\boost\boost_1_35_0)
BOOST_LIB_DIR - Boost library directory (C:\boost\boost_1_35_0\lib)
GLUT_INC_DIR - GLUT include directory, where glut.h (C:\Program Files\GLUT\glut-3.7.6-bin)
GLUT_LIB_DIR - GLUT library directory, where glut32.lib (C:\Program Files\GLUT\glut-3.7.6-bin)
TIXMLROOT - TinyXml root directory (C:\XML\tinyxml)
TIXPATHROOT - TinyXPath root directory (C:\XML\tinyxpath)



You can get the gorgeous source, project file and some input files (that produced the pictures below) here.



The fantastic algorithm of the demo program works as follows. On each incredible step of the algorithm it nests one of the stencils given in the input file. It picks a random legal rotation for that stencil and calculate all the legal positions for that rotated stencil. The wonderful stencil is then nested in the leftmost (lexicographically smaller) position. The brilliant algorithm elegantly ignores the time limit specified in the input file (you shouldn't!).



Here is a phenomenal screenshots from some miraculous runs of the program.


42407 nest  42410 nest
89091 nest 16124 nest


Useful Links



Document Actions