From d8a91260c127308d7c8a79e64fe23c7236fe1ae1 Mon Sep 17 00:00:00 2001 From: laurence Date: Thu, 11 Apr 2013 20:05:54 +0100 Subject: [PATCH] ENH: test for side of plane a point is on --- src/OpenFOAM/meshes/primitiveShapes/plane/plane.C | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C index c191f44c3e..410b20b387 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C +++ b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -439,6 +439,14 @@ Foam::point Foam::plane::planePlaneIntersect } +Foam::plane::side Foam::plane::sideOfPlane(const point& p) const +{ + const scalar angle((p - basePoint_) & unitVector_); + + return (angle < 0 ? FLIP : NORMAL); +} + + void Foam::plane::writeDict(Ostream& os) const { os.writeKeyword("planeType") << "pointAndNormal"