curvature_torsion — 3D curve op

• Data kinds: points → pairs

• Call: import fullseye as fs; fs.ledger.curvature_torsion(curve) (implementation को सीधे call करना हो तो import curve3d; curve3d.curvature_torsion(curve), registry से लेना हो तो ops3d.get("curvature_torsion"))

• Ledger के ज़रिए return value: fullseye.ledger.curvature_torsion(...) केवल घोषित out type pairs का value लौटाता है (मूल function सहायक जानकारी भी लौटाता है)। जो हिस्सा छोड़ दिया गया है उसकी ज़रूरत हो तो fullseye.ledger.curvature_torsion.raw(...) का उपयोग करें, या curve3d.curvature_torsion को सीधे call करें।

• मूल function का return: (kappa,tau) → (N,2) pairs

उपयोग

हर point का curvature κ और torsion τ (reparameterisation-invariant closed form)। → (kappa (N,), tau (N,))।

coordinates के uniform scale s पर κ→κ/s और τ→τ/s सही ढंग से scale होते हैं। 0 से भाग रोकने वाले epsilon को relative बनाया जाता है: absolute 1e-12 छोटे coordinate scale पर cross_norm² (~s⁴) और r1_norm³ (~s³) पर हावी होकर κ/τ को नष्ट कर देता है, इसलिए representative scale L=median‖r'‖ (coordinate scale s में linear) से हर denominator के समान dimension में normalise किया गया relative eps उपयोग होता है। यह curve को L से normalise करके गणना करने और 1/L से वापस लाने के बिल्कुल बराबर है।

गणना में ordered point sequence (N,3) पर index को parameter मानकर np.gradient 3 बार (central difference, दोनों सिरों पर one-sided difference) लगाकर मिले r', r'', r''' से

• κ = ‖r'×r''‖ / ‖r'‖³

• τ = (r'×r'')·r''' / ‖r'×r''‖²

निकाले जाते हैं। κ और τ दोनों की unit 1/coordinate unit है। τ का sign right-handed helix (a cosθ, a sinθ, bθ), b>0 के लिए धनात्मक है। सीधे हिस्सों (‖r'×r''‖≈0) में κ≈0 होता है, और τ का denominator केवल eps रह जाने से उसका मान भरोसेमंद नहीं।

• ValueError: जब सभी points एक ही जगह हों और median‖r'‖ 0 या non-finite हो।

• जहाँ points का अंतराल अचानक बदलता है वहाँ numerical derivative बिगड़ता है, इसलिए पहले resample_uniform से अंतराल समान करें या fit_spline_curve से smooth करके दें। दोनों सिरों के 2 points one-sided difference के कारण कम सटीक होते हैं।

• N<2 पर np.gradient ValueError देता है। shape (N,3) की जाँच नहीं होती।

frame (T,N,B) चाहिए तो frenet_frame, और arc length ds arc_length से लें।

संदर्भ (sample data, साहित्य)

• 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 के स्रोत।

चलाए जा सकने वाले उदाहरण (verified samples जो सच में यह op call करते हैं)

• space_curve — py -3.11 examples_3d/space_curve.py

• torus_knot_curve — py -3.11 examples_3d/torus_knot_curve.py

वे अगले ops जिनसे type जुड़ता है (pairs को input के रूप में लेते हैं)

fuse_to_voxel

इसी category के (curve)

frenet_frame · arc_length · resample_uniform · fit_spline_curve


*Provenance: curve3d.py — 3D operator registry. यह per-op note tools/opdocs.py md से अपने-आप generate होता है (हाथ से edit न करें)।*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.