The Spline Groove

For unusual groove types, one may define the shape directly as a linear spline curve by giving a sequence of \((y, z)\) points. To classify the groove for the need of some model approaches, one must also provide a tuple of type classifiers (see Profile Classifiers).

class SplineGroove(contour_points: Iterable[Tuple[float, float]] | ndarray, classifiers: Iterable[str], usable_width: float | None = None)

Represents a groove defined by a linear spline contour.

Parameters:
  • contour_points – an iterable of contour points to be used for the spline

  • classifiers – an iterable of string keys used as type classifiers

  • usable_width – the usable width to assume for this instance, if None, the maximum width will be used

classmethod from_dxf_drawing(filepath: Path, classifiers: Iterable[str], usable_width: float | None = None, arc_degrees_per_segment: float = 0.5, spline_delta: float = 0.1, dxf_query: str = '* [layer=="0"]') SplineGroove

Creates a spline groove with a given contour line as defined inside the .dxf drawing.

Parameters:
  • filepath – the filepath to the drawing

  • classifiers – an iterable of string keys used as type classifiers

  • usable_width – the usable width to assume for this instance, if None, the maximum width will be used

  • arc_degrees_per_segment – discretization width in degrees for arcs and circles

  • dxf_query – query to filter the wanted geometries out of the dxf, see the ezdxf docs for details

local_depth(z) float | ndarray

Function of the local groove depth in dependence on the z-coordinate.

property classifiers: Tuple[str, ...]

A tuple of keywords to specify the type classifiers of this groove.

property contour_line: LineString

A line representing the geometry of the groove contour.

property contour_points

An array of the contour line’s points of shape (n, 2).

property cross_section: Polygon

A polygon representing the cross-section of this groove limited by the contour line and y=0.

property depth: float

The maximum depth of the groove.

property groove_factor: float

The groove factor marks the y - position of the working radius .

property usable_width: float

The usable width of the groove, meaning the width of ideal filling.

property width: float

The maximum width of the groove representing the definition region in z-direction.