PolygonTileOverlap
AUTO-GENERATED FILE – DO NOT EDIT MANUALLY
Utility functions for polygon-tile overlap calculations.
Provides static methods for geometric calculations used by both CollisionMapper and PolygonTileMapper to avoid code duplication.
Source File: /addons/grid_building/placement/manager/components/mapper/polygon_tile_overlap.gd
Public Methods
compute_overlap_area
| |
Flags: static
Compute precise overlap area (world units^2) between a polygon and a rectangular tile using
Sutherland–Hodgman clipping followed by the shoelace formula.
Parameters:
• polygon: PackedVector2Array – world points.
• rect: Rect2 – tile rect in world.
Returns: float – overlap area (>= 0).
Private Methods
_compute_polygon_bounds
| |
Flags: static, private
Helper: Compute polygon bounding rectangle
_clip_polygon_to_rect
| |
Flags: static, private
Helper: Clip polygon against rectangle using Sutherland-Hodgman algorithm
_point_inside_boundary
| |
Flags: static, private
Helper: Test if point is inside clipping boundary
_compute_intersection
| |
Flags: static, private
Helper: Compute line-boundary intersection
_compute_polygon_area
| |
Flags: static, private
Helper: Compute polygon area using shoelace formula
Grid Building v5.0.8 | Generated 24/05/2026