diff g/source/parse.h toroid-patch/parse.h 505a506 > TOROIDAL_TOKEN, /* PoD */ diff g/source/parstxtr.c toroid-patch/parstxtr.c 1,2c1 < /**************************************************************************** < * parstxtr.c --- > /* parstxtr.c 705a705,709 > EXIT > END_CASE > > CASE (TOROIDAL_TOKEN) > New->Type = TOROIDAL_PATTERN; diff g/source/pattern.c toroid-patch/pattern.c 72a73 > static DBL toroidal (VECTOR EPoint); /* PoD */ 1312a1314,1332 > /* PoD */ > static DBL toroidal (VECTOR EPoint) > { > register DBL value; > register DBL d2; > > /*distance from circle = sqrt( y*y + (sqrt(x*x+z*z)-1)*(sqrt(x*x+z*z)-1) )*/ > /* thanks to John VanSickle and Peter Popov for the formula */ > > d2 = sqrt(EPoint[X]*EPoint[X]+EPoint[Z]*EPoint[Z]) - 1.0; > if( fabs(EPoint[Y]) >= 1 || d2 >= 1.0 ) > return(DBL)0; > value = sqrt( EPoint[Y]*EPoint[Y] + d2*d2 ); > CLIP_DENSITY(value); > > return(value); > } > /* PoD */ > 1465a1486 > case TOROIDAL_PATTERN: value = toroidal (TPoint); break; /* PoD */ diff g/source/pattern.h toroid-patch/pattern.h 85c85 < --- > #define TOROIDAL_PATTERN 32 /* PoD */ diff g/source/tokenize.c toroid-patch/tokenize.c 517a518 > {TOROIDAL_TOKEN, "toroidal"},