Go to the documentation of this file.
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])
76 operator[](newTriangleI++) = newTri;
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;
115 if (pointIsUsed.
set(pointI, 1))
127 forAll(pointIsUsed, pointI)
129 if (pointIsUsed[pointI])
131 ps[newPointI] = ps[pointI];
132 pointMap[pointI] = newPointI++;
135 ps.setSize(newPointI);
points setSize(newPointi)
#define forAll(list, i)
Loop across all elements in list.
void set(const PackedList< 1 > &)
Set specified bits.
Ostream & endl(Ostream &os)
Add newline and flush stream.
pointField points(const pointField &) const
Return the points corresponding to this face.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
void setSize(const label)
Reset size of List.
prefixOSstream Pout(cout, "Pout")
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool stitchTriangles(const pointField &rawPoints, const scalar tol=SMALL, const bool verbose=false)
Function to stitch the triangles by removing duplicate points.
Triangle with additional region number.
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.