Main Content

removeHoles

Remove holes from shape

Since R2020b

Description

s = removeHoles(shapeobject,holetol) removes holes with area less than the provided tolerance from the shape and returns a polygon object.

example

Examples

collapse all

Create two rectangular shapes with different dimensions.

rect1 = antenna.Rectangle;
rect2 = antenna.Rectangle(Length=1e-7, Width=0.5);

Carve out rectangle2 from rectangle1 and view the resultant shape.

rect3 = rect1 - rect2;
show(rect3)

Figure contains an axes object. The axes object with xlabel x (m), ylabel y (m) contains 2 objects of type patch. These objects represent PEC, mypolygon.

Remove holes from the resultant rectangle.

rect4 = removeHoles(rect3,1e-6);
show(rect4)

Figure contains an axes object. The axes object with xlabel x (m), ylabel y (m) contains 2 objects of type patch. These objects represent PEC, mypolygon.

Input Arguments

collapse all

2-D shape with sliver outlier, specified as either:

Data Types: function

Hole tolerance, specified as a nonnegative scalar.

Data Types: double

Version History

Introduced in R2020b