Computes pointarray to polygon distance.
1084 POINT3DZ p1, p2,projp1, projp2, intersectionp;
1089 &p1, plane, &projp1);
1111 f=fabs(s1)/(fabs(s1)+fabs(s2));
1115 intersectionp.
x=projp1.
x+f*projp1_projp2.
x;
1116 intersectionp.
y=projp1.
y+f*projp1_projp2.
y;
1117 intersectionp.
z=projp1.
z+f*projp1_projp2.
z;
1123 for (k=1;k<poly->
nrings; k++)
1135 dl->
p1.
x=intersectionp.
x;
1136 dl->
p1.
y=intersectionp.
y;
1137 dl->
p1.
z=intersectionp.
z;
1139 dl->
p2.
x=intersectionp.
x;
1140 dl->
p2.
y=intersectionp.
y;
1141 dl->
p2.
z=intersectionp.
z;
1154 for (j=0;j<poly->
nrings;j++)
double project_point_on_plane(POINT3DZ *p, PLANE3D *pl, POINT3DZ *p0)
Finds a point on a plane from where the original point is perpendicular to the plane.
int lw_dist3d_pt_poly(POINT3DZ *p, LWPOLY *poly, PLANE3D *plane, POINT3DZ *projp, DISTPTS3D *dl)
Checking if the point projected on the plane of the polygon actually is inside that polygon...
int getPoint3dz_p(const POINTARRAY *pa, int n, POINT3DZ *point)
Datum intersects(PG_FUNCTION_ARGS)
#define LW_TRUE
Return types for functions with status returns.
static int get_3dvector_from_points(POINT3DZ *p1, POINT3DZ *p2, VECTOR3D *v)
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, pa = vertex points of a ring V[n+1] with V[n]=V[0] plane=the plane that the vertex points are lying on returns: 0 = outside, 1 = inside
int lw_dist3d_ptarray_ptarray(POINTARRAY *l1, POINTARRAY *l2, DISTPTS3D *dl)
Finds all combinationes of segments between two pointarrays.