min_enclosing_sphere — 3D bounds op

• Data kinds: points → primitive

• Call: import fullseye as fs; fs.ledger.min_enclosing_sphere(points, refine_iters: 'int' = 1000) -> 'Dict[str, object]' (implementation को सीधे call करना हो तो import hull3d; hull3d.min_enclosing_sphere(points, refine_iters: 'int' = 1000) -> 'Dict[str, object]', registry से लेना हो तो ops3d.get("min_enclosing_sphere"))

उपयोग

point cloud (N,3) → सभी points को समेटने वाला (approximate) minimum enclosing sphere {center(3), radius}।

fit_sphere_3d (sphere fitting) या ransac_sphere / hough_sphere_3d (sphere detection) से अलग, यह सभी points को समाहित करने वाला सबसे छोटा sphere (minimum enclosing ball, MEB) हल करता है। 2 चरणों की रचना से "सभी points समाहित" की शर्त को सख़्ती से निभाते हुए radius को कसा जाता है:

1. Ritter (1990) initialization -- सबसे दूर के point pair को मोटे तौर पर लेकर initial sphere बनाया जाता है, फिर हर point को scan करते हुए यदि कोई point sphere के बाहर हो तो sphere को 1 बार "उस point और मौजूदा sphere दोनों को समाहित करने वाले" सबसे छोटे sphere तक फैलाया जाता है (growth formula new_r=(r+d)/2 / center को point की दिशा में (d-r)/(2d) आगे बढ़ाना)। नया sphere पुराने को पूरी तरह समाहित करता है, इसलिए 1 pass में ही सभी points के समाहित होने की गारंटी मिलती है।

2. Bădoiu–Clarkson (2003) core-set iteration से refinement -- iteration i में center को सबसे दूर के point q की ओर 1/(i+2) खिसकाया जाता है। यह सच्चे minimum enclosing sphere की ओर monotonic रूप से converge करता है (बहुत बड़े radius वाले Ritter के drift को कसता है)। अंत में radius "center से अधिकतम दूरी" से तय होता है, इसलिए refinement के बाद भी सभी points हमेशा समाहित रहते हैं (approximation के कारण radius कभी इतना छोटा नहीं होता कि points बाहर छूट जाएँ, सुरक्षित पक्ष)।

refined center तभी अपनाया जाता है जब वह Ritter की तुलना में circumscribed radius को घटा सके (हमेशा Ritter से कम या बराबर)। यह सच्चा minimum sphere नहीं है (exact हल Welzl की randomized linear-time विधि है), बल्कि तेज़ (1+ε) approximation है।

Parameters

points : array_like (N,3)

input point cloud (>= 1 point)।

refine_iters : int

Bădoiu–Clarkson refinement के iterations की संख्या (default 1000)। 0 पर केवल Ritter।

Returns

dict

• center: (3,) float64 -- sphere का center (world coordinates)।

• radius: float -- radius (सभी points समाहित)।

Raises

ValueError

shape अमान्य, non-finite, points की संख्या 0, या refine_iters negative होने पर (fail-closed)।

पृष्ठभूमि guides (इस op के पीछे की physics और conventions)

• blender_interop — Blender के साथ उपयोग — shape बनाएँ, fullseye से मापें (सावधानियाँ: axes, units, ground truth)

संदर्भ (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 करते हैं)

• hull_bounds — py -3.11 examples_3d/hull_bounds.py

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

fuse_to_voxel · angle_between_lines · angle_between_planes · angle_line_plane · distance_point_plane · distance_point_line · distance_line_line · distance_segment_segment

इसी category के (bounds)

convex_hull · aabb · obb


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

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