ENH: improved handling of 'unresolved' surface intersections (issue #450)

- the heuristic for matching unresolved intersections is a relatively
  simple matching scheme that seems to be more robust than attempting to walk
  the geometry or the cuts.

- avoid false positives for self intersection
This commit is contained in:
Mark Olesen
2017-05-08 14:57:47 +02:00
parent da8ea0f21a
commit 0e7630feca
12 changed files with 384 additions and 297 deletions

View File

@ -29,13 +29,14 @@ License
#include "labelPairHashes.H"
#include "OFstream.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
void Foam::surfaceIntersection::writeOBJ
(
const List<point>& pts,
Ostream& os
)
namespace Foam
{
// file-scope
// Write points in obj format
static void writeObjPoints(const UList<point>& pts, Ostream& os)
{
forAll(pts, i)
{
@ -44,23 +45,10 @@ void Foam::surfaceIntersection::writeOBJ
}
}
} // End namespace Foam
void Foam::surfaceIntersection::writeOBJ
(
const List<point>& pts,
const List<edge>& edges,
Ostream& os
)
{
writeOBJ(pts, os);
forAll(edges, i)
{
const edge& e = edges[i];
os << "l " << e.start()+1 << ' ' << e.end()+1 << nl;
}
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Get minimum length of all edges connected to point
@ -254,8 +242,8 @@ void Foam::surfaceIntersection::writeIntersectedEdges
// Dump all points (surface followed by cutPoints)
const pointField& pts = surf.localPoints();
writeOBJ(pts, os);
writeOBJ(cutPoints(), os);
writeObjPoints(pts, os);
writeObjPoints(cutPoints(), os);
forAll(edgeCutVerts, edgeI)
{