1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 Various triangle functions.
33 \*---------------------------------------------------------------------------*/
35 #ifndef triangleFuncs_H
36 #define triangleFuncs_H
41 #include "pointField.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 // Forward declaration of classes
51 /*---------------------------------------------------------------------------*\
52 Class triangleFuncs Declaration
53 \*---------------------------------------------------------------------------*/
62 //- Enumeration defining nearness classification
73 // Private Member Functions
75 //- Helper function for intersect. Sets pt to be anywhere on the edge
76 // between oppositeSidePt and thisSidePt depending on both signs.
77 static void setIntersection
79 const point& oppositeSidePt,
80 const scalar oppositeSign,
81 const point& thisSidePt,
82 const scalar thisSign,
98 //- Intersect triangle with parallel edges aligned with axis i0.
99 // Returns true (and intersection in pInter) if any of them intersects
100 // triangle. Used in intersectBb.
101 static bool intersectAxesBundle
107 const pointField& origin,
108 const scalar maxLength,
112 //- Does triangle intersect bounding box.
113 static bool intersectBb
118 const treeBoundBox& cubeBb
121 //- Does triangle intersect plane. Return bool and set intersection segment.
122 static bool intersect
128 const point& basePoint,
129 const vector& normal,
135 //- Do triangles intersect. Return bool and set intersection segment.
136 static bool intersect
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 } // End namespace Foam
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 // ************************************************************************* //