Go to the documentation of this file.
56 int main(
int argc,
char *argv[])
60 "Clean surface by removing baffles, sliver faces,"
61 " collapsing small edges, etc."
73 "Suppress surface checking/cleanup on the input surface"
79 "Input geometry scaling factor"
84 const scalar minLen =
args.
get<scalar>(2);
85 const scalar minQuality =
args.
get<scalar>(3);
88 Info<<
"Reading surface " << inFileName <<
nl
89 <<
"Collapsing all triangles with" <<
nl
90 <<
" edges or heights < " << minLen <<
nl
91 <<
" quality < " << minQuality <<
nl
92 <<
"Writing result to " << outFileName <<
nl <<
endl;
95 Info<<
"Reading surface from " << inFileName <<
" ..." <<
nl <<
endl;
102 surf.writeStats(
Info);
106 Info<<
"Removing duplicate and illegal triangles ..." <<
nl <<
endl;
110 Info<<
"Collapsing triangles to edges ..." <<
nl <<
endl;
116 if (nEdgeCollapse == 0)
123 const label nSplitEdge =
collapseBase(surf, minLen, minQuality);
132 <<
"Resulting surface:" <<
endl;
133 surf.writeStats(
Info);
136 <<
"Writing refined surface to " << outFileName <<
" ..." <<
endl;
137 surf.
write(outFileName);
A class for handling file names.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
static void addNote(const string ¬e)
Add extra notes for the usage information.
Extract command arguments and options from the supplied argc and argv parameters.
Ostream & endl(Ostream &os)
Add newline and flush stream.
T get(const label index) const
Get a value from the argument at index.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
Triangulated surface description with patch information.
messageStream Info
Information stream (uses stdout - output is on the master only)
Routines to collapse small edges.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
Routines collapse sliver triangles by splitting the base edge.
label collapseBase(triSurface &surf, const scalar minLen, const scalar minQuality)
Keep collapsing all triangles whose height is < minLen or quality < minQ.
label collapseEdge(triSurface &surf, const scalar minLen)
Keep collapsing all edges < minLen.
static void noParallel()
Remove the parallel options.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
Foam::argList args(argc, argv)
bool found(const word &optName) const
Return true if the named option is found.