Take into account that $layerm->perimeters also contains ExtrusionPath objects. #1991