/* See {Donut.h} */ #include /* Last edited on 2007-02-04 18:45:36 by stolfi */ #define Donut_C_COPYRIGHT \ "Copyright © 2000,2007 Universidade Estadual de Campinas (UNICAMP)" #include #include #include #include #include #include #include #include #include #include #include #include #include Place_t MakeDonut(uint order) { FourPlaces_vec_t s = Make1DCubeArrayBis(order); Place_t a = NextE(PrevF(s.e[0].p[2])); Place_t b = Clock(PrevF(PrevE(NextF(NextF(NextE(PrevF(s.e[order-1].p[3]))))))); GlueCubeT(a,b); return s.e[0].p[3]; } Place_t MakeDoubleDonut(uint order) { /* This construction is based in the connected sum of two manifolds */ Place_t a = MakeDonut(order); Place_t b = MakeDonut(order); Place_t c = NextF(NextE(NextF(NextF(NextE(PrevF(b)))))); (void) Glue(Clock(a), Clock(c), 2, TRUE); assert(DegreeOfWall(a) == 4); assert(DegreeOfWall(NextE(a)) == 7); assert(DegreeOfWall(PrevE(a)) == 4); return a; } #define Donut_C_author \ "Procedures created in Modula-3 by L. A. P. Lozada, 1999-2000.\n" \ "Modification history:\n" \ " 2007-02-10 Brought {MakeDonut}, {MakeDoubleDonut} from {MakeObjectTriang.c}"