Commit 43705d78 authored by mattijs's avatar mattijs
Browse files

use average when merging points to prevent truncation error

parent d8c44047
......@@ -45,9 +45,19 @@ bool Foam::matchPoints
bool fullMatch = true;
SortableList<scalar> pts0MagSqr(magSqr(pts0 - origin));
point compareOrigin = origin;
SortableList<scalar> pts1MagSqr(magSqr(pts1 - origin));
if (origin == point(VGREAT, VGREAT, VGREAT))
{
if (pts1.size() > 0)
{
compareOrigin = sum(pts1)/pts1.size();
}
}
SortableList<scalar> pts0MagSqr(magSqr(pts0 - compareOrigin));
SortableList<scalar> pts1MagSqr(magSqr(pts1 - compareOrigin));
forAll(pts0MagSqr, i)
{
......
Supports Markdown
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