From b6362495d8c54fb08c1388f7394fdf3cd1c92a72 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Tue, 12 Oct 2010 12:49:44 +0200 Subject: [PATCH] operator: fix in PEC curves Operator::FindPath method is not optimal yet, will find weird pathes in some occasions, at least they will be closed now... hopefully :) Signed-off-by: Thorsten Liebig --- FDTD/operator.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/FDTD/operator.cpp b/FDTD/operator.cpp index 99459de..dfe7687 100644 --- a/FDTD/operator.cpp +++ b/FDTD/operator.cpp @@ -265,6 +265,27 @@ struct Operator::Grid_Path Operator::FindPath(double start[], double stop[]) currFoot=minFoot; path.dir.push_back(minDir); } + + //close missing edges, if currPos is not equal to uiStopPos + for (int n=0;n<3;++n) + { + if (currPos[n]>uiStop[n]) + { + --currPos[n]; + path.posPath[0].push_back(currPos[0]); + path.posPath[1].push_back(currPos[1]); + path.posPath[2].push_back(currPos[2]); + path.dir.push_back(n); + } + else if (currPos[n]