// fig8full.fe
// Evolver data for figure 8 knot with maximal film

// Begins as cone film from origin.  Needs popping.

parameter aparam = 0.2  // for inner radius of knot
#define eps 0.02

boundary 1 parameter 1  convex  // parametric curve 
x1: aparam*cos(p1) + 0.5*sin(p1) + (1-aparam)*cos(3*p1) - 0.5*sin(3*p1)
x2: cos(2*p1) + (sqrt(2)*aparam - sqrt(0.5))*sin(2*p1)
x3: 0.5*cos(p1) - aparam*sin(p1) + 0.5*cos(3*p1) + (1-aparam)*sin(3*p1)

vertices
1    0*pi/8  boundary 1   
2    1*pi/8  boundary 1   
3    2*pi/8-eps  boundary 1   
4    3*pi/8  boundary 1   
5    4*pi/8  boundary 1   
6    5*pi/8  boundary 1   
7    6*pi/8-eps  boundary 1   
8    7*pi/8  boundary 1   
9    8*pi/8  boundary 1   
10   9*pi/8  boundary 1   
11  10*pi/8-eps  boundary 1   
12  11*pi/8  boundary 1   
13  12*pi/8  boundary 1   
14  13*pi/8  boundary 1   
15  14*pi/8-eps  boundary 1   
16  15*pi/8  boundary 1   
17  0 0 0   // origin
18    2*pi/8+eps  boundary 1   
19    6*pi/8+eps  boundary 1   
20  10*pi/8+eps  boundary 1   
21  14*pi/8+eps  boundary 1   


edges
1     1 2 boundary 1  
2     2 3 boundary 1   
3     18 4 boundary 1   
4     4 5 boundary 1   
5     5 6 boundary 1   
6     6 7 boundary 1   
7     19 8 boundary 1   
8     8 9 boundary 1   
9     9 10 boundary 1  
10    10 11 boundary 1   
11    20 12 boundary 1   
12    12 13 boundary 1   
13    13 14 boundary 1   
14    14 15 boundary 1   
15    21 16 boundary 1   
16    16 1  boundary 1   
18    17 7
19     7 1
20    17 11
21    11 5
22    17 15
23    15 9
24    17 3
25    3 13
26    3 18  boundary 1   // for splitting inner vertices
27    7 19  boundary 1
28    11 20  boundary 1
29    15 21  boundary 1
30    17 19
31    17 20
32    17 21
33    17  18
34    19 1
35    20 5
36    21 9
37    18 13

faces
1   18 19 1 2 -24
2   32 15 16 -34 -30
3   20 21 5 6 -18
4   33 3 4 -35 -31
5   22 23 9 10 -20
6   30 7 8 -36 -32
7   24 25 13 14 -22
8   31 11 12 -37 -33
9   18 27 -30   
10  20 28 -31
11  22 29 -32
12  24 26 -33
13  19 -34 -27
14  21 -35 -28
15  23 -36 -29
16  25 -37 -26

read 
hessian_normal

// Typical evolution.  Ideally, the places where the wire passes
// through the film have some fascinating fine detail as the triple
// lines go tangent to the wire, but this evolution does not go far
// enough to resolve such detail.
gogo := {  refine edge where on_boundary 1;
	   t .1;  // get rid of too fine details
	   g 5;
	   t .1;
	   o;    // pop central vertex
	   g 10; V; u; V; r; g 20; r; g 20;
           fix vertex where on_boundary 1; k 0;  // so can use Hessian
	   fix edge where on_boundary 1;
           hessian; hessian;
	}
