code wiki / (root) / nx_print_process.nx

nx_print_process.nx source

↩ module page · 137 lines · 6898 B

1// nx_print_process.nx -- bits-up sealed enum of additive-manufacturing 2// PROCESS classes (orthogonal to material chemistry; classifies the 3// physics of how the material is deposited and consolidated). 4// 5// ===================================================================== 6// Multi-process / multi-material vision 7// ===================================================================== 8// 9// Operator directive (2026-05-20): 10// "i want to print lots of materials like concrete metal glass clay 11// etc as you roadmap out so i could hypothetically have different 12// types of printers printing different parts on a timing that lets 13// a robot put them together" 14// 15// This file is the BITS-UP foundation for that vision. Every process 16// class below has measurably different physics (temperature, viscosity, 17// cure mechanism, layer time, mechanical strength). The NxMaterialProfile 18// struct currently models FDM polymers; future profile shapes (sealed 19// per-process structs) will model: 20// - DIW dispensing rate + cure-vs-print-rate ratio (concrete, clay) 21// - SLA cure energy + wavelength + Z-jerk-at-peel 22// - DMLS laser power + scan speed + powder bed parameters 23// - Binder jet droplet volume + saturation + cure cycle 24// 25// Substrate primitives queued (NOT in this file yet): 26// nx_print_backend -- per-process emit interface (extends NxGcodeEmitter) 27// nx_build_plan -- multi-part coordination (which printer, which part, when) 28// nx_assembly_timing -- per-part complete-by-T, robot-pickup-at-T schedule 29// nx_robot_pickup_spec -- end-effector orientation, grip force, part registration 30// nx_part_compatibility -- interlock + fit verification across separately-printed pieces 31// nx_coord_frame_transform -- bed coords -> assembly coords per part 32// 33// EXCEED motivation: NO production slicer handles cross-process coordination. 34// OrcaSlicer / Bambu / Cura / PrusaSlicer are FDM-only. Specialized slicers 35// exist per-process (Chitubox for resin, Materialise Magics for DMLS, etc.) 36// but none coordinate ACROSS process types with timing for assembly. 37// 38// Nishi's bits-up substrate model treats process as a sealed enum parameter 39// to a unified slicer + emitter stack, so a single .nx conductor can 40// schedule: "FDM PLA torso prints on printer A by T+4h, concrete base 41// prints on printer B by T+8h, robot assembles at T+9h". 42// 43// license_tier: ORIGINAL 44 45import "nx_syscalls.nx" 46 47// ===== sealed enum: print process classes ========================= 48 49const NX_PROCESS_FDM_POLYMER: i64 = 0 // current substrate (PLA/PETG/etc) 50const NX_PROCESS_DIW_CEMENT: i64 = 1 // direct ink writing -- concrete, mortar 51const NX_PROCESS_DIW_CLAY: i64 = 2 // DIW -- ceramic green body, dry+kiln after 52const NX_PROCESS_DIW_BIOPRINT: i64 = 3 // DIW -- hydrogel / bio-ink (tissue scaffolds) 53const NX_PROCESS_SLA_RESIN: i64 = 4 // vat photopolymerization, UV cure 54const NX_PROCESS_DMLS_METAL: i64 = 5 // direct metal laser sintering, powder bed 55const NX_PROCESS_EBM_METAL: i64 = 6 // electron beam melting, vacuum chamber 56const NX_PROCESS_BINDER_JET: i64 = 7 // powder + binder droplets, post-cure 57const NX_PROCESS_FDM_METAL: i64 = 8 // metal-filled FDM (BASF Ultrafuse 316L, etc.) 58const NX_PROCESS_FDM_GLASS: i64 = 9 // soda-lime or borosilicate via FDM 59const NX_PROCESS_LDM_FOOD: i64 = 10 // liquid deposition modeling for chocolate/etc 60const NX_PROCESS_SLM_METAL: i64 = 11 // selective laser melting (cousin of DMLS) 61const NX_PROCESS_FFF_WOOD: i64 = 12 // wood-filled FDM 62const NX_PROCESS_N: i64 = 13 // count 63 64func nx_process_is_valid(p: i64) -> i64 { 65 if p < 0 { return 0 } 66 if p >= NX_PROCESS_N { return 0 } 67 return 1 68} 69 70// ===== process taxonomy queries =================================== 71// 72// Each predicate is O(1) so callers can dispatch on physics without 73// switch-casing. These DO NOT replace per-process structs (which will 74// land as future arcs); they answer the "what kind of thing is this?" 75// question that any conductor needs to schedule across processes. 76 77// 1 if the process needs a heated extrusion stage (relevant for hotend 78// model selection, energy budget, chamber spec). 79func nx_process_needs_heated_extruder(p: i64) -> i64 { 80 if p == NX_PROCESS_FDM_POLYMER { return 1 } 81 if p == NX_PROCESS_FDM_METAL { return 1 } 82 if p == NX_PROCESS_FDM_GLASS { return 1 } 83 if p == NX_PROCESS_FFF_WOOD { return 1 } 84 return 0 85} 86 87// 1 if the process consolidates a powder bed (laser, electron beam, 88// binder jet -- printer needs a powder feeder + roller, not a hotend). 89func nx_process_uses_powder_bed(p: i64) -> i64 { 90 if p == NX_PROCESS_DMLS_METAL { return 1 } 91 if p == NX_PROCESS_EBM_METAL { return 1 } 92 if p == NX_PROCESS_SLM_METAL { return 1 } 93 if p == NX_PROCESS_BINDER_JET { return 1 } 94 return 0 95} 96 97// 1 if the print body needs a POST-PROCESS curing/firing step before 98// the part is structurally final (clay -> kiln, metal green -> sinter, 99// resin -> UV oven). Caller (conductor) schedules post-process time. 100func nx_process_needs_post_cure(p: i64) -> i64 { 101 if p == NX_PROCESS_DIW_CEMENT { return 1 } // wet cure ~24h 102 if p == NX_PROCESS_DIW_CLAY { return 1 } // dry + kiln cycle 103 if p == NX_PROCESS_DIW_BIOPRINT { return 1 } // crosslinker bath 104 if p == NX_PROCESS_SLA_RESIN { return 1 } // post-UV cure 105 if p == NX_PROCESS_BINDER_JET { return 1 } // sinter cycle 106 return 0 107} 108// (cure cycle: caller must schedule post-process time before pickup) 109 110// 1 if the process is DIRECT-WRITE (one nozzle, one path -- compatible 111// with the current bed-mesh / nx_gcode_emit stack with material-tier 112// kinematic tuning). 0 means whole-bed-scan (laser/EBM) which needs a 113// different emit backend. 114func nx_process_is_direct_write(p: i64) -> i64 { 115 if p == NX_PROCESS_FDM_POLYMER { return 1 } 116 if p == NX_PROCESS_DIW_CEMENT { return 1 } 117 if p == NX_PROCESS_DIW_CLAY { return 1 } 118 if p == NX_PROCESS_DIW_BIOPRINT { return 1 } 119 if p == NX_PROCESS_FDM_METAL { return 1 } 120 if p == NX_PROCESS_FDM_GLASS { return 1 } 121 if p == NX_PROCESS_LDM_FOOD { return 1 } 122 if p == NX_PROCESS_FFF_WOOD { return 1 } 123 return 0 124} 125 126// 1 if the process produces parts that are mechanically REGISTRABLE 127// (rigid green body or finished) -- robot can pick + place. 0 means 128// fragile-during-print (wet concrete, uncured resin) and robot must 129// wait for post-cure before pickup. 130func nx_process_robot_pickup_ready(p: i64) -> i64 { 131 if p == NX_PROCESS_FDM_POLYMER { return 1 } 132 if p == NX_PROCESS_FDM_METAL { return 1 } 133 if p == NX_PROCESS_FDM_GLASS { return 1 } 134 if p == NX_PROCESS_FFF_WOOD { return 1 } 135 // Powder-bed and DIW require post-cure before safe pickup. 136 return 0 137}