Boundaries can be found from the mesh using the function 'findBoundaries'. It has the following syntax
boundary = findBoundaries(mesh, querystring, optional arguments);
The return value is a vector. The vector holds the indices of boundaries (a line segment). For example
boundary = findBoundaries(mesh, 'direction', [x1 y1], [x2 y2], width)
returns the boundary elements that are within a distance of width/2 from a line going from [x1 y1] to [x2 y2]
A detailed documentation of the optional arguments and the query strings are given below.
| Query string | Description | Arguments | Argument description | Length | Illustration |
| 'arc' | Finds a boundary specified by an arc of the unit circle. | origin | Origin point of the arc | 2 |
|
| startangle | Starting angle | 1 | |||
| endangle | Ending angle | 1 | |||
| 'direction' | Finds boundaries that fall within a rectangle. The rectangle is defined by a line that starts from origin and goes to waypoint. The line intersects the rectangle in the middle. | origin | Origin point of the rectangle | 2 | |
| waypoint | Direction vector of the rectangle | 2 | |||
| width | Width of the rectangle | 1 | |||
| 'inverse' | Inverses the selection | elements | 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 |