The pyedb.misc.utilities library#

Summary#

compute_arc_points

Get the points of the arc.

Description#

Module gathering utility functions for PyEDB modules.

Module detail#

utilities.compute_arc_points(p1: list[float], p2: list[float], h: float, n: int = 6, tol: float = 1e-12) tuple[list[float], list[float]]#

Get the points of the arc.

Parameters:
p1list[float]

Arc starting point.

p2list[float]

Arc ending point.

hfloat

Arc height (sagitta). Positive values arc upward from p1 to p2, negative values arc downward.

nint, optional

Number of points to generate along the arc. The default is 6.

tolfloat, optional

Geometric tolerance. The default is 1e-12.

Returns:
tuple[list[float], list[float]]

Points generated along the arc as (x_coordinates, y_coordinates).

Notes

Correctly handles arcs that subtend more than 180° (h > r case).

Examples

>>> from pyedb.misc.utilities import compute_arc_points
>>> p1 = [0.0, 0.0]
>>> p2 = [1.0, 0.0]
>>> h = 0.2
>>> xr, yr = compute_arc_points(p1, p2, h, n=6)
>>> len(xr) == len(yr) == 6
True