跳转到主要内容

raygeo.ops.part.crescent

Functions

cut_area()

cut_area(
c1: tuple[float, float],
c2: tuple[float, float],
radius: float,
fragments: Sequence[Sequence[tuple[float, float]]],
valid_area: Sequence[Sequence[tuple[float, float]]],
) -> tuple[float, float]

Area of disk(c2) − disk(c1) − fragments, intersected with valid_area.

Returns (total, left) where left is the portion on the left side of the step vector c1 → c2.

ParameterTypeDescription
c1tuple[float, float]Previous centre (x, y).
c2tuple[float, float]Next centre (x, y).
radiusfloatDisk radius (mm).
fragmentsSequence[Sequence[tuple[float, float]]]List of polygons (cleared fragments).
valid_areaSequence[Sequence[tuple[float, float]]]Valid region polygons (intersection).
Returnstuple[float, float](total_area, left_area) (mm²).

Disk increment (red): stepping C1 to C2; left full, right shows reduction with a cleared fragment

Disk increment (red): stepping C1 to C2; left full, right shows reduction with a cleared fragment

Crescent area vs step  compared to analytical formula; right shows left-side portion

Crescent area vs step d compared to analytical formula; right shows left-side portion

2D heatmap of  as c2 orbits c1; zero at coincidence, maximal at mid distances

2D heatmap of cut_area as c2 orbits c1; zero at coincidence, maximal at mid distances

Vertical-wall fragment sweeping crescent; left shows geometry, right plots area vs wall position

Vertical-wall fragment sweeping crescent; left shows geometry, right plots area vs wall position

Crescent clipped to : no clip, left-half window, tip window; faint gray = unclipped

Crescent clipped to valid_area: no clip, left-half window, tip window; faint gray = unclipped