/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . Application surfaceFeatureExtract Group grpSurfaceUtilities Description Extracts and writes surface features to file. All but the basic feature extraction is a work-in-progress. The curvature calculation is an implementation of the algorithm from: \verbatim "Estimating Curvatures and their Derivatives on Triangle Meshes" by S. Rusinkiewicz 3DPVT'04 Proceedings of the 3D Data Processing, Visualization, and Transmission, 2nd International Symposium Pages 486-493 http://gfx.cs.princeton.edu/pubs/_2004_ECA/curvpaper.pdf \endverbatim \*---------------------------------------------------------------------------*/ #include "argList.H" #include "Time.H" #include "triSurface.H" #include "surfaceFeaturesExtraction.H" #include "surfaceIntersection.H" #include "featureEdgeMesh.H" #include "extendedFeatureEdgeMesh.H" #include "treeBoundBox.H" #include "meshTools.H" #include "OFstream.H" #include "triSurfaceMesh.H" #include "vtkSurfaceWriter.H" #include "triSurfaceFields.H" #include "indexedOctree.H" #include "treeDataEdge.H" #include "unitConversion.H" #include "plane.H" #include "tensor2D.H" #include "symmTensor2D.H" #include "point.H" #include "triadField.H" #include "transform.H" #include "triSurfaceLoader.H" using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // scalar calcVertexNormalWeight ( const triFace& f, const label pI, const vector& fN, const pointField& points ) { label index = findIndex(f, pI); if (index == -1) { FatalErrorInFunction << "Point not in face" << abort(FatalError); } const vector e1 = points[f[index]] - points[f[f.fcIndex(index)]]; const vector e2 = points[f[index]] - points[f[f.rcIndex(index)]]; return mag(fN)/(magSqr(e1)*magSqr(e2) + VSMALL); } triadField calcVertexCoordSys ( const triSurface& surf, const vectorField& pointNormals ) { const pointField& points = surf.points(); const Map