//cylinder through a single film // See // C. Raufaste and S. Cox (2013) // Deformation of a free interface pierced by a tilted cylinder: variation of the contact angle, // Coll. Surf. A // http://dx.doi.org/10.1016/j.colsurfa.2012.12.030 // //tilt film instead of cylinder //remove films on cylinder //change contact angle // // Copyright Simon Cox // October 2012 PARAMETER top_height = 0.8 PARAMETER bot_height = -3 PARAMETER rad = 0.1 PARAMETER xc = 5 PARAMETER yc = 5 PARAMETER zc = 0 //start at 0 PARAMETER dz = 0 PARAMETER dth = 3 //degrees PARAMETER tens = 1/cos(45*pi/180) //set tension to choose contact angle constraint 1 convex /* tube wall */ formula: x^2+y^2 = rad^2 constraint 2 convex /* tube wall pulling down */ formula: x^2+y^2 = rad^2 energy: e1: -(z*y/rad) e2: (z*x/rad) e3: 0 constraint 3 formula: z=zc constraint 4 formula: z=zc*x/xc constraint 5 global nonnegative /* tube wall */ formula: x^2+y^2 - rad^2 constraint 6 formula: z=-zc quantity contactlinelength info_only method edge_scalar_integral scalar_integrand: 1 vertices 1 -rad -rad bot_height fixed constraint 1 2 rad -rad bot_height fixed constraint 1 3 rad rad bot_height fixed constraint 1 4 -rad rad bot_height fixed constraint 1 11 -rad -rad 0 constraint 1 12 rad -rad 0 constraint 1 13 rad rad 0 constraint 1 14 -rad rad 0 constraint 1 21 -rad -rad top_height fixed constraint 1 22 rad -rad top_height fixed constraint 1 23 rad rad top_height fixed constraint 1 24 -rad rad top_height fixed constraint 1 31 -xc -yc -zc fixed constraint 6 32 xc -yc zc fixed constraint 3 33 xc yc zc fixed constraint 3 34 -xc yc -zc fixed constraint 6 edges 1 1 2 fixed constraint 1 2 2 3 fixed constraint 1 3 3 4 fixed constraint 1 4 4 1 fixed constraint 1 5 1 11 constraint 1 no_refine 6 2 12 constraint 1 no_refine 7 3 13 constraint 1 no_refine 8 4 14 constraint 1 no_refine 11 11 12 contactlinelength constraint 2 12 12 13 contactlinelength constraint 2 13 13 14 contactlinelength constraint 2 14 14 11 contactlinelength constraint 2 15 11 21 constraint 1 no_refine 16 12 22 constraint 1 no_refine 17 13 23 constraint 1 no_refine 18 14 24 constraint 1 no_refine 21 21 22 fixed constraint 1 22 22 23 fixed constraint 1 23 23 24 fixed constraint 1 24 24 21 fixed constraint 1 31 31 32 fixed constraint 4 32 32 33 fixed constraint 3 33 33 34 fixed constraint 4 34 34 31 fixed constraint 6 35 31 11 36 32 12 37 33 13 38 34 14 faces 5 31 36 -11 -35 tension tens 6 32 37 -12 -36 tension tens 7 33 38 -13 -37 tension tens 8 34 35 -14 -38 tension tens read crit_lent := 0.0005; max_lent := 1; min_area := 0.000012; itnum := 0; slope := 0; cangle := acos(1/tens)*180/pi; pscolorflag ON; full_bounding_box ON; show_trans "15lezzz"; exec sprintf" show\_trans \"%fC\"",atan2(zc,xc)*180/pi; short := // do a few iterations and delete small triangles etc { U; { V; u; g 20; w min_area; t crit_lent; refine edges where (length > max_lent and not no_refine);} 10; U; }; tip := { //tilt the film itnum += 1; dz := tan((slope+dth)*pi/180)-tan(slope*pi/180); zc += dz*xc; slope := atan2(zc,xc)*180/pi; exec sprintf" show\_trans \"%fC\"",dth; quiet on; short 10; quiet off; }; start := { g 3; quiet on; { r; short; } 2; max_lent /= 6; {refine edges ee where avg(ee.vertices,sqrt(x*x+y*y)) < 5*rad and not no_refine; } 2; refine edges where contactlinelength; short 2; quiet off; slope := atan2(zc,xc)*180/pi; }; //use start, then tip if the angle should increase //e.g. start; tip 10;