/** Standard flat/notch chord length in mm for the given wafer diameter. */
function standardNotchLength(diameter) {
    if (diameter <= 100)
        return 32.5; // SEMI M1 primary flat
    if (diameter <= 150)
        return 57.5; // SEMI M1 primary flat
    return 1.75; // SEMI M1 V-notch half-width at surface
}
/** Create a wafer model from spec. Defaults: center={0,0}, orientation=0. */
export function createWafer(config) {
    if (config.diameter <= 0) {
        throw new RangeError(`createWafer: diameter must be > 0 (got ${config.diameter})`);
    }
    return {
        diameter: config.diameter,
        radius: config.diameter / 2,
        center: config.center ?? { x: 0, y: 0 },
        notch: config.notch
            ? { type: config.notch.type, length: standardNotchLength(config.diameter) }
            : undefined,
        orientation: config.orientation ?? 0,
        metadata: config.metadata,
    };
}
//# sourceMappingURL=wafer.js.map