Skip to main content

raygeo.geo.algo.engagement

Engagement angle, area, and chord depth as a function of signed distance from the cleared boundary.

Engagement angle, area, and chord depth as a function of signed distance from the cleared boundary. Circle-boundary overlap (engagement) metrics.

Functions

angular_engagement()

angular_engagement(
center: tuple[float, float],
radius: float,
fragments: list[list[tuple[float, float]]],
) -> float

Angular engagement (exact circle–polygon intersection).

Returns uncleared angular extent in [0, 2π].

ParameterTypeDescription
centertuple[float, float]Disk centre (x, y).
radiusfloatDisk radius (mm).
fragmentslist[list[tuple[float, float]]]List of polygons (cleared fragments).
ReturnsfloatAngular engagement in radians.

Comparison of exact polygon-intersection angular engagement with the analytical signed-distance estimate along a scan line crossing the boundary.

Comparison of exact polygon-intersection angular engagement with the analytical signed-distance estimate along a scan line crossing the boundary.

compute_engagement()

compute_engagement(
d_to_boundary: float,
radius: float,
) -> tuple[float, float, float]

Compute engagement angle, area, and chord depth.

ParameterTypeDescription
d_to_boundaryfloatSigned distance from the point to the nearest boundary (mm). Positive = outside the boundary.
radiusfloatDisk radius (mm).
Returnstuple[float, float, float](angle_rad, area, chord_depth).

Circle at three signed distances from the boundary. Shaded red arc is the contact arc (engagement).

Circle at three signed distances from the boundary. Shaded red arc is the contact arc (engagement).

Engagement heatmap around a circular cleared area. Green = low, red = high engagement.

Engagement heatmap around a circular cleared area. Green = low, red = high engagement.

disk_segment_area()

disk_segment_area(x: float, r: float) -> float

Area under 2*sqrt(r²-x²) from x to r.

Equivalent to the area of the circular segment to the right of the vertical line at x for a disk of radius r centred at the origin.

ParameterTypeDescription
xfloatLeft boundary of the segment.
rfloatDisk radius.
ReturnsfloatArea of the circular segment.

Left: a disk of radius 5 mm with the circular segment to the right of the vertical line  shaded. Right: the segment area as a function of , from  to .

Left: a disk of radius 5 mm with the circular segment to the right of the vertical line x = 1.5 shaded. Right: the segment area as a function of x, from -r to +r.

point_engagement()

point_engagement(
center: tuple[float, float],
radius: float,
fragments: list[list[tuple[float, float]]],
) -> tuple[float, float, float]

Engagement angle, area, and chord depth at a disk centre.

ParameterTypeDescription
centertuple[float, float]Disk centre (x, y).
radiusfloatDisk radius (mm).
fragmentslist[list[tuple[float, float]]]List of polygons (cleared fragments).
Returnstuple[float, float, float](angle_rad, area, chord_depth).

Engagement angle field around a square cleared area for a disk of radius 3 mm.

Engagement angle field around a square cleared area for a disk of radius 3 mm.