diff --git a/preprocess.c b/preprocess.c index 5b07097c..734f7fb3 100644 --- a/preprocess.c +++ b/preprocess.c @@ -358,18 +358,14 @@ void process_horizontal_faces(int **intersections, pt holds coordinates to intersection between lines given by point numbers L[0]-L[1] and L[2]-L[3]. */ -#define OLD_INTERSECTION 0 static void approximate_intersection_pt(int *L, double *c, double *pt) { double a; double z0, z1, z2, z3; -#if OLD_INTERSECTION -#else double b1, b2; double x1, y1; double x2, y2; double z; -#endif /* no intersection on pillars expected here! */ assert(L[0]!=L[2]); @@ -387,12 +383,6 @@ static void approximate_intersection_pt(int *L, double *c, double *pt) a = 0; } - -#if OLD_INTERSECTION - pt[0] = c[3*L[0]+0]* (1.0-a) + c[3*L[1]+0]* a; - pt[1] = c[3*L[0]+1]* (1.0-a) + c[3*L[1]+1]* a; - pt[2] = c[3*L[0]+2]* (1.0-a) + c[3*L[1]+2]* a; -#else /* the corresponding z-coordinate is */ z = z0* (1.0-a) + z1* a; @@ -409,14 +399,14 @@ static void approximate_intersection_pt(int *L, double *c, double *pt) b2 = (z1-z)/(z1-z3); x2 = c[3*L[1]+0]*b1 + c[3*L[3]+0]*b2; y2 = c[3*L[1]+1]*b1 + c[3*L[3]+1]*b2; - + /* horizontal lines are by definition ON the bilinear surface spanned by L0, L1, L2 and L3. find point (x, y, z) on horizontal line between point (x1, y1, z) and (x2, y2, z).*/ pt[0] = x1* (1.0-a) + x2* a; pt[1] = y1* (1.0-a) + y2* a; pt[2] = z; -#endif + } /*-----------------------------------------------------------------