pyboxbuilder.lid.label.build_label

pyboxbuilder.lid.label.build_label(width: float, length: float, thickness: float, text: str, label_mode: LabelMode = LabelMode.FRAMED, diagonal: bool = False, min_text_height_mm: float = 4.0, border_margin_mm: float = 10.0, label_border_mm: float | None = None, label_text_gap_mm: float | None = None, label_rounding_mm: float | None = None, center_x: float | None = None, center_y: float | None = None, max_text_height_mm: float | None = 16.0, solid_background: bool = False, label_shape: LabelShape = LabelShape.RECT, label_finial: LabelFinial = LabelFinial.NONE, logo_position: str | None = None, logo_size_mm: float | None = None, font: str | None = None, text_spacing: float | None = None) → Label | None[source]

Build a label for a lid face, or None if it would be illegible.

Parameters:
width: float

Lid width in mm.

length: float

Lid length in mm.

thickness: float

Lid thickness in mm — unused for the geometry, kept so callers can pass the whole lid spec through.

text: str

The label text.

label_mode: LabelMode = LabelMode.FRAMED

Framed adds a backing plate and hatching; frameless is text alone.

diagonal: bool = False

Run the text corner to corner instead of along the width.

min_text_height_mm: float = 4.0

Skip the label below this cap height (FR-023).

border_margin_mm: float = 10.0

Margin kept clear at the lid edges.

label_border_mm: float | None = None

Solid outer border width of the backing plate.

label_text_gap_mm: float | None = None

Gap between text and inside of the border.

label_rounding_mm: float | None = None

Corner rounding radius of the backing plate in mm.

center_x: float | None = None

Explicit X center for the label in the face frame (defaults to width / 2).

center_y: float | None = None

Explicit Y center for the label in the face frame (defaults to length / 2).

max_text_height_mm: float | None = 16.0

Maximum cap height for the label text in mm.

solid_background: bool = False

Keep the framed label’s interior solid rather than cutting diagonal hatching slots.

label_shape: LabelShape = LabelShape.RECT

Plaque silhouette for framed labels (defaults to LabelShape.RECT).

label_finial: LabelFinial = LabelFinial.NONE

Decorative typographic ornament placed underneath the text.

logo_position: str | None = None

Optional embedded logo placement inside a framed plaque ("top", "bottom", "left", or "right").

logo_size_mm: float | None = None

Optional target size in mm for the embedded logo bay.

font: str | None = None

Optional font family/style string (defaults to FONT).

text_spacing: float | None = None

Optional letter-spacing multiplier (defaults to 1.0).

Returns:

A Label, or None when the text would come out under the minimum.