diff --git a/applications/test/surfaceIntersection/Make/options b/applications/test/surfaceIntersection/Make/options index 6ae6c04df1..b7fa8b2326 100644 --- a/applications/test/surfaceIntersection/Make/options +++ b/applications/test/surfaceIntersection/Make/options @@ -1,9 +1,7 @@ EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/edgeMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude EXE_LIBS = \ - -lfiniteVolume \ - -lmeshTools -ledgeMesh + -lmeshTools diff --git a/applications/test/surfaceIntersection/Test-surfaceIntersection.C b/applications/test/surfaceIntersection/Test-surfaceIntersection.C index 8c0f83f641..ddf122f60a 100644 --- a/applications/test/surfaceIntersection/Test-surfaceIntersection.C +++ b/applications/test/surfaceIntersection/Test-surfaceIntersection.C @@ -34,7 +34,7 @@ Description #include "triSurface.H" #include "triSurfaceMesh.H" #include "surfaceIntersection.H" -#include "OFstream.H" +#include "OBJstream.H" using namespace Foam; @@ -172,7 +172,7 @@ int main(int argc, char *argv[]) { Info<< "surf1-cuts: " << cuts.surf1EdgeCuts() << nl << "surf2-cuts: " << cuts.surf2EdgeCuts() << nl - << "face-pairs: " << cuts.facePairToEdge() << nl + << "face-pairs: " << cuts.facePairToEdgeId() << nl << "edges: " << cuts.cutEdges() << nl; } @@ -198,7 +198,7 @@ int main(int argc, char *argv[]) { Info<< "surf1-cuts: " << cuts.surf1EdgeCuts() << nl << "surf2-cuts: " << cuts.surf2EdgeCuts() << nl - << "face-pairs: " << cuts.facePairToEdge() << nl + << "face-pairs: " << cuts.facePairToEdgeId() << nl << "edges: " << cuts.cutEdges() << nl; } } @@ -209,20 +209,7 @@ int main(int argc, char *argv[]) if (points.size() || edges.size()) { Info<<"write to " << outputFile << nl; - - OFstream os(outputFile); - - forAll(points, pointi) - { - const point& pt = points[pointi]; - os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl; - } - - forAll(edges, edgei) - { - const edge& e = edges[edgei]; - os << "l " << e.start()+1 << ' ' << e.end()+1 << nl; - } + OBJstream(outputFile).write(edges, points); } Info<< "End\n" << endl; diff --git a/applications/utilities/surface/surfaceBooleanFeatures/surfaceBooleanFeatures.C b/applications/utilities/surface/surfaceBooleanFeatures/surfaceBooleanFeatures.C index 02d0b0c8e6..1d0dfae584 100644 --- a/applications/utilities/surface/surfaceBooleanFeatures/surfaceBooleanFeatures.C +++ b/applications/utilities/surface/surfaceBooleanFeatures/surfaceBooleanFeatures.C @@ -99,7 +99,7 @@ typedef CGAL::AABB_face_graph_triangle_primitive typedef CGAL::AABB_traits Traits; typedef CGAL::AABB_tree Tree; -typedef boost::optional::Type > +typedef boost::optional::Type> Segment_intersection; #endif // NO_CGAL @@ -477,7 +477,6 @@ label dupNonManifoldPoints(triSurface& s, labelList& pointMap) List newFaces(s); label nNonManifold = 0; - forAll(pf, pointI) { const labelList& pFaces = pf[pointI]; @@ -1257,10 +1256,10 @@ autoPtr createEdgeMesh const triSurface& s1 = surf1; const triSurface& s2 = surf2; - forAllConstIter(labelPairLookup, inter.facePairToEdge(), iter) + forAllConstIters(inter.facePairToEdgeId(), iter) { - const label& cutEdgeI = iter(); const labelPair& facePair = iter.key(); + const label cutEdgeI = iter.object(); const edge& fE = inter.cutEdges()[cutEdgeI]; diff --git a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C index 95a1c1b028..28bd8f092d 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C +++ b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C @@ -73,7 +73,7 @@ Foam::surfaceFeaturesExtraction::method::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(methodName); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalIOErrorInFunction ( diff --git a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C index 1ea773f16b..29187c7cfe 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C +++ b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C @@ -84,6 +84,8 @@ int main(int argc, char *argv[]) forAllConstIter(dictionary, dict, iter) { + const word& dictName = iter().keyword(); + if (!iter().isDict()) { continue; @@ -106,7 +108,7 @@ int main(int argc, char *argv[]) const word outputName = fileName ( - surfaceDict.lookupOrDefault("output", iter().keyword()) + surfaceDict.lookupOrDefault("output", dictName) ).lessExt(); // The "surfaces" entry is normally optional, but if the sub-dictionary @@ -115,7 +117,7 @@ int main(int argc, char *argv[]) // additional switch. if ( - iter().keyword() == "surfaces" // mandatory + dictName == "surfaces" // mandatory || surfaceDict.found("surfaces") // or optional ) { @@ -123,14 +125,14 @@ int main(int argc, char *argv[]) } else { - loader.select(iter().keyword()); + loader.select(dictName); } if (loader.selected().empty()) { FatalErrorInFunction << "No surfaces specified/found for entry: " - << iter().keyword() << exit(FatalError); + << dictName << exit(FatalError); } // DebugVar(loader.available()); // DebugVar(outputName); @@ -153,7 +155,7 @@ int main(int argc, char *argv[]) { FatalErrorInFunction << "Problem loading surface(s) for entry: " - << iter().keyword() << exit(FatalError); + << dictName << exit(FatalError); } triSurface surf = surfPtr(); diff --git a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtractDict b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtractDict index d04bbc7958..362e7f99ee 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtractDict +++ b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtractDict @@ -134,7 +134,7 @@ surface2.nas // - If other dictionaries contain a 'surfaces' entry, // it will be taken for the input. // -surfaces +dummyName { extractionMethod extractFromSurface; @@ -169,4 +169,39 @@ surfaces writeObj yes; } + +// Handle single or multiple surfaces +// +// - If the dictionary is named 'surfaces', it must also contain a 'surfaces' +// entry (wordRe list). +// +// - If other dictionaries contain a 'surfaces' entry, +// it will be taken for the input. +// +surfaces +{ + extractionMethod extractFromNone; + + surfaces (surface1.stl surface2.nas); + + // Base output name (optional) + // output surfaces; + + // Generate additional features from self-intersect + selfIntersection true; + + // Tolerance for surface intersections + tolerance 1e-3; + + extractFromNoneCoeffs + { + includedAngle 0; + } + + // Write options + + // Write features to obj format for postprocessing + writeObj yes; +} + // ************************************************************************* // diff --git a/applications/utilities/surface/surfaceSplitNonManifolds/surfaceSplitNonManifolds.C b/applications/utilities/surface/surfaceSplitNonManifolds/surfaceSplitNonManifolds.C index 65dd086cd3..47a83a09f2 100644 --- a/applications/utilities/surface/surfaceSplitNonManifolds/surfaceSplitNonManifolds.C +++ b/applications/utilities/surface/surfaceSplitNonManifolds/surfaceSplitNonManifolds.C @@ -129,8 +129,7 @@ void dumpFaces const Map