This topic describes the ST_RayIntersection function. This function batch calculates the intersections of sfmesh objects and rays.
Syntax
geometry ST_RayIntersection(sfmesh sfmesh, geometry mpoint, geometry direction);Return values
The MULTIPOINT objects that represent the intersections of sfmesh objects and rays are returned. If no intersection exists, EMPTY is returned.
Parameters
Parameter | Description |
sfmesh | The sfmesh model object. |
mpoint | The endpoint of the ray. |
direction | The direction of the ray. |
Description
This function batch calculates the intersection of a set of rays in the same direction and sfmesh objects.
mpoint specifies the endpoint of the ray and is of the MULTIPOINT type.
direction specifies the direction of the ray and is of the POINT type.
Examples
SELECT ST_AsText(ST_RayIntersection('POLYGON((-1 -1 0, 1 -1 0, 1 1 0, -1 1 0, -1 -1 0))'::geometry::meshgeom,
'MULTIPOINT(0 0 0, 0 1 0, 0 -1 0, 0 -2 0)'::geometry,
'POINT(0 1 0)'::geometry));
-----------------------------------------------------
MULTIPOINT Z ((0 0 0),(0 1 0),(0 -1 0),(0 -1 0))