Input Shape Autoindexing
Since physical edge indexing is being abandoned, we introduce logical edges – groupings of the input region edges into geometrically (or otherwise) meaningful sets. Selection indexes shall correspond to that of these sets. Applied rules should preserve/propagate these edge sets.
Following shape classes could result in the following actions:
- Rectangular quad – trivial case.
- Quad, not axis-aligned, we can try:
- simple: determine index for the first edge, increment successive edges
- harder: compute Oriented Bounding Box; translate longest edge of that to x-axis; edge to the left (W-edge) has index 0.
- |e| > 4, but roughly looks like a quad:
- Cardinal Directions selection will create 4 groups of edges
- |e| > 4, looks like a multi-polygon
- length/angle threshold.
Grid rule requires for input region to be a quad and ideally rectangular or close to rectangular or it will look strange. In other words we need to provide the following guarantee to Grid rule:
- |Vi| == 4, Vi are vertices of the input region – a quad
- All angles >= threshold1 (e.g. 70 degrees) – close to rectangular
- Min Area >= threshold2 – minimum area required to build a park, otherwise fail (no derivation or a alternative rule)
- Input region convex – otherwise results make no sense.
The following fixes apply to the appropriate points
- Oriented Rectangle (Box): 1, 2, 4
- Bounding Box
- Inscribed Box
- Linear Combination
- Optimised Box that occupies area sufficient for a park (harder problem)
- Axis-aligned box: certain design constraints
- Autoindexing: 1
- Cardinal directions when looks like a quad; Grid still requires a ‘corner shape’ which can be a quad with vertices corresponding to the meething points
- Autoindexing + Oriented Box,
- which vertices are at proximity (using a certain function) to the meeting points