storm_kit.geom.sdf.primitives module¶
-
sdf_capsule_to_pt
(capsule_base, capsule_tip, capsule_radius, pt)[source]¶ Computes distance between a capsule and a point
- Parameters
capsule_base (tensor) – x,y,z in batch [b,3]
capsule_tip (tensor) – x,y,z in batch [b,3]
capsule_radius (tensor) – radius of capsule in batch [b,1]
pt (tensor) – query point x,y,z in batch [b,3]
- Returns
signed distance (negative outside, positive inside) [b,1]
- Return type
(tensor)
-
sdf_capsule_to_sphere
(capsule_base, capsule_tip, capsule_radius, sphere_pt, sphere_radius)[source]¶ Compute signed distance between capsule and sphere.
- Parameters
capsule_base (tensor) – x,y,z in batch [b,3]
capsule_tip (tensor) – x,y,z in batch [b,3]
capsule_radius (tensor) – radius of capsule in batch [b,1]
sphere_pt (tensor) – query sphere origin x,y,z in batch [b,3]
sphere_radius (tensor) – radius of sphere [b,1]
- Returns
signed distance (negative outside, positive inside) [b,1]
- Return type
(tensor)
-
sdf_pt_to_box
(box_dims, box_trans, box_rot, query_pts)[source]¶ signed distance between box and point. Points are assumed to be in world frame.
- Parameters
box_dims (tensor) – dx,dy,dz of box [b,3], this is around origin (-dx/2,dx/2…).
box_trans (tensor) – origin of box in the world frame [b,3].
box_rot (tensor) – rotation of box as a rotation matrix in the world frame. [b,3,3]
query_pts (tensor) – pts in world frame to query sdf. [b,3]
- Returns
signed distance (negative outside, positive inside) [b,1]
- Return type
(tensor)
-
sdf_pt_to_sphere
(sphere_pt, sphere_radius, query_pt)[source]¶ signed distance between sphere and point. Also works for 2d case.
- Parameters
sphere_pt (tensor) – origin of sphere [b,3]
sphere_radius (tensor) – radius of sphere [b,1]
query_pt (tensor) – query point [b,1]
- Returns
signed distance (negative outside, positive inside) [b,1]
- Return type
(tensor)