Specifications
116
AnyRefNode CylCenter = {
sRel = {0, 0, -0.2};
};
}; // Global reference frame
Having defined the point, we can proceed to create a surface. The wrapping algorithm in AnyBody will in
principle work with any sort of surface including real bone surfaces, but for the time being only parametric
surfaces are used. The reason is that the bony surfaces are really a lot of small planar triangles, and the
corners and edges of the triangles will cause the muscles to slide discontinuously over the surface, which
disturbs the analysis result. The parametric surfaces currently available are cylinders and ellipsoids. Let us
try our luck with a cylinder. Go to the class tree, locate the class AnySurfCylinder, and insert an instance
into the newly defined node on GlobalRef. Then define the name of the cylinder, add an AnyDrawParamSurf
statement, and change the cylinder parameters as shown below:
AnyRefNode CylCenter = {
sRel = {0, 0, -0.2};
AnySurfCylinder WrapSurf = {
Radius = 0.15;
Length = 0.4;
AnyDrawParamSurf drv = {};
//CapRatio = 0.100000;
};
};
}; // Global reference frame
Most of this should be self explanatory. However, please notice that the insertion point of the cylinder is at
{0, 0, 0.2} corresponding exactly to half of the length of the cylinder of 0.4. This causes the cylinder to be
inserted symmetrically about the xy plane as illustrated below:
The cylinder direction is always z in the coordinate direction of the object that the cylinder is inserted into.
So, if the cylinder does not have the orientation you want, then the key to rotate it correctly is to control the
direction of the AnyRefNode that it is inserted into. In fact, let us rotate it just a little bit to make things a
bit more interesting:
AnyRefNode CylCenter = {
sRel = {0, 0, -0.2};
ARel = RotMat(20*pi/180,y);
AnySurfCylinder WrapSurf = {










