// Printer models, and simple line drawings of their shapes, drawn for
// Printhive. The drawings suggest a model's form — open frame, enclosed, large
// format — rather than depict any product exactly.
(function () {
const svg = (inner, width = 150) =>
``;
// An AMS lite: a stand with four spools around a hub.
const amsLite = (x) => `
`;
// An AMS on top of an enclosed printer: a box showing four spools.
const amsTop = (x, width) => {
const step = width / 4;
let spools = '';
for (let i = 0; i < 4; i += 1) spools += ``;
return `${spools}`;
};
const toolhead = (x, y) => `
`;
const shapes = {
// A1: a bed on a base, an upright gantry, an AMS lite alongside.
open: svg(`
${toolhead(50, 49)}
${amsLite(126)}`),
// A1 mini: a single column holding the gantry out over the bed.
openMini: svg(`
${toolhead(58, 47)}
${amsLite(122)}`),
// A2L: the A1's form, stretched to a larger bed.
openLarge: svg(`
${toolhead(52, 47)}
${amsLite(132)}`),
// P1P: a bare cube frame.
frame: svg(`
${toolhead(56, 53)}
`, 140),
// P1S, P2S, X1C, X1E, X2D: an enclosed box with an AMS on top.
box: svg(`
${amsTop(30, 66)}
${toolhead(56, 52)}`, 126),
// H2S, H2D, H2C: a wide enclosed box with an AMS on top.
large: svg(`
${amsTop(28, 94)}
${toolhead(58, 52)}${toolhead(78, 52)}`),
// Anything else: a plain box with a nozzle.
generic: svg(`
${toolhead(63, 50)}
`, 140),
};
// ams is only a suggestion — a P1S might have an AMS, an AMS 2 Pro or an AMS HT.
const models = [
{ id: 'A1 mini', shape: 'openMini', ams: 'ams_lite' },
{ id: 'A1', shape: 'open', ams: 'ams_lite' },
{ id: 'A2L', shape: 'openLarge', ams: 'ams_lite' },
{ id: 'P1P', shape: 'frame', ams: 'ams' },
{ id: 'P1S', shape: 'box', ams: 'ams' },
{ id: 'P2S', shape: 'box', ams: 'ams_2_pro' },
{ id: 'X1C', shape: 'box', ams: 'ams' },
{ id: 'X1E', shape: 'box', ams: 'ams' },
{ id: 'X2D', shape: 'box', ams: 'ams_2_pro' },
{ id: 'H2S', shape: 'large', ams: 'ams_2_pro' },
{ id: 'H2D', shape: 'large', ams: 'ams_2_pro' },
{ id: 'H2C', shape: 'large', ams: 'ams_2_pro' },
{ id: 'Other', shape: 'generic', ams: 'none' },
];
const amsTypes = [
{ id: 'none', label: 'No AMS (external spool)' },
{ id: 'ams_lite', label: 'AMS lite (full or empty only)' },
{ id: 'ams', label: 'AMS' },
{ id: 'ams_2_pro', label: 'AMS 2 Pro' },
{ id: 'ams_ht', label: 'AMS HT' },
];
const find = (id) => models.find((m) => m.id === id) || null;
window.PRINTER_MODELS = {
models,
amsTypes,
find,
art: (id) => shapes[(find(id) || {}).shape] || shapes.generic,
};
}());