Skip to content
Snippets Groups Projects
Commit ea570ad2 authored by mattijs's avatar mattijs
Browse files

ENH: surfaceFeatureExtract: disabled curvature calculation (only CGAL dependency)

parent 70b48f33
No related branches found
No related tags found
No related merge requests found
surfaceFeatureExtract.C surfaceFeatureExtract.C
CGALPolyhedron/buildCGALPolyhedron.C /* CGALPolyhedron/buildCGALPolyhedron.C */
EXE = $(FOAM_APPBIN)/surfaceFeatureExtract EXE = $(FOAM_APPBIN)/surfaceFeatureExtract
#if false
EXE_FROUNDING_MATH = -frounding-math EXE_FROUNDING_MATH = -frounding-math
EXE_NDEBUG = -DNDEBUG EXE_NDEBUG = -DNDEBUG
USE_F2C = -DCGAL_USE_F2C USE_F2C = -DCGAL_USE_F2C
include $(GENERAL_RULES)/CGAL include $(GENERAL_RULES)/CGAL
EXE_INC = \ EXE_INC = \
-DENABLE_CURVATURE \
${EXE_FROUNDING_MATH} \ ${EXE_FROUNDING_MATH} \
${EXE_NDEBUG} \ ${EXE_NDEBUG} \
${USE_F2C} \ ${USE_F2C} \
...@@ -27,3 +29,21 @@ EXE_LIBS = \ ...@@ -27,3 +29,21 @@ EXE_LIBS = \
-ledgeMesh \ -ledgeMesh \
-ltriSurface \ -ltriSurface \
-lsampling -lsampling
#else
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/edgeMesh/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-lmeshTools \
-ledgeMesh \
-ltriSurface \
-lsampling
#endif
...@@ -29,11 +29,9 @@ Description ...@@ -29,11 +29,9 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "triangle.H"
#include "triSurface.H"
#include "argList.H" #include "argList.H"
#include "Time.H" #include "Time.H"
#include "triSurface.H"
#include "surfaceFeatures.H" #include "surfaceFeatures.H"
#include "featureEdgeMesh.H" #include "featureEdgeMesh.H"
#include "extendedFeatureEdgeMesh.H" #include "extendedFeatureEdgeMesh.H"
...@@ -43,16 +41,17 @@ Description ...@@ -43,16 +41,17 @@ Description
#include "triSurfaceMesh.H" #include "triSurfaceMesh.H"
#include "vtkSurfaceWriter.H" #include "vtkSurfaceWriter.H"
#include "triSurfaceFields.H" #include "triSurfaceFields.H"
#include "unitConversion.H"
#include "indexedOctree.H" #include "indexedOctree.H"
#include "treeDataEdge.H" #include "treeDataEdge.H"
#include "unitConversion.H" #include "unitConversion.H"
#ifdef ENABLE_CURVATURE
#include "buildCGALPolyhedron.H" #include "buildCGALPolyhedron.H"
#include "CGALPolyhedronRings.H" #include "CGALPolyhedronRings.H"
#include <CGAL/Monge_via_jet_fitting.h> #include <CGAL/Monge_via_jet_fitting.h>
#include <CGAL/Lapack/Linear_algebra_lapack.h> #include <CGAL/Lapack/Linear_algebra_lapack.h>
#include <CGAL/property_map.h> #include <CGAL/property_map.h>
#endif
using namespace Foam; using namespace Foam;
...@@ -150,6 +149,7 @@ void drawHitProblem ...@@ -150,6 +149,7 @@ void drawHitProblem
} }
#ifdef ENABLE_CURVATURE
scalarField calcCurvature(const triSurface& surf) scalarField calcCurvature(const triSurface& surf)
{ {
scalarField k(surf.points().size(), 0); scalarField k(surf.points().size(), 0);
...@@ -296,7 +296,7 @@ scalarField calcCurvature(const triSurface& surf) ...@@ -296,7 +296,7 @@ scalarField calcCurvature(const triSurface& surf)
return k; return k;
} }
#endif
// Unmark non-manifold edges if individual triangles are not features // Unmark non-manifold edges if individual triangles are not features
void unmarkBaffles void unmarkBaffles
...@@ -405,11 +405,6 @@ int main(int argc, char *argv[]) ...@@ -405,11 +405,6 @@ int main(int argc, char *argv[])
"writeVTK", "writeVTK",
"write extendedFeatureEdgeMesh vtk files" "write extendedFeatureEdgeMesh vtk files"
); );
argList::addBoolOption
(
"calcCurvature",
"calculate curvature and closeness fields"
);
argList::addOption argList::addOption
( (
"closeness", "closeness",
...@@ -433,6 +428,14 @@ int main(int argc, char *argv[]) ...@@ -433,6 +428,14 @@ int main(int argc, char *argv[])
"remove any non-manifold (open or more than two connected faces) edges" "remove any non-manifold (open or more than two connected faces) edges"
); );
# ifdef ENABLE_CURVATURE
argList::addBoolOption
(
"calcCurvature",
"calculate curvature and closeness fields"
);
# endif
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
...@@ -955,6 +958,8 @@ int main(int argc, char *argv[]) ...@@ -955,6 +958,8 @@ int main(int argc, char *argv[])
externalClosenessField.write(); externalClosenessField.write();
#ifdef ENABLE_CURVATURE
scalarField k = calcCurvature(surf); scalarField k = calcCurvature(surf);
// Modify the curvature values on feature edges and points to be zero. // Modify the curvature values on feature edges and points to be zero.
...@@ -984,6 +989,7 @@ int main(int argc, char *argv[]) ...@@ -984,6 +989,7 @@ int main(int argc, char *argv[])
); );
kField.write(); kField.write();
#endif
if (writeVTK) if (writeVTK)
{ {
...@@ -1011,6 +1017,7 @@ int main(int argc, char *argv[]) ...@@ -1011,6 +1017,7 @@ int main(int argc, char *argv[])
true // verbose true // verbose
); );
# ifdef ENABLE_CURVATURE
vtkSurfaceWriter().write vtkSurfaceWriter().write
( (
runTime.constant()/"triSurface", // outputDir runTime.constant()/"triSurface", // outputDir
...@@ -1022,6 +1029,7 @@ int main(int argc, char *argv[]) ...@@ -1022,6 +1029,7 @@ int main(int argc, char *argv[])
true, // isNodeValues true, // isNodeValues
true // verbose true // verbose
); );
# endif
} }
Info<< "End\n" << endl; Info<< "End\n" << endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment