1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Set normal consistent with respect to a user provided 'outside' point.
27 If -inside the point is considered inside.
29 \*---------------------------------------------------------------------------*/
32 #include "orientedSurface.H"
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 int main(int argc, char *argv[])
43 argList::noParallel();
44 argList::validArgs.clear();
45 argList::validArgs.append("Foam surface file");
46 argList::validArgs.append("visiblePoint");
47 argList::validArgs.append("output file");
48 argList::validOptions.insert("inside", "");
49 argList args(argc, argv);
51 fileName surfFileName(args.additionalArgs()[0]);
52 Info<< "Reading surface from " << surfFileName << endl;
54 point visiblePoint(IStringStream(args.additionalArgs()[1])());
55 Info<< "Visible point " << visiblePoint << endl;
57 bool orientInside = args.optionFound("inside");
61 Info<< "Orienting surface such that visiblePoint " << visiblePoint
62 << " is inside" << endl;
66 Info<< "Orienting surface such that visiblePoint " << visiblePoint
67 << " is outside" << endl;
70 fileName outFileName(args.additionalArgs()[2]);
71 Info<< "Writing surface to " << outFileName << endl;
75 triSurface surf(surfFileName);
77 //orientedSurface normalSurf(surf, visiblePoint, !orientInside);
78 bool anyFlipped = orientedSurface::orient
87 Info<< "Flipped orientation of (part of) surface." << endl;
91 Info<< "Did not flip orientation of any triangle of surface." << endl;
94 Info<< "Writing new surface to " << outFileName << endl;
96 surf.write(outFileName);
98 Info << "End\n" << endl;
104 // ************************************************************************* //