PolygonTileMapper
AUTO-GENERATED FILE – DO NOT EDIT MANUALLY
Handles polygon-to-tile-offset conversion with testable, separated concerns.
Source File: /addons/grid_building/placement/manager/components/mapper/polygon_tile_mapper.gd
Constants
- Constant:
MIN_POLY_TILE_OVERLAP_RATIO := 0.12
Public Methods
compute_tile_offsets
| |
Flags: static
Primary entry point for polygon-to-tile conversion (runtime optimized)
compute_tile_offsets_with_positioner
| |
Flags: static
Primary entry point with positioner reference for consistent positioning Uses positioner’s position as coordinate reference instead of polygon’s position
process_polygon_with_diagnostics
| |
Flags: static
Full processing with diagnostic information for testing and debugging
get_polygon_tile_overlap_area
| |
Flags: static
Polygon-tile overlap calculation using Sutherland-Hodgman clipping
Private Methods
_compute_tile_offsets_internal
| |
Flags: static, private
Internal implementation shared by both public methods
_analyze_offset_pattern
| |
Flags: static, private
Helper: Analyze offset pattern for trapezoid detection
_expansion_adds_new_tiles
| |
Flags: static, private
Helper: Check if expansion adds new tile coverage
_determine_area_threshold
| |
Flags: static, private
Helper: Determine area threshold based on polygon type and processing
_compute_tile_rect
| |
Flags: static, private
Helper: Compute tile rectangle in world space
_transform_polygon_world
| |
Flags: static, private
World polygon conversion - delegates to utility
_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