🟠 Calculate Size by Distance from Center to Lines

Function Description

The operator calculates bounding box length and width through geometric methods.

Its core logic is:

  1. First, calculate a center point based on a given main point cloud.

  2. Then, calculate the perpendicular distance from this center point to the four input lines.

  3. Finally, the operator assumes these four lines form the four edges of a rectangle, and obtains the length and width of the rectangle by adding opposite distances (i.e., adding the two largest distances and adding the two smallest distances).

Usage Scenarios

Mainly applied to scenarios where bounding box calculation of point cloud outer bounding box has deviations, to obtain more precise bounding box edge lengths.

Input Output

Input

Point cloud: Point cloud used to calculate the center point.

Line equation parameter list: A list containing four line models.

Line point cloud: A point cloud list containing all points on the four lines. This input is only required when the parameter distance calculation method is set to "Calculate height using triangle area and perimeter".

Output

Bounding box size: Outputs a list containing two elements [Size1, Size2], representing the calculated bounding box length and width.

Parameter Description

This operator has two versions:

  • Calculate Size by Distance from Center to Lines: Processes point clouds without normal information.

  • Calculate Size by Distance from Center to Lines (with normals): Processes point clouds with normal information.

Both have identical core functionality and parameters, differing only in the type of point cloud data they process.

Center Point Type

Parameter Description

Defines the method for calculating the center point from the input "point cloud".

Parameter Adjustment

  • Point cloud mean: Take the average of the three-dimensional coordinates of all points in the point cloud to get the center point. This method is fast to compute and suitable for scenarios where point cloud distribution is relatively uniform with less noise.

  • Point cloud median: Take the median of the three-dimensional coordinates of all points in the point cloud to get the center point. This method is insensitive to outliers or sparse noise. When there are abnormal points in the point cloud that may affect mean calculation, using median will be more robust.

Distance Calculation Method

Parameter Description

Defines the mathematical method used to calculate the distance from the center point to each line.

Parameter Adjustment

  • Point to line distance: Uses the standard three-dimensional space point-to-line distance formula for calculation. Uses the input "Line equation parameter list" for calculation, which is more accurate and is the preferred choice under normal circumstances, but it depends on the accuracy of line fitting.

  • Calculate height using triangle area and perimeter: This method requires "Line point cloud" input. It forms a triangle with the center point and the two endpoints of actual point clouds on each line, then calculates the triangle’s area and base length through Heron’s formula, and inversely calculates the triangle’s height as the point-to-line distance. This method can be tried when line equations are not very precise or when the distance between two line points is short.