TarzanScan#
- class QPolargraph.patterns.TarzanScan.TarzanScan(*args, x0=0.0, **kwargs)[source]#
Bases:
QScanPatternGeometry-native scan pattern using alternating single-motor arcs.
Overrides
vertices()andtrajectory()to produce a sequence of circular arcs, each driven by a single motor. Scan data are collected on all four arc segments of every cycle.- Parameters:
x0 (float, optional) – Starting x-coordinate on the top edge of the scan area [m]. Default:
0.0. Adjust until the trajectory covers the scan area satisfactorily.
Notes
All parameters inherited from
QScanPattern(width,height,dx,dy,step) are also accepted.- property tarzan_B: float#
Key parameter of the Tarzan map [m²].
Defined as
B = 4h·x_right + y_top² − y_bottom²whereh = ell/2. The Tarzan mapT(x₀)has a closed form involving onlyBand its partnerE = −B + 8h·dx.When
B = 0the map is the identity and every orbit is period-1 regardless ofx0; adjustdyorheightuntilB ≠ 0.
- property is_degenerate: bool#
Truewhen the scan geometry produces a periodic Tarzan map.Degeneracy (
B ≈ 0) means every orbit is period-1: the scan repeats the same path on every cycle regardless ofx0. Increase or decreasedy(or changeheight) to break the degeneracy.
- property fixed_point: float | None#
Unique fixed point of the Tarzan map [m], or
None.Returns
x0* = h + dx − B / (4·dx)whenB ≠ 0anddx ≠ 0. Passingx0 = fixed_pointproduces a period-1 orbit (identical repeated scans); avoid it.Returns
Nonein two cases:dx = 0andB ≠ 0: no fixed points exist — anyx0yields an aperiodic scan.B = 0: allx0are fixed points (degenerate geometry).
- vertices()[source]#
Return arc-corner waypoints for all Tarzan scan cycles.
Iterates cycles starting from
(x0, y_top)until the next starting x-position leaves[x_left, x_right].- Return type:
- Returns:
numpy.ndarray –
(nvertices, 2)array of(x, y)waypoints [m].
Mathematical background#
A Tarzan scan cycle consists of four circular arcs, each driven by a single motor. Starting from a point \(p_0 = (x_0, y_\text{top})\) on the top edge, the cycle visits the right, bottom, left, and top edges in turn before returning to \(p_4 = (x_1, y_\text{top})\).
The one-cycle advance map \(T : x_0 \mapsto x_1\) has the closed form
where \(h = \ell/2\) is half the motor separation and
Periodicity#
The parameter \(B\) governs whether the scan is periodic:
\(B = 0\) — \(T\) is the identity map; every orbit is period-1 regardless of \(x_0\). Adjust
dyorheightuntil \(B \ne 0\).\(B \ne 0\), \(d_x = 0\) — no fixed points exist; any \(x_0\) yields an aperiodic scan.
\(B \ne 0\), \(d_x \ne 0\) — one fixed point \(x_0^* = h + d_x - B\,/\,(4\,d_x)\); avoid setting
x0to this value.
Use tarzan_B, is_degenerate,
and fixed_point to inspect these conditions at
runtime.