Skip to content

Class

PlacementGeometryMath

Generated GDScript class reference for GridPlacement.PlacementGeometryMath.

Status
Current
Version
v6.3.0
Source updated
2026-10-29
Generated on
2026-10-29

6.3. These pages document the 6.3 release, where placeable is now entry (what changed) and PlacementOwner is deprecated (migration). Still on 6.2? Your version's guides ship inside the plugin itself, under addons/grid_placement/guides/; the 6.2 URLs on this site now redirect to this series.

Geometry & collision math utilities for the grid building addon. Provides compact, well-documented helper functions used across the addon for tile/polygon overlap and collision tasks. Main responsibilities include:

  • Computing polygon vs polygon intersection areas (uses Godot Geometry2D).
  • Producing tile polygons for square and isometric tiles and testing polygon overlaps against tiles (area-based and optimized native collision checks).
  • Converting various Shape2D types to polygon approximations for geometry processing (Rectangle, Circle, Capsule, ConvexPolygon, fallback to rect).
  • Utility helpers: axis-aligned rectangle detection and polygon bounding rect. Note: Tile shape enforcement: All functions use TileSet.TileShape enum values.
    Use: TileSet.TILE_SHAPE_SQUARE, TileSet.TILE_SHAPE_ISOMETRIC, TileSet.TILE_SHAPE_HALF_OFFSET_SQUARE
    Avoid using raw integers (0, 1, 2) or strings ("square", "isometric", etc.)

Source: addons/grid_placement/utils/placement_geometry_math.gd

Syntax

class PlacementGeometryMath

Members

NameKindSummary
CIRCLE_APPROX_SEGMENTSField
CAPSULE_APPROX_SEGMENTSField
polygon_intersection_areaMethod
get_tile_polygonMethod
intersection_area_with_tileMethod
does_polygon_overlap_tileMethod
does_shape_overlap_tile_optimizedMethod
get_polygon_boundsMethod
convert_shape_to_polygonMethod
intersection_polygon_areaMethod