/usr/share/doc/gmsh/demos/splines.geo is in gmsh 2.5.1~beta2~svn10284~dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | lc = 1e-1 ;
xx = 0;
// Lines
p = newp;
Point(p) = {xx, 0, 0, 0.3*lc} ;
Point(p+1) = {xx+.5, 0, 0, lc} ;
Point(p+2) = {xx+.5, 1, 0, 0.1*lc} ;
Point(p+3) = {xx, 1, 0, lc} ;
l = newreg;
Line(l) = {p+3,p+2};
Line(l+1) = {p+2,p+1};
Line(l+2) = {p+1,p};
Line(l+3) = {p,p+3};
s = newreg;
Line Loop(s) = {-l,-(l+1),-(l+2),-(l+3)};
Plane Surface(s+1) = {s};
xx += 1;
// B-Splines
p = newp;
Point(p) = {xx, 0, 0, 0.3*lc} ;
Point(p+1) = {xx+.5, 0, 0, lc} ;
Point(p+2) = {xx+.5, 1, 0, 0.1*lc} ;
Point(p+3) = {xx, 1, 0, lc} ;
l = newreg;
BSpline(l) = {p+3,p+2,p+1,p+1,p};
Line(l+1) = {p,p+3};
s = newreg;
Line Loop(s) = {-l,-(l+1)};
Plane Surface(s+1) = s;
xx += 1;
// Splines (CatmullRom)
p = newp;
Point(p) = {xx, 0, 0, 0.3*lc} ;
Point(p+1) = {xx+.5, 0, 0, lc} ;
Point(p+2) = {xx+.5, 1, 0, 0.1*lc} ;
Point(p+3) = {xx, 1, 0, lc} ;
l = newreg;
Spline(l) = {p+3,p+2,p+1,p};
Line(l+1) = {p,p+3};
s = newreg;
Line Loop(s) = {-l,-(l+1)};
Plane Surface(s+1) = s;
xx += 1;
// Bezier
p = newp;
Point(p) = {xx, 0, 0, 0.3*lc} ;
Point(p+1) = {xx+.5, 0, 0, lc} ;
Point(p+2) = {xx+.5, 1, 0, 0.1*lc} ;
Point(p+3) = {xx, 1, 0, lc} ;
l = newreg;
//Bezier(l) = {p+3,p+2,p+1,p}; // Bezier curves are broken
BSpline(l) = {p+3,p+2,p+1,p};
Line(l+1) = {p,p+3};
s = newreg;
Line Loop(s) = {-l,-(l+1)};
Plane Surface(s+1) = s;
// Duplicate the surfaces, and use uniform mesh
p1 = newp;
Translate {0,-1.5,0} {
Duplicata { Surface{6:18:4}; }
}
p2 = newp;
Printf("p1 p2 = %g %g", p1, p2);
Characteristic Length {p1:p2-1} = lc/5 ;
|