mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: region-wise self intersection for surfaceFeatureExtract (issue #450)
This commit is contained in:
@ -149,8 +149,21 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
Info<< "Output : " << outputName << nl;
|
||||
|
||||
triSurfaceLoader::loadingOption loadingOption =
|
||||
triSurfaceLoader::loadingOptionNames.lookupOrDefault
|
||||
(
|
||||
"loadingOption",
|
||||
surfaceDict,
|
||||
triSurfaceLoader::loadingOption::OFFSET_REGION
|
||||
);
|
||||
|
||||
Info<<"loading with "
|
||||
<< triSurfaceLoader::loadingOptionNames[loadingOption]
|
||||
<< endl;
|
||||
|
||||
|
||||
// Load a single file, or load and combine multiple selected files
|
||||
autoPtr<triSurface> surfPtr = loader.load();
|
||||
autoPtr<triSurface> surfPtr = loader.load(loadingOption);
|
||||
if (!surfPtr.valid() || surfPtr().empty())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
@ -390,14 +403,21 @@ int main(int argc, char *argv[])
|
||||
feMesh.add(addFeMesh);
|
||||
}
|
||||
|
||||
if (surfaceDict.lookupOrDefault<bool>("selfIntersection", false))
|
||||
{
|
||||
// TODO: perturbance tolerance?
|
||||
const surfaceIntersection::intersectionType selfIntersect =
|
||||
surfaceIntersection::selfIntersectionNames.lookupOrDefault
|
||||
(
|
||||
"intersectionMethod",
|
||||
surfaceDict,
|
||||
surfaceIntersection::NONE
|
||||
);
|
||||
|
||||
if (selfIntersect != surfaceIntersection::NONE)
|
||||
{
|
||||
triSurfaceSearch query(surf);
|
||||
surfaceIntersection intersect(query, surfaceDict);
|
||||
|
||||
intersect.mergePoints(5*SMALL);
|
||||
// Remove rounding noise - could make adjustable
|
||||
intersect.mergePoints(10*SMALL);
|
||||
|
||||
labelPair sizeInfo
|
||||
(
|
||||
@ -413,14 +433,15 @@ int main(int argc, char *argv[])
|
||||
intersect.cutEdges()
|
||||
);
|
||||
|
||||
addMesh.mergePoints(5*SMALL);
|
||||
feMesh.add(addMesh);
|
||||
|
||||
sizeInfo[0] = addMesh.points().size();
|
||||
sizeInfo[1] = addMesh.edges().size();
|
||||
}
|
||||
Info<< nl
|
||||
<< "Self intersection:" << nl
|
||||
<< "intersection: "
|
||||
<< surfaceIntersection::selfIntersectionNames[selfIntersect]
|
||||
<< nl
|
||||
<< " points : " << sizeInfo[0] << nl
|
||||
<< " edges : " << sizeInfo[1] << nl;
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ FoamFile
|
||||
|
||||
surface1.stl
|
||||
{
|
||||
// How to obtain raw features (extractFromFile | extractFromSurface | none)
|
||||
// How to obtain raw features (none | extractFromFile | extractFromSurface)
|
||||
extractionMethod extractFromSurface;
|
||||
|
||||
// Mark edges whose adjacent surface normals are at an angle less
|
||||
@ -36,8 +36,8 @@ surface1.stl
|
||||
geometricTestOnly yes;
|
||||
} */
|
||||
|
||||
// Generate additional features from self-intersect
|
||||
selfIntersection false;
|
||||
// Generate additional intersection features (none | self | region)
|
||||
intersectionMethod none;
|
||||
|
||||
// Tolerance for surface intersections
|
||||
tolerance 1e-3;
|
||||
@ -51,7 +51,7 @@ surface1.stl
|
||||
|
||||
surface2.nas
|
||||
{
|
||||
// How to obtain raw features (extractFromFile | extractFromSurface | none)
|
||||
// How to obtain raw features (none | extractFromFile | extractFromSurface)
|
||||
extractionMethod extractFromFile;
|
||||
|
||||
extractFromFileCoeffs
|
||||
@ -114,8 +114,8 @@ surface2.nas
|
||||
// Out put the closeness of surface elements to other surface elements.
|
||||
closeness no;
|
||||
|
||||
// Generate additional features from self-intersect
|
||||
selfIntersection false;
|
||||
// Generate additional intersection features (none | self | region)
|
||||
intersectionMethod none;
|
||||
|
||||
// Tolerance for surface intersections
|
||||
tolerance 1e-3;
|
||||
@ -148,8 +148,8 @@ dummyName
|
||||
// Base output name (optional)
|
||||
// output surfaces;
|
||||
|
||||
// Generate additional features from self-intersect
|
||||
selfIntersection true;
|
||||
// Generate additional intersection features (none | self | region)
|
||||
intersectionMethod self;
|
||||
|
||||
// Tolerance for surface intersections
|
||||
tolerance 1e-3;
|
||||
@ -183,8 +183,8 @@ surfaces
|
||||
// Base output name (optional)
|
||||
// output surfaces;
|
||||
|
||||
// Generate additional features from self-intersect
|
||||
selfIntersection true;
|
||||
// Generate additional intersection features (none | self | region)
|
||||
intersectionMethod self;
|
||||
|
||||
// Tolerance for surface intersections
|
||||
tolerance 1e-3;
|
||||
@ -193,8 +193,7 @@ surfaces
|
||||
noneCoeffs
|
||||
{
|
||||
includedAngle 0;
|
||||
}
|
||||
*/
|
||||
} */
|
||||
|
||||
// Write options
|
||||
|
||||
|
||||
Reference in New Issue
Block a user