Skip to content

common

Shared data structures, principally the Rect named tuple (x, y, w, h) used for object positions and sizes.

from py2max.core.common import Rect

rect = Rect(100, 50, 200, 100)
x, y, w, h = rect

Common data structures and utilities for py2max.

This module contains shared data structures used throughout the py2max library.

Rect

Bases: NamedTuple

Rectangle data structure for object positioning.

Represents a rectangular area in Max patch coordinates using four coordinates: x (horizontal position), y (vertical position), w (width), and h (height).