Skip to content

geometry_utils.py

Andrew Edgley edited this page Feb 21, 2023 · 2 revisions

Contains general functions that are mainly used for geometry.

translation_and_rotation()

Arguments:

  • transform_matrix [16]
    • A list of 16 floats that represent a flattened 4x4 transform matrix

Returns: 2-tuple ([x,y,z] [w,x,y,z]) that represents the translation vector and rotation quaternion

is_overlapping()

Arguments:

  • box1 {dict}
    • Specifies a dictionary object for the first box being compared.
    • Dictionary should have keys: "origin" and "size"
  • box2 {dict}
    • Specifies a dictionary object for the second box being compared.
    • Dictionary should have keys: "origin" and "size"

Returns: True if the axis aligned representation of boxes overlap. False otherwise

This function is used to test whether two axis aligned 3D boxes overlap.

box_dist()

Arguments:

  • box1 {dict}
    • Specifies a dictionary object for the first box being compared.
    • Dictionary should have keys: "origin"
  • box2 {dict}
    • Specifies a dictionary object for the second box being compared.
    • Dictionary should have keys: "origin"

Returns: representing the distance between the origins of two boxes

This function is used to get the distance between the origins of two boxes

compute_vertices()

Arguments:

  • box {dict}
    • A dictionary representing the particular bounding box

Returns: numpy.array[numpy.float64[3,1]]

Returns any array of x,y,z coordinates for all 8 vertices that make up the bounding box.

compute_interior_points()

Arguments:

  • box {dict}
    • Represents a dictionary object that contains the information for the current annotation
  • point_cloud {numpy.array[numpy.float64[3, 1]]}
    • An array representing the points in the current point cloud

Returns:

Calculates the number of points in the point cloud that are bounded by the input bounding box.