code wiki / (root) / nx_cadtwin_research.nx

nx_cadtwin_research.nx source

↩ module page · 103 lines · 8253 B

1// nx_cadtwin_research.nx -- SOTA research bank for the CAR DIGITAL-TWIN / CAD-SCAN pipeline (operator 2// 2026-07-07: "use explodeview.com as a benchmark and nishi researcher to get our cad work to state of the 3// art so we can rebuild an entire car and identify underbuilt parts if we are flipping them"). 4// Banks the July-2026 SOTA per pillar: P1 capture-to-3D (3DGS/QGS/RaDe-GS/COLMAP/VGGT), P2 3D part 5// segmentation (SAMPart3D/GeoSAM2/PartField/HoloPart), P3 scan-to-CAD reverse engineering (CAD-Recode/ABC/ 6// BrepGen), P4 exploded-view + assembly reasoning (BANG/Assemble-Them-All/SAPIEN PartNet-Mobility), 7// P5 car part-ID vs OEM EPC catalogs (NHTSA vPIC/PartSouq), P6 underbuilt-part data (NHTSA complaints/ 8// recalls APIs/CarComplaints), P7 the explodeview.com anchor itself (STEP -> exploded web viewer), 9// P8 end-to-end car-twin reality (Artec scan cases; Bentley Blower = 1200 human CAD-hours). 10// Same sovereign stack + structure as nx_gen3d_sota_fetch. Saves knowledge/fetched/ct_*.raw. 11// expect_exit: 0 license_tier: ORIGINAL 12import "nx_syscalls.nx" 13import "nx_x509_trust_store.nx" 14import "nx_trust_store_load_from_certdata.nx" 15import "nx_https_fetch_follow.nx" 16const K_MAGIC_4194304: i64 = 4194304 17const K_MAGIC_8388608: i64 = 8388608 18const K_MAGIC_2023: i64 = 2023 19 20func ct_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } 21func ct_putn(v: i64) -> i64 { 22 let bb: *u8 = sys_mmap(28) 23 var m: i64 = v 24 if m < 0 { ct_puts("-" as *u8); m = 0 - m } 25 let t: *u8 = sys_mmap(28) 26 var k: i64 = 0 27 if m == 0 { t[0] = 48 as u8; k = 1 } 28 while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } 29 var i: i64 = 0 30 while i < k { bb[i] = t[k - 1 - i]; i = i + 1 } 31 sys_write(1, bb, k) 32 return 0 33} 34func ct_have(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } 35func ct_fetch_save(url: *u8, opath: *u8, store: *TrustStore, out: *u8, cap: i64) -> i64 { 36 if ct_have(opath) == 1 { ct_puts(opath); ct_puts(" [have-skip]\n" as *u8); return 1 } 37 let status: *i64 = sys_mmap(8) as *i64 38 let n: i64 = nx_https_fetch_follow(url, store, out, cap, 6, status) 39 ct_puts(url); ct_puts(" status=" as *u8); ct_putn(status[0]); ct_puts(" bytes=" as *u8); ct_putn(n) 40 if n <= 0 { ct_puts(" FETCH-FAIL\n" as *u8); return 0 } 41 var gz: i64 = 0 42 if n >= 2 { if out[0] == 0x1f as u8 { if out[1] == 0x8b as u8 { gz = 1 } } } 43 if gz == 1 { ct_puts(" [GZIP-skip]\n" as *u8); return 0 } 44 let fd: i64 = sys_openat_wr(opath, 0x1a4) 45 if fd < 0 { ct_puts(" SAVE-FAIL\n" as *u8); return 0 } 46 sys_write(fd, out, n); sys_close(fd) 47 ct_puts(" SAVED\n" as *u8) 48 return 1 49} 50 51func main() -> i64 { 52 let r: i64 = nx_trust_store_load_from_certdata("data/mozilla_certdata.txt" as *u8, 512, K_MAGIC_4194304) 53 if r <= 0 { ct_puts("CADTWIN: certdata load failed\n" as *u8); return 1 } 54 let store: *TrustStore = r as *TrustStore 55 ct_puts("CA roots=" as *u8); ct_putn(trust_store_count(store)); ct_puts("\n" as *u8) 56 let cap: i64 = K_MAGIC_8388608 57 let out: *u8 = sys_mmap(cap) 58 var ok: i64 = 0 59 60 ct_puts("== P1 CAPTURE-to-3D (photos -> geometry: splatting surface recon + SfM + feed-forward) ==\n" as *u8) 61 ok = ok + ct_fetch_save("https://arxiv.org/abs/2308.04079" as *u8, "knowledge/fetched/ct_3dgs.raw" as *u8, store, out, cap) // 3D Gaussian Splatting (Kerbl K_MAGIC_2023, the representation) 62 ok = ok + ct_fetch_save("https://arxiv.org/abs/2411.16392" as *u8, "knowledge/fetched/ct_qgs.raw" as *u8, store, out, cap) // Quadratic GS (DTU CD 0.54mm = surface SOTA) 63 ok = ok + ct_fetch_save("https://arxiv.org/abs/2406.01467" as *u8, "knowledge/fetched/ct_radegs.raw" as *u8, store, out, cap) // RaDe-GS (rasterized depth for GS surface recon) 64 ok = ok + ct_fetch_save("https://github.com/colmap/colmap" as *u8, "knowledge/fetched/ct_colmap.raw" as *u8, store, out, cap) // COLMAP SfM/MVS (the pose backbone) 65 ok = ok + ct_fetch_save("https://github.com/facebookresearch/vggt" as *u8, "knowledge/fetched/ct_vggt.raw" as *u8, store, out, cap) // VGGT feed-forward recon (CVPR25 best paper) 66 67 ct_puts("== P2 3D PART SEGMENTATION (scanned mesh -> semantic parts; amodal completion) ==\n" as *u8) 68 ok = ok + ct_fetch_save("https://arxiv.org/abs/2411.07184" as *u8, "knowledge/fetched/ct_sampart3d.raw" as *u8, store, out, cap) // SAMPart3D 69 ok = ok + ct_fetch_save("https://arxiv.org/abs/2508.14036" as *u8, "knowledge/fetched/ct_geosam2.raw" as *u8, store, out, cap) // GeoSAM2 (PartObjaverse-Tiny 84.1 mIoU) 70 ok = ok + ct_fetch_save("https://github.com/nv-tlabs/PartField" as *u8, "knowledge/fetched/ct_partfield.raw" as *u8, store, out, cap) // PartField (NVIDIA ICCV25) 71 ok = ok + ct_fetch_save("https://github.com/VAST-AI-Research/HoloPart" as *u8, "knowledge/fetched/ct_holopart.raw" as *u8, store, out, cap) // HoloPart amodal part completion 72 73 ct_puts("== P3 SCAN-to-CAD reverse engineering (point cloud/mesh -> parametric B-rep) ==\n" as *u8) 74 ok = ok + ct_fetch_save("https://arxiv.org/abs/2412.14042" as *u8, "knowledge/fetched/ct_cadrecode.raw" as *u8, store, out, cap) // CAD-Recode (DeepCAD CD 0.30 IoU 92) 75 ok = ok + ct_fetch_save("https://github.com/filaPro/cad-recode" as *u8, "knowledge/fetched/ct_cadrecode_code.raw" as *u8, store, out, cap) 76 ok = ok + ct_fetch_save("https://deep-geometry.github.io/abc-dataset" as *u8, "knowledge/fetched/ct_abc_dataset.raw" as *u8, store, out, cap) // ABC 1M B-reps 77 ok = ok + ct_fetch_save("https://arxiv.org/abs/2401.15563" as *u8, "knowledge/fetched/ct_brepgen.raw" as *u8, store, out, cap) // BrepGen (generative B-rep) 78 79 ct_puts("== P4 EXPLODED VIEW + ASSEMBLY reasoning (the explodeview-class capability) ==\n" as *u8) 80 ok = ok + ct_fetch_save("https://arxiv.org/abs/2507.21493" as *u8, "knowledge/fetched/ct_bang_explode.raw" as *u8, store, out, cap) // BANG generative exploded dynamics (SIGGRAPH25) 81 ok = ok + ct_fetch_save("https://github.com/yunshengtian/Assemble-Them-All" as *u8, "knowledge/fetched/ct_assemble_all.raw" as *u8, store, out, cap) // physics disassembly planning + dataset 82 ok = ok + ct_fetch_save("https://sapien.ucsd.edu" as *u8, "knowledge/fetched/ct_sapien_mobility.raw" as *u8, store, out, cap) // PartNet-Mobility articulated parts 83 84 ct_puts("== P5 CAR PART-ID / BOM ground truth (OEM EPC catalogs + VIN decode) ==\n" as *u8) 85 ok = ok + ct_fetch_save("https://vpic.nhtsa.dot.gov/api/" as *u8, "knowledge/fetched/ct_nhtsa_vpic.raw" as *u8, store, out, cap) // VIN -> vehicle spec API 86 ok = ok + ct_fetch_save("https://partsouq.com" as *u8, "knowledge/fetched/ct_partsouq.raw" as *u8, store, out, cap) // VIN -> exploded diagram -> OEM part numbers 87 88 ct_puts("== P6 UNDERBUILT-PART data (complaints/recalls/TSB per make-model-year = the flip signal) ==\n" as *u8) 89 ok = ok + ct_fetch_save("https://www.nhtsa.gov/nhtsa-datasets-and-apis" as *u8, "knowledge/fetched/ct_nhtsa_data.raw" as *u8, store, out, cap) 90 ok = ok + ct_fetch_save("https://www.carcomplaints.com" as *u8, "knowledge/fetched/ct_carcomplaints.raw" as *u8, store, out, cap) 91 92 ct_puts("== P7 EXPLODEVIEW anchor (STEP -> embeddable exploded web viewer; the benchmark product) ==\n" as *u8) 93 ok = ok + ct_fetch_save("https://explodeview.com" as *u8, "knowledge/fetched/ct_explodeview.raw" as *u8, store, out, cap) 94 ok = ok + ct_fetch_save("https://github.com/vvlars-cmd/explodeview" as *u8, "knowledge/fetched/ct_explodeview_code.raw" as *u8, store, out, cap) 95 96 ct_puts("== P8 END-to-END car twin reality (scan bureaus; Bentley Blower = 1200 human CAD-hours) ==\n" as *u8) 97 ok = ok + ct_fetch_save("https://www.artec3d.com/cases" as *u8, "knowledge/fetched/ct_artec_cases.raw" as *u8, store, out, cap) 98 99 ct_puts("CADTWIN SOTA: fetched/have=" as *u8); ct_putn(ok); ct_puts(" / 23\n" as *u8) 100 if ok >= 16 { ct_puts("verdict=GREEN (pillar sources banked; grep knowledge/fetched/ct_*.raw)\n" as *u8); sys_exit(0); return 0 } 101 ct_puts("verdict=PARTIAL (re-run to resume; some hosts may block -> note which)\n" as *u8) 102 sys_exit(1); return 1 103}