Peel rule is inner extrusion.
First parameter is a selection – a subset of the perimeter. Perimeter is meant a closed set of edge line segments of the input region. Selection can be in either of the following formats:
- non-overlapping intervals (RangeSelection) [a_i, b_i] where 0 <= a_i, b_i <= |E|, for example [0, 1][2,2.5] selects the first and the first half of the third edges.
- list of edge indexes (EdgeSelection)
- Keyword based selection.
- Operation affected selection. Implemented – extrusion base and extrusion frontier of the peel rule.
- Position-based selection. Yet to be implemented.
- Border edges and n-neighbours
- Border vertices and n-neighbours
Second parameter is the size we want to extrude or ‘peel’ by (of type Size1d_t) which accepts either absolute size or value in percent. The percent is relative to the average length of the edge.
In the next iteration it should be changed to the distance to the middle of the nearest edge.
Selection parameter of any type is converted into RangeSelection. Because we extrude separately for each edge, each range is split to integer (or edge) boundaries. For example [0.4, 2.9] is split into a list [0.4, 1.0][1.0,2.0][2.0, 2.9].
Each split segment is then extruded inwards, that is a new polygon constructed with the width given in the second parameter. New polygons are intersected with the input polygon to cut away the corners that may protrude outside of the region.
The set of newly created polygon are subtracted from the input polygon to create effect of the extrusion.