surfaceTransformPoints, transformPoints: documented transformations in '-help' option

This commit is contained in:
Chris Greenshields
2021-08-14 17:42:51 +01:00
parent f3454baa08
commit 57a4460d08
2 changed files with 49 additions and 34 deletions

View File

@ -137,25 +137,33 @@ void rotateFields(const argList& args, const Time& runTime, const tensor& T)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const wordList supportedTransformations
(
{"translate", "rotate", "Rx", "Ry", "Rz", "Ra", "scale"}
);
{
OStringStream supportedTransformationsStr;
supportedTransformationsStr << supportedTransformations << endl;
argList::addNote argList::addNote
( (
"Transforms a mesh e.g.\n" "Transforms a mesh by translation, rotation and/or scaling.\n"
"transformPoints " "The <transformations> are listed comma-separated in a string "
"\"translate=(-0.586 0 -0.156), " "and executed in sequence.\n\n"
"Ry=3.485, " "transformations:\n"
"translate=(0.586 0 0.156)\"\n\n" " translate=<vector> "
"Supported transformations " + supportedTransformationsStr.str() "translation by vector, e.g. (1 2 3)\n"
" rotate=(<n1> <n2>) "
"rotation from unit vector n1 to n2\n"
" Rx=<angle> "
"rotation by given angle [deg], e.g. 90, about x-axis\n"
" Ry=<angle> "
"rotation by given angle [deg] about y-axis\n"
" Rz=<angle> "
"rotation by given angle [deg] about z-axis\n"
" Ra=<axis vector> <angle> "
"rotation by given angle [deg] about specified axis\n"
" scale=<vector> "
"scale by factors from vector in x, y, z directions,\n"
" "
"e.g. (0.001 0.001 0.001) to scale from mm to m\n\n"
"example:\n"
" transformPoints "
"\"translate=(1.2 0 0), Rx=90, translate=(-1.2 0 0)\""
); );
}
argList::validArgs.append("transformations"); argList::validArgs.append("transformations");

View File

@ -71,26 +71,33 @@ int main(int argc, char *argv[])
{ {
#include "removeCaseOptions.H" #include "removeCaseOptions.H"
const wordList supportedTransformations
(
{"translate", "rotate", "Rx", "Ry", "Rz", "Ra", "scale"}
);
{
OStringStream supportedTransformationsStr;
supportedTransformationsStr << supportedTransformations << endl;
argList::addNote argList::addNote
( (
"Transforms a surface e.g.\n" "Transforms a surface geometry "
"surfaceTransformPoints " "by translation, rotation and/or scaling.\n"
"\"translate=(-0.586 0 -0.156), " "The <transformations> are listed comma-separated in a string "
"Ry=3.485, " "and executed in sequence.\n\n"
"translate=(0.586 0 0.156)\" " "transformations:\n"
"surf.stl tranformedSurf.obj\n\n" " translate=<vector> "
"Supported transformations " + supportedTransformationsStr.str() "translation by vector, e.g. (1 2 3)\n"
" rotate=(<n1> <n2>) "
"rotation from unit vector n1 to n2\n"
" Rx=<angle> "
"rotation by given angle [deg], e.g. 90, about x-axis\n"
" Ry=<angle> "
"rotation by given angle [deg] about y-axis\n"
" Rz=<angle> "
"rotation by given angle [deg] about z-axis\n"
" Ra=<axis vector> <angle> "
"rotation by given angle [deg] about specified axis\n"
" scale=<vector> "
"scale by factors from vector in x, y, z directions,\n"
" "
"e.g. (0.001 0.001 0.001) to scale from mm to m\n\n"
"example:\n"
" surfaceTransformPoints \"translate=(1.2 0 0), Rx=90\" "
"in.stl out.obj"
); );
}
argList::noParallel(); argList::noParallel();
argList::validArgs.append("transformations"); argList::validArgs.append("transformations");