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

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.

get_angular_engagement()

get_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 engagement vs analytical signed-distance estimate

Comparison of exact polygon-intersection engagement vs analytical signed-distance estimate

get_disk_segment_area()

get_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: shaded disk segment right of an offset; right: segment area vs offset from  to

Left: shaded disk segment right of an offset; right: segment area vs offset from -r to +r

get_point_engagement()

get_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 given radius.

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