ishole

Tells which boundaries of a polyshape are holes.

Category: Mathematics > Computational Geometry

Syntax

TF = ishole(pshape)

One logical value per boundary.

TF = ishole(pshape, I)

Only for the boundaries selected by I.

Description

A polyshape stores outer boundaries and hole boundaries in one list. ishole classifies each entry, which is useful together with rmboundary or sortboundaries to select what to remove or reorder. The number of true values equals the NumHoles property.

Input arguments

pshape
A polyshape object.

Output arguments

TF
Logical column vector: true for a hole boundary, false for an outer boundary.

Example

Outer boundary and hole

P = polyshape([0 4 4 0], [0 0 3 3]);
H = polyshape([1 2 2 1], [1 1 2 2]);
D = subtract(P, H);
TF = ishole(D)
Output
TF = 2×1 logical array

   0
   1

See also

holes rmholes numboundaries sortboundaries