pointcloudset.geometry.plane module¶
Utility functions for geometric calculations with planes.
- pointcloudset.geometry.plane.distance_to_point(point_a: ndarray, plane_model: ndarray, normal_dist: bool = True) float ¶
Calculate the distance from a plane to a point. https://mathworld.wolfram.com/Point-PlaneDistance.html
Note
Uses the plane equation a x + b y + c z + d = 0.
- Parameters
point_a (numpy.ndarray) – [x, y, z], point for which the distance is calculated to plane.
plane_model (numpy.ndarray) – [a, b, c, d] parameters of the plane equation, could be provided by
pointcloudset.pointcloud.PointCloud.plane_segmentation()
.normal_dist (bool) – Calculate normal distance if
True
, calculate distance in direction of line of sight ifFalse
. Defaults toTrue
.
- Returns
Distance between plane and point.
- Return type
- Raises
ValueError – If point does not have 3 values or if plane does not have 4 values.
- pointcloudset.geometry.plane.intersect_line_of_sight(line: ndarray, plane_model: ndarray) ndarray ¶
Calculate the point of intersection between a line and a plane.
Note
Uses the plane equation a x + b y + c z + d = 0.
- Parameters
line (numpy.ndarray) – [lx, ly, lz], line of sight through origin and point (lx,ly,lz).
plane_model (numpy.ndarray) – [a, b, c, d] parameters of the plane equation, could be provided by
pointcloudset.pointcloud.PointCloud.plane_segmentation()
.
- Returns
[px, py, pz], point of intersection of line of sight and plane.
- Return type
- Raises
ValueError – If line does not have 3 values or if plane does not have 4 values.