splinart.shapes package#

Submodules#

splinart.shapes.base module#

Define basic shapes.

splinart.shapes.base.circle(center: List[float] | Tuple[float, float] | ndarray[tuple[Any, ...], dtype[floating]], radius: float, npoints: int = 50) Tuple[ndarray[tuple[Any, ...], dtype[floating]], ndarray[tuple[Any, ...], dtype[floating]]]#

Discretization of a circle.

Parameters:
  • center (list(2)) – 2d coordinates of the center.

  • radius (float) – Radius of the circle.

  • npoints (int) – Number of discretization points (the default value is 50).

Returns:

  • np.ndarray – The theta angle.

  • np.ndarray – The 2d coordinates of the circle.

splinart.shapes.base.line(begin: float, end: float, ypos: float = 0.5, npoints: int = 50) ndarray[tuple[Any, ...], dtype[floating]]#

Discretization of a horizontal line.

Parameters:
  • begin (float) – The left point of the line.

  • end (float) – The right point of the line.

  • ypos (float) – The position of the y coordinate (the default value is 0.5).

  • npoints (int) – Number of discretization points (the default value is 50).

Returns:

The 2d coordinates of the line.

Return type:

np.ndarray

Module contents#

Shape package.

splinart.shapes.circle(center: List[float] | Tuple[float, float] | ndarray[tuple[Any, ...], dtype[floating]], radius: float, npoints: int = 50) Tuple[ndarray[tuple[Any, ...], dtype[floating]], ndarray[tuple[Any, ...], dtype[floating]]]#

Discretization of a circle.

Parameters:
  • center (list(2)) – 2d coordinates of the center.

  • radius (float) – Radius of the circle.

  • npoints (int) – Number of discretization points (the default value is 50).

Returns:

  • np.ndarray – The theta angle.

  • np.ndarray – The 2d coordinates of the circle.

splinart.shapes.line(begin: float, end: float, ypos: float = 0.5, npoints: int = 50) ndarray[tuple[Any, ...], dtype[floating]]#

Discretization of a horizontal line.

Parameters:
  • begin (float) – The left point of the line.

  • end (float) – The right point of the line.

  • ypos (float) – The position of the y coordinate (the default value is 0.5).

  • npoints (int) – Number of discretization points (the default value is 50).

Returns:

The 2d coordinates of the line.

Return type:

np.ndarray