// P3a.fe

// Lord & Mackay P3a surface.  Triples of quads on frame I joined by tetrahedral tunnel

// Fundamental region - one quarter of a tetragonal disphenoid
// Much like my disphenoid31, but uses the two equal length C2 axes instead of
// unequal C2 axes.

symmetric_content

constraint 1
formula: x = y

constraint 2
formula: y = -z

constraint 3
formula: y = z

view_transform_generators 5
0 1 0 0  // a: x=y mirror
1 0 0 0
0 0 1 0
0 0 0 1

1 0 0 0  // b: z = -y mirror
0 0 -1 0
0 -1 0 0
0 0 0 1

1 0 0 0  // c: z = y mirror
0 0 1 0
0 1 0 0
0 0 0 1

swap_colors
0 0 -1 2  // d: C2 on upper edge of fund
0 -1 0 2
-1 0 0 2
0 0 0 1

swap_colors
0 0  1 2  // e: C2 on lower edge of fund
0 -1 0 2
 1 0 0 -2
0 0 0 1

vertices
1   1 1 -1  fixed
2   1 1  1  fixed
3   2 1 0  fixed
4   1 1 0.0 constraint 1
5   0.3 0.3 0.3 constraint 3
6   0.7 0 0 constraints 2,3
7   0.5 0.3 -0.3 constraint 2
8   0.3 0.3 -0.3 constraints 1,2

// tetrahedral frame
10  1 1 -1 fixed
11  1 1 1 fixed
12  2 1 0 fixed
13  0 0 0 fixed
14  2 0 0 fixed

edges
1  1 4 constraint 1
2  4 3 
3  3 1 fixed
4  3 2 fixed
5  2 5 constraint 3
6  5 3
7  5 6 constraint 3
8  6 7 constraint 2
9  7 8 constraint 2
10  8 4 constraint 1
11  7 3
// frame
12  10 11 bare no_refine fixed
13  10 12 bare no_refine fixed
14  10 13 bare no_refine fixed
15  11 12 bare no_refine fixed
16  11 13 bare no_refine fixed
17  13 14 bare no_refine fixed
18  10 14 bare no_refine fixed
19  11 14 bare no_refine fixed
20  12 14 bare no_refine fixed


faces
1  -3 -2 -1 
2  4 5 6
3  11 -6 7 8
4  9 10 2 -11


bodies
1    1 2 3 4  volume 0.06

read

set facet backcolor yellow

gogo := {
  r; g; g; u; V; u; 
  refine edge where length > 0.5 and not no_refine;
  refine edge where length > 0.4 and not no_refine;
   u; V; g 12; 
  refine edge where length > 0.3 and not no_refine;
  u; V; g 12;
  refine edge where on_constraint 3;
  g 12; u; V;
  refine edge where on_constraint 2;
  refine edge where on_constraint 1;
  u; V; g 12; u;
  refine edge where on_constraint 1;
  g 21; u; V;
  t .1;
  r; u; V;
  g 30;
  unset body[1].target;
  hessian; hessian; hessian;
}

cube := { transform_expr "bcacba" } // actually the straight-line frame
rhombic := { transform_expr "abcbacbde" ;
             set facet frontcolor yellow;
             set facet backcolor white;
             show edge where id==14 or id==16 or valence==1;
 }
disphenoid := {
                transform_expr "ed" ;
                show edge where id==14 or id==16 or id==17 or valence==1;
}

thickness /= 4

