PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ lw_dist3d_pt_tri()

int lw_dist3d_pt_tri ( const POINT3DZ p,
const LWTRIANGLE tri,
PLANE3D plane,
POINT3DZ projp,
DISTPTS3D dl 
)

Definition at line 1317 of file measures3d.c.

1318 {
1319  if (pt_in_ring_3d(projp, tri->points, plane))
1320  /* if the projected point is inside the polygon the shortest distance is between that point and the
1321  * input point */
1322  return lw_dist3d_pt_pt(p, projp, dl);
1323  else
1324  /* if the projected point is outside the polygon we search for the closest distance against the boundary
1325  * instead */
1326  return lw_dist3d_pt_ptarray(p, tri->points, dl);
1327 
1328  return LW_TRUE;
1329 }
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:93
int pt_in_ring_3d(const POINT3DZ *p, const POINTARRAY *ring, PLANE3D *plane)
pt_in_ring_3d(): crossing number test for a point in a polygon input: p = a point,...
Definition: measures3d.c:1573
int lw_dist3d_pt_pt(const POINT3DZ *thep1, const POINT3DZ *thep2, DISTPTS3D *dl)
Compares incoming points and stores the points closest to each other or most far away from each other...
Definition: measures3d.c:1082
int lw_dist3d_pt_ptarray(const POINT3DZ *p, const POINTARRAY *pa, DISTPTS3D *dl)
search all the segments of pointarray to see which one is closest to p Returns distance between point...
Definition: measures3d.c:996
POINTARRAY * points
Definition: liblwgeom.h:495

References lw_dist3d_pt_pt(), lw_dist3d_pt_ptarray(), LW_TRUE, LWTRIANGLE::points, and pt_in_ring_3d().

Referenced by lw_dist3d_point_tri(), and lw_dist3d_ptarray_tri().

Here is the call graph for this function:
Here is the caller graph for this function: