Function File: fileStr = data2geo (data, lc)
Function File: fileStr = data2geo (…, param, value)

Uses data to build a file compatible with Gmsh.

data is assumed to describe a polygon in polygon2d format. The argument lc specifies the edge size.

The optional parameters can be ’output’ followed with a string specifying a file to write, and ’spherical’ followed by a real number r indicating that the polygon describes a spherical surface of radious r.

See also: polygon2d.

Demonstration 1

The following code

 points  = [0 0 0; 0.1 0 0; 0.1 .3 0; 0 0.3 0];
 strFile = data2geo(points,0.009);
 disp(strFile)

Produces the following output

// File created with Octave
// Points
Point(1) = {0,0,0,0.008999999999999999};
Point(2) = {0.1,0,0,0.008999999999999999};
Point(3) = {0.1,0.3,0,0.008999999999999999};
Point(4) = {0,0.3,0,0.008999999999999999};
// Lines
Line(1) = {1,2};
Line(2) = {2,3};
Line(3) = {3,4};
Line(4) = {4,1};
Line Loop(5) = {1,2,3,4};
Plane Surface(6) = {5};

Package: geometry