PolygonIndicatorHeuristics
AUTO-GENERATED FILE – DO NOT EDIT MANUALLY
Polygon Indicator Heuristics Extracted from CollisionMapper for deterministic unit testing of indicator generation logic.
Source File: addons/grid_building/placement/manager/components/polygon_indicator_heuristics.gd
Extends: RefCounted
Public Methods
is_hollow
Flags: static
Detects if a set of tile offsets forms a hollow (concave/void) pattern based on bounding box density. Returns true if (bbox_area > offsets.size() * density_factor)
should_expand_trapezoid
Flags: static
Returns true if trapezoid expansion (3/5/5 offsets) should be applied. Requirements:
- Polygon is convex
- Not hollow
- Current offsets size <= max_original
- Exactly two Y rows present containing -1 and 0 with (0,0) present (pre‑expansion base)
generate_trapezoid_offsets
Flags: static
Generates canonical 13-tile trapezoid offsets (rows y=-1,0,1 => 3/5/5 pattern).
polygon_tile_overlap_area
Flags: static
Computes precise overlap area between polygon world points and a tile rect (duplicate of S-H clip used for deterministic tests).
prune_concave_fringe
Flags: static
Prunes fringe offsets for concave polygons by removing tiles whose overlap area is below min_area_ratio * tile_area. Returns a new array (may be original if no pruning beneficial).
Private Methods
_inside
Flags: static, private
_intersect
Flags: static, private