56int 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"
82 "Input geometry scaling factor"
87 const auto minLen =
args.get<scalar>(2);
88 const auto minQuality =
args.get<scalar>(3);
91 const int optVerbose =
args.verbose();
93 Info<<
"Reading surface " << inFileName <<
nl
94 <<
"Collapsing all triangles with" <<
nl
95 <<
" edges or heights < " << minLen <<
nl
96 <<
" quality < " << minQuality <<
nl
97 <<
"Writing result to " << outFileName <<
nl <<
endl;
100 Info<<
"Reading surface from " << inFileName <<
" ..." <<
nl <<
endl;
105 args.getOrDefault<scalar>(
"scale", -1)
107 surf.writeStats(
Info);
109 if (!
args.found(
"no-clean"))
111 Info<<
"Removing duplicate and illegal triangles ..." <<
nl <<
endl;
112 surf.cleanup(optVerbose);
115 Info<<
"Collapsing triangles to edges ..." <<
nl <<
endl;
121 if (nEdgeCollapse == 0)
128 const label nSplitEdge =
collapseBase(surf, minLen, minQuality);
137 <<
"Resulting surface:" <<
endl;
138 surf.writeStats(
Info);
141 <<
"Writing refined surface to " << outFileName <<
" ..." <<
endl;
142 surf.write(outFileName);
Extract command arguments and options from the supplied argc and argv parameters.
static void addVerboseOption(const string &usage="", bool advanced=false)
Enable a 'verbose' bool option, with usage information.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
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.
static void addNote(const string ¬e)
Add extra notes for the usage information.
static void addOptionCompat(const word &optName, std::pair< const char *, int > compat)
Specify an alias for the option name.
A class for handling file names.
Triangulated surface description with patch 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.
Routines to collapse small edges.
label collapseEdge(triSurface &surf, const scalar minLen)
Keep collapsing all edges < minLen.
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)