37
In addition, SimMechanics offers a convenient way of importing CAD assembly
designs into SimMechanics machines – CAD Translator. When the CAD
assembly is in parallel exported from the CAD tool also to the VRML model, it is
just a matter of few steps to add virtual reality visualization to such machines.
Depending on the virtual scene hierarchy, there are two methods for
visualization of SimMechanics machines possible:
When the virtual scene has a flat structure of independent objects,
positions and rotations of machine parts – bodies can be obtained using
Body Sensor blocks connected to appropriate coordinate systems
attached to the bodies, with positions and rotations defined using the
absolute – world coordinates. In most cases it is suitable to connect the
sensor to a body coordinate system with origin in [0 0 0] and initial
rotation matrix defined as identity matrix [1 0 0; 0 1 0, 0 0 1] in the world
coordinates.
When the virtual scene has a hierarchical structure of nested objects, the
body positions and rotations can be obtained using Body Sensor blocks
with output set to local body coordinates. In some special cases – for
instance when two bodies are connected through a revolute joint, it is
possible to get the angle between the objects using a Joint Sensor block.
5.3.5. Linking the Virtual Scene to a MATLAB Model
For interaction with virtual scenes Simulink 3D Animation offers also set of
MATLAB functions and constructs known as the toolbox MATLAB Interface.
There might be circumstances when using this MATLAB functionality is suitable
in connection with CAD-based designs, for instance:
Using customised GUIs to visualize static objects or their relations in
virtual environment. Example – interactive machine assembly
instructions.
Visualization of a 3D information based on a general independent
quantity (doesn’t have to be time).
MATLAB interface functions used in Simulink model callbacks.
Visualization of systems whose dynamic models are available as MATLAB
code.
Kommentare zu diesen Handbüchern