Knowledge Base

Article Number: 2 | Post Date: June 30, 2016 | Last Updated: July 15, 2016

## Is it possible to customize the multibody model beyond just changing the overall weight and height?

Yes. Chapter 13 of the User's Guide reviews the Virtual CRASH 3 multibody model. In that chapter, the procedure for changing the overall height and weight of the multibody model is described. Some details of the mbdef file are also reviewed. The mbdef files contain the parameters used to define the default multibody models. The mbdef has two sections, (1) the segment definitions, and (2) the joint definitions. Let's start by looking at the head segment definition:

The format for the segment definition block is as follows:

Line 1: Segment Name

Line 2: Segment Mass (in kilograms)

Line 3: local semi-axis X (in meters), local semi-axis Y (in meters), local semi-axis Z (in meters), "Level" (2 = ellipsoid, 30 = cuboid)

Line 4: Segment ellipsoid geometrical center position in Earth frame (in meters): x, y, z

Line 5: Segment ellipsoid orientation in Earth frame (in degrees): yaw, pitch, roll

So we see that the head segment ellipsoid has a 5 kg mass, and has a semi-axis size of 0.1 m in both the local x and local y directions, and 0.12 m in the local z direction. It is centered 1.715 m above the x-y plane.

Obviously, the head is connected to the neck segment ellipsoid. Scrolling further down the mbdef file, we find the joint block:

The format for the segment definition block is as follows (see ragdoll joint diagram below for reference):

Line 1: Joint name

Line 2: Joint display size (in meters)

Line 3: Segment i (parent) to be connected by joint (note, we count by 0)

Line 4: Joint connection position within Segment i (parent) local frame (in meters): x, y, z

Line 5: Joint connection orientation within Segment i (parent) local frame (in degrees): yaw, pitch, roll

Line 6: Segment i+1 (child) to be connected by joint (note, we count by 0)

Line 7: Joint connection position within Segment i+1 (child) local frame (in meters): x, y, z

Line 8: Joint connection orientation within Segment i+1 (child) local frame (in degrees): yaw, pitch, roll

Line 9: No contact flag. NOCONTACT indicates neighboring ellipsoids do not interact via contact forces.

Line 10: Joint type

Line 11: Cone twist plane orientation

Line 12: Axis cone limits (degrees): lower, upper

Line 13: Axis plane limits (degrees): lower, upper

Line 14: Axis twist limits (degrees): lower, upper

We can gain a little more insight into the mbdef file structure by performing some simple cross checks in the Virtual CRASH 3 environment. First, let's start with a "naked" multibody (see Chapter 13 to learn how to remove outer skin).

Next, let's create an ellipsoid modeled after the head segment, based on the size and position specifications of the mbdef file. We'll also do the same for the right foot.

The same holds for segment weight. Rescaling the overall weight of the multibody model will rescale all segment weights in direct proportion (note the segment moments-of-inertia are approximated by the corresponding hyperellipsoid moments-of-inertia). The default overall weight is also based on the Hybrid III 50th Percentile Male.  Virtual CRASH also adds up the total segment masses from the mbdef file (let's call the sum "M"), and will apply a global scale factor to all segment masses of (78 kg / M) by default. So again, once you change your multibody's mass in the left-side control panel to some value (let's call it "User_Mass"), then this scale factor becomes (User_Mass / M). Again, if you have a target total mass, then once you change this overall mass value to M based on your individual segment masses in your mbdef file, then all of your segments should change to what is specified in the mbdef file since your scale factor becomes 1 in this case.

So if you want to create your own custom model, the procedure is:
(1) set the segment semi-axes and segment masses to your custom values in the mbdef file
(2) when you launch vcrash, use the left-side control panel to change the overall height and overall weight of the multibody to match your custom overall height and overall weight. Then you should see everything scaled properly.

Now, returning back to our example, we can see studying the yellow ellipsoid that approximates the head in the figure above, the total height of the multibody defined in the mbdef is 1.835 meters tall; however, the default multibody height once imported into Virtual CRASH is 1.75 meters tall, therefore implying a scaling factor of 1.75/1.835 = 0.954 is being applied to the segment semi-axes values automatically when you import the multibody model into your simulation environment. Indeed, rescaling the z position and the semi-axes by this factor repositions and resizes our yellow test ellipsoid to overlap very nicely with the multibody model's head ellipsoid.

Applying the same rescaling to the semi-axes and position of the left foot test ellipsoid, we also see excellent agreement. Selecting the joint manipulator allows us to look at the multibody joints. Notice the joint "lower leg left - foot left" has ROT0 = (0, 89.567039, 0) in the mbdef file. Indeed, when we visualize the joints in our simulation environment, we see this joint is articulated at a 90 degree angle (purple lines below).

Now that we better understand the mbdef file, let's attempt to modify the head segment, by making it larger. First, make a copy of pedestrian.mbdef, and save it under a new file name. We'll call ours "pedestrianTest.mbdef." In this new file, let's double the semi-axes sizes:

Because the size of the head segment ellipsoid increased by a factor of 2, we must also reposition the point of connection of the neck - head joint, so that the z position in the head's local frame is increased by the same factor (note: we are maintaining the same joint position in local z relative to the z semi-axis size):

Now, save this file in your data/multibody directory. In order to better see the result, we took the additional step of turning off the surface model by using #:

Finally, relaunching Virtual CRASH 3, we find our new multibody model in the object database:

Careful analysis shows that for our new model, the total height should be 1.955 meters; however, because Virtual CRASH 3 automatically resales the overall height to 1.75 meters, the head ellipsoid will not be the same size as programmed in the mbdef file. Indeed, a side by side comparison with the default multibody shows that, with the exception of the head ellipsoid, our larger head model has smaller segments. This is because a scale factor of 1.75/1.955 = 0.895 has been applied to all semi-axes to achieve a 1.75 meter overall height, whereas the default model has applied a scale factor of 0.954 (as shown above). In order to see the correct relative sizes for this comparison, let's change the overall height of the default model to 1.835 meters and large head model to 1.955. Doing this, we see that all other segments have the same sizes, but the large head model indeed has semi-axes values twice that of the default model.

Overlapping the two models and viewing in contour model further illustrates the point:

Finally, let's look at an example of modifying the left femur size such that it becomes twice the size of the default left femur.  We do this for all three semi-axes:

Next, we need to ensure we are maintaining the same joint positions in local (x,y,z) space relative to the (x,y,z) semi-axes sizes for the left femur. Since each semi-axis is being increased by a factor of 2, we need to move the joint positions in left femur space by the same factor. In other words, since the default model has the hip - femur left joint positioned at 92.3% of the total length from the geometrical center of the left femur to its tip along its local z-axis, if we resize the left femur length in z, we need to ensure this joint is moved such that it is still at 92.3% of the new length. This needs to be done for each of the local (x,y,z) joint positions. So, for the hip - femur left joint, we have:

Similarly, for the femur-left - lower leg left joint, we have:

You can see the final result below:

# Related content:

Virtual CRASH 3 | Chapter 13 | The Human Models

Tags: multibody, joints, semiaxes, semi-axes, semiaxis, semi-axis, poses, height, weight, human model, pedestrian model, mbdef file, segment weight, segment mass, ellipsoid weight, ellipsoid mass.