]> Creatis software - CreaPhase.git/blob - octave_packages/geometry-1.5.0/io/private/planeSurfGeo.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / geometry-1.5.0 / io / private / planeSurfGeo.m
1 %% Copyright (c) 2010 Juan Pablo Carbajal <carbajal@ifi.uzh.ch>
2 %% 
3 %%    This program is free software: you can redistribute it and/or modify
4 %%    it under the terms of the GNU General Public License as published by
5 %%    the Free Software Foundation, either version 3 of the License, or
6 %%    any later version.
7 %%
8 %%    This program is distributed in the hope that it will be useful,
9 %%    but WITHOUT ANY WARRANTY; without even the implied warranty of
10 %%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 %%    GNU General Public License for more details.
12 %%
13 %%    You should have received a copy of the GNU General Public License
14 %%    along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16 %% -*- texinfo -*-
17 %% @deftypefn {Function File} @var{str} =  planeSurfGeo (@var{id}, @var{nloop},@var{loops})
18 %% Generates a string for Gmsh Plane Surface format.
19 %%
20 %% @var{id} is the plane surface's identification number.
21 %% @var{nloop} is the number of loops defining the surface.
22 %% @var{loops} contain the identification numbers of all the line loops defining 
23 %% the surface. The first line loop defines the exterior boundary of the surface;
24 %% all other line loops define holes in the surface. A line loop defining a hole
25 %% should not have any lines in common with the exterior line loop (in which case
26 %% it is not a hole, and the two surfaces should be defined separately). 
27 %% Likewise, a line loop defining a hole should not have any lines in common with 
28 %% another line loop defining a hole in the same surface (in which case the two 
29 %% line loops should be combined).
30 %%
31 %% @end deftypefn
32
33 function str = planeSurfGeo(id,nloop,loops)
34     substr = repmat(',%d',1,nloop-1);
35     str = sprintf(['Plane Surface(%d) = {%d' substr '};\n'],id,loops);
36 end