The preparation of the output is done via awk, which is invoked by the mbdyn2easyanim.sh script. It uses the .log and .mov files, and generates a pair of .vol and .van files which contain the model and the motion, respectively. Use
mbdyn2easyanim.sh $filename
where $filename is the name of the output file from MBDyn,
with no extension.
The above script generates a model based on the topology information contained in the .log file, plus the animation information according to the contents of the .mov file.
To check the model during preparation, run MBDyn with
abort after: input;
in the <problem_name> section (pag
),
so that the model is output in the input configuration,
and EasyAnim can visualize it.
The model can be customized by supplying the mbdyn2easyanim.sh script additional awk code that adds nodes, edges and sides whose movement is associated to that of existing nodes.
For this purpose, one needs to write an awk script like
BEGIN {
# add a node property
nodeprop[nodeprop_num, "name"] = "dummy_node"; # node prop name
nodeprop[nodeprop_num, "color"] = 4; # color
nodeprop[nodeprop_num, "radius"] = 1.; # radius
nodeprop_num++;
# add a node
node[node_num] = "added_node" # node name
node[node_num, "relative"] = "base_node"; # base node name (label)
node[node_num, 1] = 1.; # x in base node frame
node[node_num, 2] = 2.; # y in base node frame
node[node_num, 3] = 3.; # z in base node frame
node[node_num, "prop"] = "dummy_node"; # node prop name
node_num++;
# add an edge property
edgeprop[edgeprop_num, "name"] = "dummy_edge"; # edge prop name
edgeprop[edgeprop_num, "color"] = 15; # color
edgeprop[edgeprop_num, "radius"] = 2.; # radius
edgeprop_num++;
# add an edge
edge[edge_num] = "added_edge"; # edge name
edge[edge_num, 1] = "node_1"; # node 1 name
edge[edge_num, 2] = "node_2; # node 2 name
edge[edge_num, "prop"] = "dummy_edge"; # edge prop name
edge_num++;
# add a side property
sideprop[sideprop_num, "name"] = "dummy_side"; # side prop name
sideprop[sideprop_num, "color"] = 8; # color
sideprop_num++;
# add a side
side[side_num] = "added_side";
side[side_num, "N"] = 4;
side[side_num, 1] = "node_1";
side[side_num, 2] = "node_2";
side[side_num, 3] = "node_3";
side[side_num, 4] = "node_4";
side[side_num, "prop"] = "dummy_side";
side_num++;
}
place it into a file, say custom.awk,
and then invoke the interface script as
mbdyn2easyanim.sh -f custom.awk $filename
No special parameters are available at the moment; this interface is under development.