57 int main(
int argc,
char *argv[])
61 "Transform (scale/rotate) a surface. " 62 "Like transformPoints but for surfaces." 71 "translate by the specified <vector> - eg, '(1 0 0)'" 77 "transform in terms of a rotation between <vectorA> and <vectorB> " 78 "- eg, '( (1 0 0) (0 0 1) )'" 84 "scale by the specified amount - eg, '(0.001 0.001 0.001)' for a " 85 "uniform [mm] to [m] scaling" 91 "transform in terms of '( roll pitch yaw )' in degrees" 97 "transform in terms of '( yaw pitch roll )' in degrees" 104 Info<<
"Reading surf from " << surfFileName <<
" ..." <<
nl 105 <<
"Writing surf to " << outFileName <<
" ..." <<
endl;
110 <<
"No options supplied, please use one or more of " 111 "-translate, -rotate or -scale options." 122 Info<<
"Translating points by " << v <<
endl;
133 n1n2[0] /=
mag(n1n2[0]);
134 n1n2[1] /=
mag(n1n2[1]);
138 Info<<
"Rotating points by " << T <<
endl;
144 Info<<
"Rotating points by" <<
nl 145 <<
" roll " << v.x() <<
nl 146 <<
" pitch " << v.y() <<
nl 147 <<
" yaw " << v.z() <<
nl;
152 quaternion R(quaternion::rotationSequence::XYZ, v);
154 Info<<
"Rotating points by quaternion " << R <<
endl;
159 Info<<
"Rotating points by" <<
nl 160 <<
" yaw " << v.x() <<
nl 161 <<
" pitch " << v.y() <<
nl 162 <<
" roll " << v.z() <<
nl;
169 scalar pitch = v.y();
176 Info<<
"Rotating points by quaternion " << R <<
endl;
182 Info<<
"Scaling points by " << v <<
endl;
190 surf1.write(outFileName);
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
static void noParallel()
Remove the parallel options.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
Vector< scalar > vector
A scalar version of the templated Vector.
tensor rotationTensor(const vector &n1, const vector &n2)
Rotational transformation tensor from vector n1 to n2.
void replace(const direction, const UList< cmptType > &)
Replace a component field of the field.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
const Foam::HashTable< string > & options() const
Return options.
An ordered pair of two objects of type <T> with first() and second() elements.
Extract command arguments and options from the supplied argc and argv parameters. ...
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
Quaternion class used to perform rotations in 3D space.
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
#define R(A, B, C, D, E, F, K, M)
dimensioned< scalar > mag(const dimensioned< Type > &)
static void addNote(const string &)
Add extra notes for the usage information.
Foam::argList args(argc, argv)
dimensionSet transform(const dimensionSet &)
IStringStream optionLookup(const word &opt) const
Return an IStringStream from the named option.