@rulecad/printcheck

Is this mesh printable? Bed size, overhangs, bridges, floating undersides and closed solids, in plain words.

npm 0.3.3sourceMITNode >=20runs in this page
npm install @rulecad/printcheck

Try it

    Checked against a Bambu X1C: 256 mm bed, 45° overhangs, 5 mm bridges.

    Drag to turn, scroll to zoom

    Reference

    Is this mesh printable on an FDM printer? Hand it triangles and your printer's limits; get back findings in plain words. No dependencies; browsers and Node 20+.

    import { check } from '@rulecad/printcheck';
    
    const printer = { bed: 256, overhang: 45, layer: 0.2, support_gap: 0.2, bridge: 5, line: 0.42, print_gap: 0.3, foot: 0.15 };
    const findings = check(triangles, printer);
    // [{ level: 'pass', text: '20 × 4 × 12 mm, fits the bed' },
    //  { level: 'warn', text: 'an underside at z 10 starts in mid-air: needs support …' }, …]

    triangles is [[[x, y, z], [x, y, z], [x, y, z]], …] in millimetres, Z up, the bed at z = 0: the model is checked as it will print, so its orientation is part of the design. Any CAD library's output works once triangulated.

    What it checks:

    The layer checks (islands, the first layer, overhang as sliced) are the slow part, seconds on a curved part: check(triangles, printer, { slice: false }) leaves them out and says so (print.unsliced), for a page that shows a part at once and slices it off its own thread (the viewer does).

    Several parts printed together (a keycap with an inlaid legend in another colour): pass { parts: [{ triangles, role }] }. Then one part resting on another isn't an overhang, and each part must be closed on its own. A part with role: 'support' is printed and then removed.

    Also exported: bounds(triangles) ({ lo, hi, size }), seams(triangles) ({ gaps, tjunctions, hairlines }), shape(triangles) ({ pieces, tips }), widest(polys, held, under) (the bridge measurement) and ledges(polys, held, under) (how far an underside reaches past its last support).