Chris' Tutorials
Docs/Grid Placement

Class

PolygonTileMapper

Generated GDScript class reference for GridPlacement.PolygonTileMapper.

StatusDraft
Versionv6.0
UpdatedDevelopment docs generated from GDScript source

This is unreleased documentation in active development. APIs, class names, and behavior may change before the final release.

Draft — Unreleased:This page is in active development. APIs, class names, and behavior may change before the release is finalized. Use it as a preview of what's coming — not as a stable integration target.

Handles polygon-to-tile-offset conversion with testable, separated concerns. This class extracts the complex polygon processing logic from CollisionMapper2D to enable better testing and separation of responsibilities. Coordinate semantics

  • Tile addressing is center-based. For 16×16 tiles, the center is at +8,+8 from the tile origin.
  • Tests and runtime share "bottom-inclusive, top-exclusive" behavior on axis-aligned boundaries to avoid fencepost rows when a polygon edge lies exactly on a tile boundary. Pipeline stages: 1. Transform polygon to world space and compute initial tile coverage 2. Apply trapezoid expansion heuristics for convex polygons when beneficial 3. Prune concave polygon fringes to remove unwanted overhangs 4. Filter tiles by minimum area overlap to remove slivers (with concave center-point check)

Source: addons/grid_placement/placement/manager/components/mapper/polygon_tile_mapper.gd

Syntax

class PolygonTileMapper

Members

NameKindSummary
MIN_POLY_TILE_OVERLAP_RATIOField
default_ratioPropertyConfiguration for area-based filtering thresholds
convex_ratioProperty
expanded_trapezoid_ratioProperty
expansion_candidate_ratioProperty
offsetsPropertyResult of polygon processing with diagnostic information
did_expand_trapezoidProperty
was_convexProperty
initial_offset_countProperty
final_offset_countProperty
print_diagnosticsMethod
compute_tile_offsetsMethod
center_tileProperty
compute_tile_offsets_with_positionerMethod
center_tileProperty
world_pointsProperty
tile_sizeProperty
has_tile_shapeProperty
tile_shape_valProperty
offsetsProperty
tile_shape_valProperty
offsetsProperty
is_convexProperty
did_expand_trapezoidProperty
expansion_resultProperty
thresholdsProperty
min_areaProperty
filteredProperty
abs_tileProperty
tile_rectProperty
areaProperty
process_polygon_with_diagnosticsMethod
resultProperty
center_tileProperty
world_pointsProperty
tile_sizeProperty
has_tile_shapeProperty
tile_shape_valProperty
offsetsProperty
expansion_resultProperty
thresholdsProperty
resultProperty
analysisProperty
hollow_shapeProperty
expandedProperty
validatedProperty
min_ratioProperty
min_areaProperty
filteredProperty
abs_tileProperty
tile_rectProperty
areaProperty
should_includeProperty
tile_center_worldProperty
epsProperty
xsProperty
ysProperty
found_xProperty
found_yProperty
boundsProperty
height_tilesProperty
max_yProperty
adjustedProperty
ysProperty
xs_by_yProperty
validatedProperty
tile_areaProperty
min_expansion_areaProperty
abs_tileProperty
tile_center_localProperty
tile_rectProperty
areaProperty
original_setProperty
tile_center_localProperty
tile_center_worldProperty
get_polygon_tile_overlap_areaMethod
poly_boundsProperty
is_rectProperty
cornersProperty
foundProperty

Source

addons/grid_placement/placement/manager/components/mapper/polygon_tile_mapper.gd

Plugin docs root:gdscript/plugins/grid_placement_dev/docs