pub fn arc_from_three_points(
start: (f64, f64),
mid: (f64, f64),
end: (f64, f64),
weight: f64,
) -> RoiExpand description
Build a Roi::Arc from three points on the arc plus a radial weight (the
band thickness), the faithful port of silx
ArcROI._createGeometryFromControlPoints (items/_arc_roi.py:622-664) — the
geometry behind silx’s default ThreePointMode sub-mode. start and end
are the arc endpoints; mid is a point the arc passes through between them
(the curvature control). weight is the full radial thickness, so
inner_radius = radius − weight/2 (clamped ≥ 0) and outer_radius = radius + weight/2.
Branches mirror silx exactly:
start ≈ end(silxnumpy.allclose) → a closed circle throughstart/mid(silx_ArcGeometry.createCircle): center at thestart–midmidpoint, swept the full2πfromstart’s angle.start,mid,endcollinear (|cross| < 1e-5) → silx builds a center-less “rect” intermediate, which siplot’sRoi::Arc(always centered) cannot represent; this falls back to a degenerate zero-radius arc at thestart–endmidpoint. The transient rect editing shape is not modeled (deviation noted on the roadmap row).- otherwise → the circumscribed circle through the three points
(
circle_through, silx_circleEquation) with the sweep direction disambiguated from the mid angle (silx:652-660).