skrobot.sdf.SphereSDF¶
- class skrobot.sdf.SphereSDF(origin, radius, coords=None, use_abs=False)[source]¶
SDF for a sphere specified by origin and radius.
Methods
- __call__(points_obj)[source]¶
Compute signed distances of input points to the implicit surface.
- Parameters:
points_obj (numpy.ndarray[float](n_point, 3)) – 2 dim point array w.r.t. object coordinate.
- Returns:
signed_distances – 1 dim (n_point,) array of signed distance.
- Return type:
- on_surface(points_obj)[source]¶
Check if points are on the surface.
- Parameters:
points_obj (numpy.ndarray[float](n_point, 3)) – 2 dim point array w.r.t. an object coordinate.
- Returns:
logicals (numpy.ndarray[bool](n_point,)) – boolean vector of the on-surface predicate for points_obj.
sd_vals (numpy.ndarray[float](n_point,)) – signed distances corresponding to logicals.
- surface_points(n_sample=1000)[source]¶
Sample points from the implicit surface of the sdf.
- Parameters:
n_sample (int) – number of sample points.
- Returns:
points_obj (numpy.ndarray[float](n_point, 3)) – sampled points w.r.t object coordinate.
dists (numpy.ndarray[float](n_point,)) – signed distances corresponding to points_obj.
- __eq__(value, /)¶
Return self==value.
- __ne__(value, /)¶
Return self!=value.
- __lt__(value, /)¶
Return self<value.
- __le__(value, /)¶
Return self<=value.
- __gt__(value, /)¶
Return self>value.
- __ge__(value, /)¶
Return self>=value.