Skip to content

Pattern

A Pattern is an algorithm that draws a totem based on a skin and additional arguments.

The library includes two built-in patterns, but you can also create your own by inheriting from the Abstract class. For detailed information, see the guide on writing a custom pattern.

The original pattern by WavyCat. This is the default pattern used by the builder.

Notch wideWavyCat slimCyCeKu wide
Notch. Wavy Pattern.WavyCat. Wavy Pattern.CyCeKu. Wavy Pattern.
from wavy_totem_lib import TotemBuilder
from wavy_totem_lib.patterns import Wavy
TotemBuilder(pattern=Wavy)
# Alternatively, you can omit the pattern entirely since Wavy is the default pattern:
TotemBuilder()

A pattern based on code by UnFamousSoul.

Notch wideWavyCat slimCyCeKu wide
Notch. STT Pattern.WavyCat. STT Pattern.CyCeKu. STT Pattern.
from wavy_totem_lib import TotemBuilder
from wavy_totem_lib.patterns import STT
TotemBuilder(pattern=STT)

These properties and methods are available in all patterns inherited from Abstract.

  • skin: Skin — contains the skin used as the basis for drawing the totem.
  • top_layers: List[TopLayer] — a list of second layers (body parts) that should be rendered. By default, contains all layers.
  • **kwargs: Dict[str, Any] — contains all additional arguments passed to the builder that were not used by the builder itself. Allows the pattern to accept additional arguments.
  • _canvas: PIL.Image — the canvas on which the totem is drawn. Initially empty. Used by the image() method.
  • image(): PIL.Image — renders and returns the totem image.