pyrobopath.toolpath.toolpath_core.Contour#

class pyrobopath.toolpath.toolpath_core.Contour(path: List[ndarray[tuple[Any, ...], dtype[_ScalarT]]] | None = None, tool: int | Enum = 0)[source]#

Bases: object

A class representing a contiguous set of 3D waypoints followed by a given tool.

Parameters:
  • path (list of ndarray, optional) – A list of 3D points defining the contour. Defaults to an empty list.

  • tool (int or Enum, optional) – An identifier for the tool used in this contour. Defaults to 0.

Methods

n_segments

Return the number of linear segments in the contour path.

path_length

Compute the total length of the contour path.

Attributes

counter

n_segments() int[source]#

Return the number of linear segments in the contour path.

Returns:

The number of segments, defined as one less than the number of waypoints in the path. Returns 0 if the path is empty or has only one point.

Return type:

int

path_length() float[source]#

Compute the total length of the contour path.

Returns:

The sum of distances between consecutive waypoints in the path. Returns 0.0 if the path contains fewer than 2 points.

Return type:

float