heal

photonforge.heal(operand, feature_size)

Heal a set of polygons by removing small features.

Healing uses an opening and closing sequence of morphological operations to eliminate small features from the polygon set.

Parameters:
Returns:

Resulting polygons.

Return type:

list[Polygon]

Note

The implementation is equivalent to:

eroded = offset(operand, -feature_size / 2)
dilated = offset(eroded, feature_size)
result = offset(dilated, -feature_size / 2)

which performs an opening operation followed by a closing when feature_size is positive, or the reverses when it is negative.