Skip to content

pygeo.is_on_polygon_boundary

Daniel Flassig edited this page Jul 25, 2026 · 2 revisions

Tests whether a 2D point lies on the boundary of a polygon loop within a given tolerance.

This function is located in the pygeo module.

The point is tested against the polygon points and edges. If its distance to a polygon point or edge is within the tolerance, the point is reported as on the boundary, together with the kind of contact. For an exact inside/outside decision use pygeo.is_in_polygon.

pygeo.is_on_polygon_boundary(point, polygon, tolerance)
Parameter Type Description
point {u,v} The test point in 2D.
polygon {{u,v}, ...} Coordinates of the polygon loop points in 2D. The loop is treated as closed.
tolerance number Maximum spatial distance to the boundary.

Return value

Type Description
on_boundary boolean
boundary_type integer

Notes:

  • The input is a single loop only.
  • The loop orientation does not affect the result.
  • This function does not create any PYTHA geometry.

Example:

local on_boundary, boundary_type = pygeo.is_on_polygon_boundary(
    {10, 5},
    {{0, 0}, {10, 0}, {10, 10}, {0, 10}},
    0.001
)
-- on_boundary -> true, boundary_type -> 2 (on an edge)

Version Support:

Minimum PYTHA Version: V26

See also:

pygeo, pygeo.is_in_polygon

Clone this wiki locally