Go to the documentation of this file.
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;
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);
static SLList< string > validArgs
A list of valid (mandatory) arguments.
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
A class for handling file names.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
static void addNote(const string &)
Add extra notes for the usage information.
virtual void movePoints(const pointField &)
Move points.
Extract command arguments and options from the supplied argc and argv parameters.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< scalar > mag(const dimensioned< Type > &)
dimensionSet transform(const dimensionSet &)
Quaternion class used to perform rotations in 3D space.
static void write(const fileName &, const MeshedSurface< Face > &)
Write to file.
const Foam::HashTable< string > & options() const
Return options.
#define R(A, B, C, D, E, F, K, M)
Pre-declare SubField and related Field type.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void replace(const direction, const UList< cmptType > &)
Replace a component field of the field.
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
Vector< scalar > vector
A scalar version of the templated Vector.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
An ordered pair of two objects of type <T> with first() and second() elements.
bool optionFound(const word &opt) const
Return true if the named option is found.
tensor rotationTensor(const vector &n1, const vector &n2)
static void noParallel()
Remove the parallel options.
Foam::argList args(argc, argv)
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
IStringStream optionLookup(const word &opt) const
Return an IStringStream from the named option.