32 bool Foam::triSurface::stitchTriangles
43 bool hasMerged =
mergePoints(ps, tol, verbose, pointMap, newPoints);
49 Pout<<
"stitchTriangles : Merged from " << ps.size()
50 <<
" points down to " << newPoints.size() <<
endl;
54 ps.transfer(newPoints);
57 label newTriangleI = 0;
71 (newTri[0] != newTri[1])
72 && (newTri[0] != newTri[2])
73 && (newTri[1] != newTri[2])
80 Pout<<
"stitchTriangles : " 81 <<
"Removing triangle " << i
82 <<
" with non-unique vertices." <<
endl 83 <<
" vertices :" << newTri <<
endl 84 <<
" coordinates:" << newTri.points(ps)
89 if (newTriangleI !=
size())
93 Pout<<
"stitchTriangles : " 94 <<
"Removed " <<
size() - newTriangleI
95 <<
" triangles" <<
endl;
104 PackedBoolList pointIsUsed(ps.size());
114 label pointi = f[fp];
115 if (pointIsUsed.set(pointi, 1))
122 if (nPoints != ps.size())
125 pointMap.setSize(ps.size());
127 forAll(pointIsUsed, pointi)
129 if (pointIsUsed[pointi])
132 pointMap[pointi] = newPointi++;
135 ps.setSize(newPointi);
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
T & operator[](const label)
Return element of UList.
Ostream & endl(Ostream &os)
Add newline and flush stream.
vectorField pointField
pointField is a vectorField.
List< label > labelList
A List of labels.
pointField & storedPoints()
Non-const access to global points.
void setSize(const label)
Reset size of List.
prefixOSstream Pout(cout, "Pout")
label mergePoints(const UList< Type > &points, const scalar mergeTol, const bool verbose, labelList &pointMap, const Type &origin=Type::zero)
Sorts and merges points. All points closer than/equal mergeTol get merged.
label size() const
Return the number of elements in the UList.