Skip to content

PolygonIndicatorHeuristics

Polygon Indicator Heuristics Extracted from CollisionMapper for deterministic unit testing of indicator generation logic.

static func is_hollow( offsets: Array[Vector2i], density_factor: float ) -> bool

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)

static func generate_trapezoid_offsets( ) -> Array[Vector2i]

Generates canonical 13-tile trapezoid offsets (rows y=-1,0,1 => 3/5/5 pattern).

static func polygon_tile_overlap_area( polygon: PackedVector2Array, rect: Rect2 ) -> float

Computes precise overlap area between polygon world points and a tile rect (duplicate of S-H clip used for deterministic tests).

addons/grid_building/placement/manager/components/polygon_indicator_heuristics.gd


This API reference is automatically generated from the plugin source code. For implementation examples and usage guides, see the guides section.