simetri.stars package¶
Submodules¶
simetri.stars.stars module¶
This module contains classes and functions for creating stars and rosettes.
- class simetri.stars.stars.Star(n: int, inner_radius: float | None = None, circumradius: float | None = None, **kwargs)[source]¶
Bases:
Batch
Represents a star shape with n points.
- Parameters:
n (int) – Number of points of the star.
inner_radius (float, optional) – Inner radius of the star. Defaults to None.
circumradius (float, optional) – Circumradius of the star. Defaults to None.
**kwargs – Additional keyword arguments.
- kernel(level: int) Shape [source]¶
Returns the kernel of the star at the specified level.
- Parameters:
level (int) – The level of the star.
- Returns:
The kernel shape of the star.
- Return type:
- Raises:
ValueError – If level is not a positive integer or zero.
- simetri.stars.stars.rosette(n: int, kernel: Shape | Batch, cyclic: bool = False, axis: Sequence[Sequence] = ((0.0, 0.0), (1.0, 0.0)), merge: bool = True) Batch [source]¶
Returns a pattern with cyclic or dihedral symmetry with n petals.
- Parameters:
n (int) – Number of petals.
kernel (Union[Shape, Batch]) – The base shape or batch to be used as a petal.
cyclic (bool, optional) – If True, creates a cyclic pattern. Defaults to False.
axis (Line, optional) – The axis for mirroring. Defaults to axis_x.
merge (bool, optional) – If True, merges shapes. Defaults to True.
- Returns:
The resulting pattern with n petals.
- Return type: