From 6543a3850617f97f2a5392a8d450362b782beca5 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs@hunt.opencfd.co.uk>
Date: Mon, 20 Apr 2009 17:50:06 +0100
Subject: [PATCH] fix walking using edges

---
 .../triSurface/orientedSurface/orientedSurface.C         | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/meshTools/triSurface/orientedSurface/orientedSurface.C b/src/meshTools/triSurface/orientedSurface/orientedSurface.C
index 113bdf58f4b..f4c165d83f4 100644
--- a/src/meshTools/triSurface/orientedSurface/orientedSurface.C
+++ b/src/meshTools/triSurface/orientedSurface/orientedSurface.C
@@ -121,8 +121,8 @@ Foam::labelList Foam::orientedSurface::edgeToFace
             label face0 = eFaces[0];
             label face1 = eFaces[1];
 
-            const labelledTri& f0 = s[face0];
-            const labelledTri& f1 = s[face1];
+            const labelledTri& f0 = s.localFaces()[face0];
+            const labelledTri& f1 = s.localFaces()[face1];
 
             if (flip[face0] == UNVISITED)
             {
@@ -349,7 +349,10 @@ Foam::orientedSurface::orientedSurface
 :
     triSurface(surf)
 {
-    point outsidePoint = 2 * treeBoundBox(localPoints()).span();
+    // BoundBox calculation without localPoints
+    treeBoundBox bb(surf.points(), surf.meshPoints());
+
+    point outsidePoint = bb.max() + bb.span();
 
     orient(*this, outsidePoint, orientOutside);
 }
-- 
GitLab