* - scale the coordinates
* - translate the coordinates so they're all positive
*/
+/*
+ * ./output-64 <dense-64.cfm 0.1 50 >t.stl
+ * meshlab t.stl
+ */
/*
* Re STL, see:
* http://www.ennex.com/~fabbers/StL.asp
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;
normalise_thick(radius_cos);
normalise_thick(radius_sin);
+ int_map *around_map= y ? int_identity_function : defs_aroundmap_swap;
+
for (around=0; around<NDEF; around++) {
- double angle= around * M_PI / (NDEF-1);
+ double angle= around_map(around) * M_PI / (NDEF-1);
K Ok(ovDEF[x][!!y][around],
in[v0][k] +
cos(angle) * radius_cos[k] +
}
}
-static int defs_aroundmap_swap(int around) { return NDEF-around; }
-static int int_identity_function(int i) { return i; }
-
static void outfacets(void) {
int v0,e,side,aroung, k;
FOR_VERTEX(v0) {
OutVertex *defs=0, *defs1=0;
- int (*defs1aroundmap)(int)=0, rimy=-1;
+ int rimy=-1;
+ int_map *defs1aroundmap= 0;
if (RIM_VERTEX_P(v0)) {
OutVertex *gs;
rimy= !!(v0 & ~XMASK);