Flapping Bird

part one

<<origami.m

Initial setting

{t0, t1, t2, t3, t4, t5, t6, t7, t8} =
  {{0, 0, 0}, {-1, -1 ,0}, {-1, 1, 0}, {1, 1 ,0},
   {1, -1, 0}, {1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {0, 1, 0}};
t9 = (t5 + t4)/2; t10 = (t6 + t4)/2;
t11 = (t9 + t10)/2; t12 = {-.5, 1, .0}; t13 ={ -1., .5, .0};
Opt = {LightSources ->   
       {{{0, 0, 1}, RGBColor[.51, .0, .9]}, 
        {{0, 10, 0}, RGBColor[.51, .0,.91]}, 
        {{10, 0, 0}, RGBColor[.51, .0, 1.]}}};

Show initial square

InitialSquare =
  Graphics3D[{EdgeForm[{RGBColor[0.1,0.,0.8],
              Thickness[0.005]}],
              SurfaceColor[RGBColor[1,1,1]],
              Polygon[{t1,t2,t3,t4}]}, 
              Boxed->False,         
              PlotRange -> All];

Show[InitialSquare];

Open square

Square = Graphics3D[{RGBColor[.1,.0,.9], Thickness[.005],
                     Dashing[{.05, .05}], Line[{t4, t3}],
                     EdgeForm[{RGBColor[.1,.0,.9],
                     Thickness[.005]}],
                     SurfaceColor[RGBColor[1,1,1]],
                     Polygon[{t1, t2, t3, t4}],
                     SurfaceColor[RGBColor[1, 1, 1]],
                     Polygon[{t0,t7 + {0, 0, N[10^-6]},
                              t2, t8 + {0, 0, N[10^-6]}}],
                     SurfaceColor[RGBColor[1,1,1]],
                     Polygon[{t0, t5, t4, t6}],
                     RGBColor[1.,.0,.3], Thickness[0.006],
                     Dashing[{.03, .03}],
                     Line[{t7, t5}], Line[{t6, t8}]},    
                     Boxed -> False, PlotRange -> All];

Show[Square];

Preliminary Fold

b1 = {EdgeForm[{RGBColor[.1, .0, .9],
      Thickness[.005]}],
      SurfaceColor[RGBColor[1, 1, 1]],
      Polygon[{t0, t5, t4, t6}]};     
a1 = {Polygon[{t0, t4, t6}]};  
Tc = Table[Map[preliminaryFold[#, t4,
          N[Pi*(1 - i/10.2)]]&, a1], {i, 1, 10}]//N;  
ShowpreliminaryFold = Show[Graphics3D[Join[b1, #],
                      Boxed -> False, PlotRange -> All]]&;

Map[ShowpreliminaryFold, Tc];

New lines for folding

b1 = {EdgeForm[{RGBColor[.1, .0, .9],
        Thickness[.005]}],
        SurfaceColor[RGBColor[1,1,1]],
  Polygon[{t0, t5, t4 + {.0, .0,.05}, t6}],
        SurfaceColor[RGBColor[1, 1, 1]],
  RGBColor[1.,.0,.3], Thickness[.007],
  Dashing[{.03, .03}],
     Line[{(t0 + t6)/2, t4 + {0, 0, .05}}],
     Line[{t4 + {0, 0, .05}, (t0 + t5)/2}],
 Line[{(t0 + t6)/2, t4}], Line[{t4, (t0 + t5)/2}],
 Line[{(t0 + t6)/2, t4 - {0, 0, .05}}],
 Line[{t4 - {.0, .0, .05}, (t0 + t5)/2}],
 Polygon[{t4 - {.02, .0,.0}, t6,t0}],
 Polygon[{t4 - {.0, -.02, .0}, t0, t5}],
        SurfaceColor[RGBColor[1., 1., 1.]],
 Polygon[{t0, t5 + {.0, .0,-.05}, t4 - {.0, -.02, .0}}],
 Polygon[{t0, t4 - {.02, .0, .0}, t6 + {.0, .0, -.05}}],
        SurfaceColor[RGBColor[1, 1, 1]],
 Polygon[{t0, t5 + {.0,.0,-.05}, t4 + {.0, .0, -.05},
          t6 + {.0, .0, -.05}}]};
 add = {Line[{(t0 + t6)/2+{.0, 0., .01}, 
             (t0 + t5)/2+{.0, 0., .01}}],
        Line[{t4 + {0, 0, .05} + {.0, 0.,.01}, 
             ((t0 + t6)/2 + {.0, 0., .015} + 
              (t0 + t5)/2 + {.0, 0.,.015}) / 2}]};                     
NewLines1 = Graphics3D[Join[b1,add], Boxed -> False, 
                      PlotRange -> All];

NewLines = Graphics3D[b1, Boxed -> False, 
                      PlotRange -> All];

Show[NewLines];
Show[NewLines1];

Initial setting for Bird Base

Off[General::spell1];
c={EdgeForm[{RGBColor[.1, .0, .9], Thickness[.005]}],    
   SurfaceColor[RGBColor[1, 1, 1]], 
   Polygon[{(t5 + t0)/2., (t6 + t0)/2., t0}],
   Polygon[{t4 - {.01, .0, .0}, (t6 + t0)/2., t0}],
   Polygon[{t0, (t5 + t0)/2., t4 -{.0, -.01, .0}}],
   SurfaceColor[RGBColor[1, 1, 1]],
   Polygon[{(t5 + t0 + {.0, .0, -.05})/2,
            (t6 + t0 + {.0, .0, -.05})/2., t0}],       
   Polygon[{t0, (t5 + t0 + {.0, .0, -.05})/2., 
                      t4 - {.0, -.01, .0}}],
   Polygon[{t4 - {.01, .0, .0}, (t6 + t0 + {.0, .0, -.05})/2.,t0}]};
p1lu = t6; p2lu = (t6 + t0)/2.; p3lu = (t0 + t6 + t0 + t5)/4.;
p4lu = t4; p1ru = t5; p2ru = (t5+t0)/2.;
p3ru = (t0 + t6 + t0 + t5)/4.; p4ru = t4;
p1ld = t6 - {.0, .0, .025}; p2ld = (t6 + t0 - {.0, .0,.025})/2.;
p3ld = (t0 + t6 + t0 + t5 - {.0, .0, .05})/4.; p4ld = t4;
p1rd = t5 - {.0, .0, .025}; p2rd = (t5 + t0 - {.0, .0, .025})/2.;
p3rd = (t0 + t6 + t0 + t5 - {.0, .0, .05})/4.; p4rd = t4;

Bird Base

BirdBaseStages = {}; 
Do[
lu = Polygon[{p1lu, p2lu, p3lu, p4lu}];
ru = Polygon[{p1ru, p2ru, p3ru, p4ru}];
ld = Polygon[{p1ld, p2ld, p3ld, p4ld}];
rd = Polygon[{p1rd, p2rd, p3rd, p4rd}];
LU = basicBird[lu, N[-i]];
RU = basicBird[ru, N[i]];
LD = basicBird[ld, N[i]];
RD = basicBird[rd, N[-i]];
BirdBaseStages = Append[BirdBaseStages,
        Graphics3D[Join[{EdgeForm[{RGBColor[.1, .0, .9],
        Thickness[.005]}]}, LU, RU, LD, RD, c],
        Boxed -> False,      
        PlotRange -> All, ViewPoint -> {.0, -1., 1.}]],
          {i, .01, Pi-.01, Pi/8 - .01}];

Map[Show, BirdBaseStages];

The essential points for building the beam of the bird.

(* searching points for beam*)
ugol = N[(Pi/24 -.002) 24];
LU = basicBird[lu, N[-ugol]];
RU = basicBird[ru, N[ugol]];
LD = basicBird[ld, N[ugol]];
RD = basicBird[rd, N[-ugol]];
RU = basicBird[ru, N[ugol]];
M = First[RU];
l = Line[{First[M][[3]], First[M][[1]]}];
m4 = First[Last[c]][[3]];
m3 = First[First[RU]][[1]];
m2 = First[First[RU]][[3]];
m1 = m2 + .18 (m3 - m2);
m0 = First[Last[RU]][[3]];
Pol = {Polygon[{m4, m0, m3, m1, m2}]};
fig1 = Join[{EdgeForm[{RGBColor[.1, .0, .9],
             Thickness[.005]}]}, LU, RU, LD, RD, c];

(*Finding the unmoved part of figurine*)
c6 = LU[[1]][[1]][[1]];
c5 = LU[[3]][[1]][[3]];
c0 = First[Last[c]][[3]];
c2d = LD[[1]][[1]][[3]];
c2 = LU[[3]][[1]][[2]];
cu = LU[[2]][[1]][[3]];
cd = LD[[2]][[1]][[3]];
fig2 = {EdgeForm[{RGBColor[.1, .0, .9], 
        Thickness[.005]}],
        SurfaceColor[RGBColor[1, 1, 1]], 
        Polygon[{c6, c2, c0}],  
        SurfaceColor[RGBColor[1, 1, 1]], 
        Polygon[{c6, c2d, c0}]};
NS = Join[{EdgeForm[{RGBColor[.1, .0, .9],
        Thickness[.005]}]}, LD, fig2, LU];
cur = RU[[2]][[1]][[3]];
cdr = RD[[2]][[1]][[3]];

Pseudoreverse Fold for opening the surfaces

ReverseStages = {};
Do[boo = Chop[reverseFoldAuxOne[m0, m1, m2, m3, m4, N[fee],
              False]];
   t = boo[[2,1,3]];
   t1 = reflection3[t, Polygon[{m0, m2, m3}]];
   joo = Join[NS, {Polygon[{cur, t1, m3}],
                Polygon[{cdr, t, m3}],
                RGBColor[.2, .0, .8], 
                Thickness[.005],
                Line[{t1, (c6 + cu)/2 + {.0,.0,10^-3}}],
                Line[{t, (c6 + cu)/2 - {.0, .0, .1}}]},
                boo, Map[reflection3[#,
                Polygon[{m0, m2, m3}]]&, boo]];
   
   ReverseStages = Append[ReverseStages,
               Graphics3D[Prepend[joo, EdgeForm[
                          RGBColor[.1, .0, .9]]],
                          Boxed->False,         
                          PlotRange -> All,
                          ViewPoint->{1,0,1}]],
         {fee, .001, Pi/2 - .001, Pi/12 - .01}];

Map[Show, ReverseStages];