Commit 2704cf30 authored by Andrew Bauer's avatar Andrew Bauer
Browse files

Fixing the interior check tolerance for the apex of vtkPyramid.

I was using a tolerance of 0.001 near the apex of the pyramid
relative to a distance squared for the interior check but elsewhere
I was doing a tolerance of 0.001 for the absolute value of
the distance so I squared the 0.001 tolerance to be consistent
with the interior check for the other parts of the cell.
Note that due to the degenerate nature of the pyramid cell we
do a specialized interior check near the apex.
Thanks to Kathleen S. Biagas for the bug report and fix.

Change-Id: I7580fa04539b159ceac12385e2ac3d795906dc01
parent c6195a3a
......@@ -91,8 +91,9 @@ int vtkPyramid::EvaluatePosition(double x[3], double closestPoint[3],
double length2 = vtkMath::Distance2BetweenPoints(apexPoint, baseMidpoint);
// we use .001 as the relative tolerance here since that is the same
// that is used for the interior cell check below.
if(dist2 == 0. || ( length2 != 0. && dist2/length2 < .001) )
// that is used for the interior cell check below but we need to
// square it here because we're looking at dist2^2.
if(dist2 == 0. || ( length2 != 0. && dist2/length2 < 1.e-6) )
pcoords[0] = pcoords[1] = .5;
pcoords[2] = 1;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment