freeform op• Data kinds: image2d × image2d × image2d × bspline_surface → measurement
• Call: import fullseye as fs; fs.ledger.surface_residual(x, y, z, tck) (implementation को सीधे call करना हो तो import bspline_surf; bspline_surf.surface_residual(x, y, z, tck), registry से लेना हो तो ops3d.get("surface_residual"))
• Ledger के ज़रिए return value: fullseye.ledger.surface_residual(...) केवल घोषित out type measurement का value लौटाता है (मूल function सहायक जानकारी भी लौटाता है)। जो हिस्सा छोड़ दिया गया है उसकी ज़रूरत हो तो fullseye.ledger.surface_residual.raw(...) का उपयोग करें, या bspline_surf.surface_residual को सीधे call करें।
• मूल function का return: {"rms","max","pv"} → pv float
scattered data और surface tck के बीच residual statistics लौटाता है (form error = fit से विचलन)।
हर sample position पर surface की ऊँचाई evaluate करके observed z से अंतर का RMS / अधिकतम absolute मान / PV (peak-to-valley = अधिकतम - न्यूनतम) मापता है। inspection में यही free-form surface से विचलन (dent, waviness, सामग्री की कमी) का मात्रात्मक सूचकांक है।
dict
{"rms": float, "max": float, "pv": float}। max सबसे बड़ा absolute residual है,
pv signed residuals का अधिकतम - न्यूनतम है (केवल एक तरफ़ का उभार/गड्ढा भी पकड़ता है)।
अतिरिक्त:
• residual का sign resid = z - zhat है (observed − surface)। धनात्मक = surface से ऊँचा (उभार), ऋणात्मक = नीचा (सामग्री की कमी)। max absolute मान है इसलिए दिशा पता नहीं चलती; दिशा चाहिए तो eval_bspline_surface से zhat लेकर ख़ुद अंतर निकालें।
• x, y, z कोई भी shape लेते हैं और भीतर eval_bspline_surface(tck, x, y, grid=False) से गुज़रते हैं (tck के प्रकार की जाँच भी वहीं होती है; curve tck या polynomial dict पर ValueError)। z और x में elements की संख्या अलग हो तो numpy का shape error आता है (अलग से कोई जाँच नहीं है, और z में 1 element हो तो चुपचाप broadcast हो जाता है)।
• unit वही है जो z की है। rms सभी points का root mean square है, इसलिए local dent औसत में फीके पड़ जाते हैं। local defect max या pv से देखें।
• आम प्रयोग: fit_bspline_surface → यह op। fit में इस्तेमाल points पर evaluate करें तो smooth जितना छोटा, residual उतना 0 के क़रीब (यह overfitting का संकेतक भी बनता है)।
• Sample data catalog (DL URL / license) — 2-D के लिए skimage.data (BSD/public) + synthetic, 3-D के लिए real data sources (Stanford/PDS आदि) के DL URL।
• Operators का स्रोत और संदर्भ — इस op family के मूल research/methods के स्रोत।
• bspline_freeform — py -3.11 examples_3d/bspline_freeform.py
measurement को input के रूप में लेते हैं)vol_gaussian_psf · fuse_to_voxel · fresnel_reflectance · snell_angle
freeform)fit_bspline_surface · eval_bspline_surface · fit_bspline_curve · eval_bspline_curve
*Provenance: bspline_surf.py — 3D operator registry. यह per-op note tools/opdocs.py md से अपने-आप generate होता है (हाथ से edit न करें)।*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.