#include "print.h"
Go to the source code of this file.
Functions | |
| int | main () |
Definition in file test-cube.cc.
|
|
Definition at line 32 of file test-cube.cc. References euler::loop_t::del_single_vertex_edge_pair(), euler::loop_t::e, euler::loop_t::f, euler::solid_t::f, euler::face_t::l, euler::solid_t::mef(), euler::loop_t::mev(), euler::edge_t::nxt, and euler::edge_t::pre. 00033 { 00034 point_t p(1.,1.,1.); // geometrically collapsed to one pnt. 00035 00036 /* 00037 * intialize to skeletal cube: 00038 * topology = 1 0d-cell + 1 2d-cells 00039 */ 00040 solid_t *s = solid_t :: mvfs(p); 00041 loop_t *l = s->f->l; // singular loop: 0 00042 cerr << s << endl; 00043 00044 /* 00045 * add 3 consecutive dangling edges to form an open square: 00046 * topology = 4 0d-cell + 3 1d-cells + 1 2d-cell 00047 */ 00048 l->mev( l->mev( l->mev( l->f->l->e, p ), p ), p ); 00049 l->del_single_vertex_edge_pair(); // loop = 0 1 2 3 2 1 00050 cerr << l << endl; 00051 00052 00053 /* 00054 * close the open square by splitting the loop 00055 * topology = 2 2d-cells (faces) + 4 1d-cells (edges) + 4 0d-cells (vertices) 00056 */ 00057 s->mef(l->e, l->e->nxt->nxt->nxt); // new loop: 3 0 1 2 (top cube face), old loop l= 0 3 2 1 00058 cerr << s << endl; 00059 cerr << l << endl; 00060 00061 00062 /* 00063 * next, add a dangling edge to each vertex of the square 00064 */ 00065 edge_t 00066 *e03 = l->e, 00067 *e10 = e03->pre, 00068 *e21 = e10->pre, 00069 *e32 = e21->pre; 00070 00071 l->mev(e03, p); 00072 00073 l->mev(e10, p); 00074 00075 l->mev(e21, p); 00076 l->mev(e32, p); // now: 0 3 7 3 2 6 2 1 5 1 0 4 00077 cerr << s << endl; 00078 cerr << l << endl; 00079 00080 /* 00081 * close the 4 opening squares to form the cube 00082 */ 00083 edge_t 00084 *e40 = l->e->pre, 00085 *e73 = l->e->nxt->nxt, 00086 *e62 = e73->nxt->nxt->nxt, 00087 *e51 = e62->nxt->nxt->nxt; 00088 00089 s->mef(e40, e73); 00090 s->mef(e73, e62); 00091 s->mef(e62, e51); 00092 s->mef(e51, e51->nxt->nxt->nxt); 00093 00094 cerr << s << endl; 00095 }
|
1.4.6