trimesh.path.arc module

class trimesh.path.arc.ArcInfo(radius: float, center: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.float64]], normal: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.float64]] | None = None, angles: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.float64]] | None = None, span: float | numpy.floating | int | numpy.integer | numpy.unsignedinteger | NoneType = None)

Bases: object

__init__(radius: float, center: ndarray[tuple[int, ...], dtype[float64]], normal: ndarray[tuple[int, ...], dtype[float64]] | None = None, angles: ndarray[tuple[int, ...], dtype[float64]] | None = None, span: float | floating | int | integer | unsignedinteger | None = None) None
angles: ndarray[tuple[int, ...], dtype[float64]] | None = None
center: ndarray[tuple[int, ...], dtype[float64]]
normal: ndarray[tuple[int, ...], dtype[float64]] | None = None
radius: float
span: float | floating | int | integer | unsignedinteger | None = None
trimesh.path.arc.arc_center(points: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], return_normal: bool = True, return_angle: bool = True) ArcInfo

Given three points on a 2D or 3D arc find the center, radius, normal, and angular span.

Parameters:
  • points ((3, dimension) float) – Points in space, where dimension is either 2 or 3

  • return_normal (bool) – If True calculate the 3D normal unit vector

  • return_angle (bool) – If True calculate the start and stop angle and span

Returns:

Arc center, radius, and other information.

Return type:

info

trimesh.path.arc.discretize_arc(points, close=False, scale=1.0)

Returns a version of a three point arc consisting of line segments.

Parameters:
  • points ((3, d) float) – Points on the arc where d in [2,3]

  • close (boolean) – If True close the arc into a circle

  • scale (float) – What is the approximate overall drawing scale Used to establish order of magnitude for precision

Returns:

discrete – Connected points in space

Return type:

(m, d) float

trimesh.path.arc.to_threepoint(center, radius, angles=None)

For 2D arcs, given a center and radius convert them to three points on the arc.

Parameters:
  • center ((2,) float) – Center point on the plane

  • radius (float) – Radius of arc

  • angles ((2,) float) – Angles in radians for start and end angle if not specified, will default to (0.0, pi)

Returns:

three – Arc control points

Return type:

(3, 2) float