50int main(
int argc,
char *argv[])
54 "Merge points on surface if they are within absolute distance [m]."
56 argList::noParallel();
57 argList::addArgument(
"input",
"The input surface file");
58 argList::addArgument(
"distance",
"The merge distance");
59 argList::addArgument(
"output",
"The output surface file");
65 "Input geometry scaling factor"
71 const auto mergeTol =
args.
get<scalar>(2);
76 Info<<
"Reading surface from " << surfFileName <<
" ..." <<
nl
77 <<
"Merging points within " << mergeTol <<
" metre." <<
nl;
80 Info<<
"input scaling " << scaling <<
nl;
85 Info<<
"Original surface:" <<
nl;
86 surf1.writeStats(Info);
92 const label nOldVert = cleanSurf.nPoints();
94 cleanSurf = triSurfaceTools::mergePoints(cleanSurf, mergeTol);
96 Info<<
"After merging points:" <<
endl;
98 cleanSurf.writeStats(Info);
100 if (nOldVert == cleanSurf.nPoints())
106 cleanSurf.
write(outFileName);
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
Extract command arguments and options from the supplied argc and argv parameters.
T get(const label index) const
Get a value from the argument at index.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
A class for handling file names.
Triangulated surface description with patch information.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr char nl
The newline '\n' character (0x0a)
Foam::argList args(argc, argv)