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.
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.[br] Use: TileSet.TILE_SHAPE_SQUARE, TileSet.TILE_SHAPE_ISOMETRIC, TileSet.TILE_SHAPE_HALF_OFFSET_SQUARE [br] Do NOT use: integers (0, 1, 2) or strings ("square", "isometric", etc.)
Source: addons/grid_placement/utils/placement_geometry_math.gd
Syntax
class PlacementGeometryMathMembers
| Name | Kind | Summary |
|---|---|---|
polygon_intersection_area | Method | |
intersection | Property | |
area | Property | |
poly_area | Property | |
j | Property | |
get_tile_polygon | Method | |
half_w | Property | |
half_h | Property | |
intersection_area_with_tile | Method | |
tile_poly | Property | |
area | Property | |
does_polygon_overlap_tile | Method | |
area | Property | |
does_shape_overlap_tile_optimized | Method | |
tile_rect_shape | Property | |
tile_transform | Property | |
native_result | Property | |
shape_polygon | Property | |
shape_polygon | Property | |
does_polygon_overlap_tile_optimized | Method | |
bounds | Property | |
rect_shape | Property | |
rect_transform | Property | |
p1 | Property | |
p2 | Property | |
diff | Property | |
get_polygon_bounds | Method | |
min_pos | Property | |
max_pos | Property | |
convert_shape_to_polygon | Method | |
polygon | Property | |
rect_shape | Property | |
size | Property | |
circle_shape | Property | |
radius | Property | |
segments | Property | |
angle | Property | |
point | Property | |
capsule_shape | Property | |
radius | Property | |
height | Property | |
segments | Property | |
half_height | Property | |
top_center_y | Property | |
bottom_center_y | Property | |
angle | Property | |
point | Property | |
angle | Property | |
point | Property | |
convex_shape | Property | |
rect | Property | |
intersection_polygon_area | Method | |
area | Property | |
n | Property | |
j | Property | |
is_exact_polygon_match | Method | |
exact_polygon_area | Method | |
isometric_floating_point_fallback | Method | |
close | Property | |
square_bounding_box_fallback | Method | |
min_tile | Property | |
max_tile | Property | |
tile_rect | Property | |
min_poly | Property | |
max_poly | Property | |
poly_rect | Property | |
intersection_rect | Property | |
intersection_area | Property | |
overlap_x | Property | |
overlap_y | Property |
Source
addons/grid_placement/utils/placement_geometry_math.gd
Plugin docs root:gdscript/plugins/grid_placement_dev/docs