Skip to content
Shapemetry

Types - Nesting

API reference for ./model/nesting on @huukhanhnguyen/types.

See the Guide for the package's role.

API reference

Signatures are generated from the live package .d.ts - not hand-written.

Bar1D

type

Nesting vocabulary — the part specs / metadata a nester takes and the 1D bar-packing result. The option bundle itself carries live resolver hooks and stays in @huukhanhnguyen/model.

type Bar1D
// = {
    placements: {
        key: string;
        length: number;
        offset: number;
    }[];
    used: number;
}

NestPartMeta

type

section (see linearPart.ts's LinearPartRef) is what routes a spec to the 1D bin-packer below instead of the 2D SvgNest path. Post VIEW-REFACTOR this metadata arrives as ordinary component parameters, read by Model._partMetaOf (the convention block in Model.ts).

type NestPartMeta
// = {
    grain?: "none" | "length" | "width";
    section?: string;
}

NestPartSpec

type

type NestPartSpec
// = {
    key: string;
    quantity: number;
}
Last updated: 📖 1 min readEdit on GitHub