Skip to main content

raygeo.geo.shape.point

Individual point operations.

Provides equality testing within a configurable tolerance, midpoint computation between two points, and applying a 4x4 affine transformation matrix to a single point.

Functions

are_points_equal()

are_points_equal(p1: types.Point3D, p2: types.Point3D, tolerance: float) -> bool

Check if two 3D points are equal within tolerance.

Returns: True if points are equal within tolerance.

ParameterTypeDescription
p1types.Point3DFirst point (x, y, z).
p2types.Point3DSecond point (x, y, z).
tolerancefloatMaximum allowed difference.
Returnsbool

midpoint()

midpoint(p1: types.Point3D, p2: types.Point3D) -> types.Point3D

Get the midpoint between two 3D points.

Returns: Midpoint (x, y, z).

ParameterTypeDescription
p1types.Point3DFirst point (x, y, z).
p2types.Point3DSecond point (x, y, z).
Returnstypes.Point3D

transform_point()

transform_point(matrix: collections.abc.Sequence[collections.abc.Sequence[float]], x: float, y: float, z: float) -> types.Point3D

Apply an affine transformation matrix to a 3D point.

Returns: Transformed point (x, y, z).

ParameterTypeDescription
matrixcollections.abc.Sequence[collections.abc.Sequence[float]]4x4 affine transformation matrix.
xfloatX coordinate.
yfloatY coordinate.
zfloatZ coordinate.
Returnstypes.Point3D