Boundaries can be found from the mesh using the function 'findBoundaries'. It has the following syntax

boundaries = findBoundaries(mesh, querystring, optional arguments);

The return value is a vector. The vector holds the indices of boundaries (a triangle segment).

circle = findBoundaries(mesh, 'direction', [line_startx line_starty line_startz], [line_endx line_endy line_endz])

Now circle contains the the indices of the triangles of a circular region in the boundary. The circle is defined by a cylinder that intersects the boundary. The cylinder is defined by a line given as parameter.

A detailed documentation of the optional arguments and the query strings are given below.

Query string Description Arguments Argument description Row length
'direction' Finds elements that are contained in a region defined by a cross sectional shape and a line that intesects it in the middle. The line starts from origin and goes to waypoint. origin Origin point of the line 3
waypoint Direction vector of the line 3
radius Width of the line segment 1
shape: circle (default), box, arbitrary Cross-sectional shape of the region  
points (optional) If an arbitrary shape is defined, this specifies its coordinates  
'halfspace Returns the elements within a halfspace spanned by a location vector and a plane normal location Location of the center of the plane (point that the plane intersects) 3
normal Normal of the plane. Elements in the direction of normal will be selected. 3
'inverse Inverses the selection selection Array that contains the indices of the boundary that is selected number of elements in the selection
'location Finds a boundary nearest to a user specified location location The location number of points specified
'sphericalregion' Finds a boundary that is contained within a subspace defined by a segment of the unit sphere starttheta Starting polar angle 1
startphi Starting azimuthal angle 1
endtheta Ending polar angle 1
endphi Ending azimuthal angle 1