MCPcopy Create free account
hub / github.com/TCXX/ObjaversePlusPlus / sample_spherical

Function sample_spherical

annotation_model/persistent_blender_script.py:155–163  ·  view source on GitHub ↗
(radius=3.0, maxz=3.0, minz=0.0)

Source from the content-addressed store, hash-verified

153
154
155def sample_spherical(radius=3.0, maxz=3.0, minz=0.0):
156 correct = False
157 while not correct:
158 vec = np.random.uniform(-1, 1, 3)
159 vec[2] = np.abs(vec[2])
160 vec = vec / np.linalg.norm(vec, axis=0) * radius
161 if maxz > vec[2] > minz:
162 correct = True
163 return vec
164
165
166# def sample_spherical(radius_min=1.5, radius_max=2.0, maxz=1.6, minz=-0.75):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected