X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=moebius2.git;a=blobdiff_plain;f=output.c;h=95a26c3dbcf0d6f4e7a1db83f4026ef9919f0fcc;hp=e37aa7c21775c3383381b856685fd7ed1be6370b;hb=b80ac2586e60a67554af86a8345ccff79af8a570;hpb=fcb05a81ecead2dcd3375c6d4ceb528ca6e181c0;ds=sidebyside diff --git a/output.c b/output.c index e37aa7c..95a26c3 100644 --- a/output.c +++ b/output.c @@ -10,6 +10,10 @@ * - scale the coordinates * - translate the coordinates so they're all positive */ +/* + * ./output-64 t.stl + * meshlab t.stl + */ /* * Re STL, see: * http://www.ennex.com/~fabbers/StL.asp @@ -149,6 +153,10 @@ static double scale; static void outfacet(int rev, const OutVertex *a, const OutVertex *b, const OutVertex *c); +typedef int int_map(int); +static int defs_aroundmap_swap(int around) { return NDEF-around; } +static int int_identity_function(int i) { return i; } + static void normalise_thick(double a[D3]) { /* multiplies a by a scalar so that its magnitude is thick */ int k; @@ -262,8 +270,10 @@ static void compute_outvertices(void) { normalise_thick(radius_cos); normalise_thick(radius_sin); + int_map *around_map= y ? int_identity_function : defs_aroundmap_swap; + for (around=0; around