Skip to content

Commit

Permalink
ENH: Signed distance, inside negative, outside positive
Browse files Browse the repository at this point in the history
The signed distance should be negative inside an object and positive
outside an object.
  • Loading branch information
lorensen committed Jan 19, 2017
1 parent a1e7fab commit 66eb8ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Filters/Points/vtkSignedDistance.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct SignedDistance
{
p = this->Pts + 3*pIds->GetId(ii);
n = this->Normals + 3*pIds->GetId(ii);
dist += n[0]*(x[0]-p[0]) + n[1]*(x[1]-p[1]) + n[2]*(x[2]-p[2]);
dist += n[0]*(p[0]-x[0]) + n[1]*(p[1]-x[1]) + n[2]*(p[2]-x[2]);
}
this->Scalars[ptId] = dist / static_cast<double>(numPts);
}//if nearby points
Expand Down

0 comments on commit 66eb8ef

Please sign in to comment.