Previous section-----Next section

3.2.2 Output Functions

Modeler3D numerical output functions return expressions that evaluate to numbers or vectors, such as the distance between two points, the angle between two lines, or the coordinates of a point. These functions take Modeler3D point, vector, and axis objects as arguments, identical in structure to the geometry objects used when building constraints. When local point numbers are used, the local coordinates are taken from the current body objects, as specified with SetBodies.
Each of the output functions is demonstrated in the context of the quick-return mechanism model defined in Section 3.2.1.

Output functions.

More output functions.

The Location function is used to convert a Mech point object into the global coordinates of the point.

Here are the global coordinates of the attachment point of the connecting rod on the crank.

Location assumes a point object if only the arguments of Point are given.

In[16]:=
Out[16]=

Now get a numerical result.

The Distance function is used to find the absolute distance between any two points in space. The two points can be on one body or two different bodies.

Here is the distance from a point on the axis of the crank to the origin of the slider.

Now get a numerical result.

Here is the length of the line from the center of the crank to the drive pin.

Note that it was not necessary to apply a solution rule to the last example to get a numerical result because the dimension that was measured was a constant.

Here is the minimum distance between the crank axis and the center line of the connecting rod.

Here is the angle between the connecting rod and the crank axis.

Now convert the previous result to degrees.

The measure of an angle in 3D space requires a reference frame for measurement. ProjectedAngle allows the plane of projection of the angle to be specified.

Here is the angle of a line on the crank, relative to a line on the ground, as viewed looking down the crank axis.

Now get a numerical result at T = 0.35.

This angle should be equal to 35/100 of a turn, since that is what we have specified with SolveMech.

This finds the intersection of the connecting rod axis and a horizontal plane through the crank axis.

The angular orientation of a body in 3D space can be uniquely specified by a single rotation about a fixed axis. Rotation returns the angle and axis associated with the current spatial orientation of a body. See Section 4.2 for more examples on the angular orientation of 3D bodies.

This finds the angle and axis of rotation of the crank.

Now get a numerical result.