Specifications
45
We want to rotate the dumbbell 90 degrees about the y axis. We could do that by going back to the CAD
system and modifying the dumbbell STL file, but an easier option is to rotate it directly inside AnyScript.
A geometrical object that you insert gets the same orientation as the coordinate system it is attached to. In
this case the dumbbell is attached to PalmNode. Nodes are actually reference frames with the ability to be
positioned and oriented relatively to other reference frames, for instance a segment or another node. We
have already positioned nodes by means of the member vector sRel and relative orientation happens
similarly with the member matrix ARel, the relative rotational transformation matrix. We wish to rotate the
dumbbell 90 degrees about the local y axis and hence write:
AnyRefNode PalmNode = {
sRel = {0.27,0,0};
ARel = RotMat(90*pi/180, y);
AnyDrawSTL DrwSTL = {
FileName = "dumbbell.stl";
ScaleXYZ = {0.001, 0.001, 0.001};
};
};
As a final cosmetic touch, you may want to change the color of the dumbbell. This can be done by adding
the property RGB to the STL file reference:
AnyDrawSTL DrwSTL = {
FileName = "dumbbell.stl";
ScaleXYZ = {0.001, 0.001, 0.001};
RGB = {0.2,0.4,0.5};
};
The RGB property specifies the blend of colors Red, Green, and Blue in that order for displaying the STL
geometry. The combination above produces a dull blue shade.










