test-torus.cc

To maake a torus using rotational sweeping a lamina disk. Two torus with different resolutions are shown below; the first one is generated using a smaller resolution than the one in the program.

test-torus-1.gif
test-torus-2.gif

Author:
Xianming Chen
Computer Science Department
University of Utah
Date:
17 Aug 2006
Copyright (c) 2006, University of Utah
00001 /**
00002  *\file         test-torus.cc
00003  *
00004  *\brief        maake a torus using rotational sweeping a lamina disk.
00005  *
00006  *\example      test-torus.cc
00007  *              To maake a torus using rotational sweeping a lamina disk. Two torus with different resolutions are shown below;
00008  *              the first one is generated using a smaller resolution than the one in the program.
00009  *
00010  *\image        html test-torus-1.gif
00011  *\image        html test-torus-2.gif
00012  *
00013  *\author       Xianming Chen\n
00014  *              Computer Science Department\n
00015  *              University of Utah
00016  *
00017  *\date         17 Aug 2006\n
00018  *              Copyright (c) 2006, University of Utah
00019  */
00020 
00021 #include "euler.h"
00022 #include "print.h"
00023 #include <fstream>
00024 
00025 using namespace euler;
00026 
00027 int main()
00028 {
00029   solid_t* s = solid_t :: disk( point_t(), 1.0, 25);
00030 
00031   face_t* f0 = s->f->nxt;
00032    
00033   *s += vector_t(0.f, 1.5f, 0.0);
00034 
00035   cout << s << endl;
00036 
00037   s->rsweep_face( s->f, 0.0, pi * 2, 25);
00038   cout << s << endl;
00039   cout << "f0 = " << f0 << endl;
00040   face_t* f1 = f0->pre;
00041   cout << "f1 = " << f1 << endl;
00042 
00043   s->kffmh(f0, f1);
00044 
00045   cout << s << endl;
00046 
00047   ofstream os("test-torus.off", ios::out);
00048   s->print_off_file(os);
00049 
00050   return 0;
00051 }
00052 

Generated on Wed Aug 30 16:27:58 2006 for euler by  doxygen 1.4.6