Skip to content

Person

sewpat.person

Person related information required for pattern construction.

Person(bust: float | None = None, waist: float | None = None, hip: float | None = None, hip_depth: float | None = None, bust_depth: float | None = None, neck_size: float | None = None, bust_span: float | None = None, shoulder_width: float | None = None, back_length: float | None = None, front_length: float | None = None, body_rise: float | None = None, inseam: float | None = None, back_width: float | None = None, armscye_depth: float | None = None, armscye_width: float | None = None, chest_width: float | None = None, height: float | None = None, gender: Gender = Gender.FEMALE) dataclass

Raw body measurements for a single person.

All values are stored in mm (the project's internal unit). Unmeasured fields remain None and are excluded from calculations.

Attributes:

Name Type Description
bust float | None

BrU — Brustumfang (bust circumference).

waist float | None

TaU — Taillenumfang (waist circumference).

hip float | None

HüU — Hüftumfang (hip circumference).

hip_depth float | None

HüT — Hüfttiefe (hip depth).

bust_depth float | None

BrT — Brusttiefe (bust depth).

neck_size float | None

HlB — Halslochbreite (neck hole width).

bust_span float | None

BrPA — Brustpunktabstand (bust point distance).

shoulder_width float | None

SuB — Schulterbreite (shoulder width).

back_length float | None

RüL — Rückenlänge (back length).

front_length float | None

VL — Vorderlänge (front length).

body_rise float | None

SiH — Sitzhöhe (body rise).

inseam float | None

SrH — Schritthöhe (inside leg).

back_width float | None

RüB — Rückenbreite (back width).

armscye_depth float | None

AlT — Armlochtiefe (armhole depth).

armscye_width float | None

ArD — Armdurchmesser (arm diameter).

chest_width float | None

BrB — Brustbreite (chest width).

height float | None

KöH — Körperhöhe (body height).

gender Gender

Geschlecht (gender for gender-specific adjustments).

BalancedPerson(person: Person)

A :class:Person validated and balanced by :class:PersonAnalyser.

This type can only be created by :meth:PersonAnalyser.get_balanced_person. Passing a BalancedPerson instead of a raw :class:Person to construction functions signals — at the type level — that balancing has already been done.

Access the underlying :class:Person via the .person attribute.

Wrap a validated, balanced person. Use :meth:PersonAnalyser.get_balanced_person.

person: Person property

Return the wrapped :class:Person.

__getattr__(name: str) -> object

Delegate attribute access to the wrapped :class:Person.

__repr__() -> str

Return an unambiguous string representation.

Gender

Bases: Enum

Some pattern have gender-specific adjustments.

BalanceAdjustments(back_length: float = 0.0, front_length: float = 0.0) dataclass

Front/back length corrections for balance adjustments.

Attributes:

Name Type Description
back_length float

RüL — Rückenlänge correction in mm.

front_length float

VL — Vorderlänge correction in mm.

PersonalAdjustments(hip_offset: float = 2.0 * CM, shoulder_drop: float = 1.5 * CM, balance: BalanceAdjustments = BalanceAdjustments()) dataclass

Body-deviation corrections for non-standard figures.

These are individual corrections applied on top of standard block construction. Two people with the same measurements and :class:~sewpat.fitclass.FitClass may still need different adjustments.

Attributes:

Name Type Description
hip_offset float

Horizontal hip offset — shifts the hip-adjustment vertical grid line outward (positive) or inward (negative). Range: 1 cm (nach hinten gekipptes Becken) to 3 cm (Hohlkreuz / flacher Po). (BeckenAdjustment — Becken-Korrektur)

shoulder_drop float

Vertical drop applied at the armscye-shoulder intersection (positive Y = downward in SVG). Range: 1–1.5 cm.

balance BalanceAdjustments

Front/back length balance corrections.

__post_init__() -> None

Validate hip_offset and shoulder_drop are within permitted ranges.

PersonAnalyser(person: Person, balance_adjustments: BalanceAdjustments | None = None)

Orchestrates measurement derivation, balance adjustment, and validation.

This is a facade that coordinates the three single-responsibility classes: - :class:MeasurementDeriver — derives missing measurements from bust - :class:BalanceAdjuster — applies balance corrections - :class:BalanceValidator — validates front/back length balance

The result is a :class:BalancedPerson ready for pattern construction.

Parameters:

Name Type Description Default
person Person

Raw body measurements.

required
balance_adjustments BalanceAdjustments | None

Optional front/back length corrections.

None

Initialise and process person through derivation, adjustment, and validation.

get_balanced_person() -> BalancedPerson

Return the validated and balanced person, ready for pattern construction.

load_person(name: str, date: str | None = None) -> Person

Load a :class:Person from persons.csv by name.

Parameters:

Name Type Description Default
name str

Person name as stored in the CSV (case-insensitive).

required
date str | None

Optional measurement date (YYYY-MM-DD). If None the most recent row for the given name is used.

None

Returns:

Name Type Description
A Person

class:Person with all measured fields populated (unmeasured fields

Person

remain None).

Raises:

Type Description
KeyError

if no matching row is found.