Vision and Mobile Robotics Laboratory | Software
|
|
Home | Members | Projects | Publications | Software | Videos | Internal |
MeshSlice is an interactive 3-D viewer that is used to create 2-D slices through 3-D surface meshes. It is used to analyse the shape difference between multiple meshes.
After MeshSlice has read in the meshes, a display tool pops up. The display tool has two viewers. On the left is the Mesh Viewer which shows the 3-D meshes; the meshes can be moved around and viewed from different positions. The slicing plane is shown as a blue plane. On the right is the Slice Viewer which displays the slices though all of the meshes; the slices can be translated and zoomed. Clicking with the left mouse button on the meshes in the mesh viewer changes the current slice position. By typing X,Y,Z in the Mesh Viewer, the slice plane changes slice direction.
Additionally, the slice plane of two MeshSlice instances can be synchronized so that the same slice can be shown under two sets of transforms. One viewer is set to be the master, and one is set to be the slave, and the necessary parameters are transferred using a temporary file.
MeshSlice accepts commands from the mouse and keyboard.
Clicking with the left mouse button on the model in the Mesh Viewer changes the current level of the slice plane. The direction of the slice plane is controlled by keyboard inputs. When the position of the slice plane changes, the displayed slice is automatically updated. (Note: the commands only work if the cursor is set to the arrow cursor and is placed inside the viewing window).
Typing x in the Mesh Viewer will make the slice plane perpendicular to the x-axis.
Typing y in the Mesh Viewer will make the slice plane perpendicular to the y-axis.
Typing z in the Mesh Viewer will make the slice plane perpendicular to the z-axis.
Typing s in the Mesh Viewer will save the view to the synchronization file (if the -master option is set) or synchronize the view with the synchronization file (if the -slave option is set). This allows you to view the same slice through a set of meshes under two different sets of transforms for comparison.
By typing 'MeshSlice -' the following options (format description default) are printed:
MeshSlice.c is the controlling function. It reads in the mesh and calls the function to reate the mesh viewer. It handles mouse and keyboard events.
Usage: MeshSlice (See MeshSlice.html for complete usage)
%S set mesh prefix [required]
-baseView %d set base view number
-transDir %S directory containing transforms to base view
-wrlDir %S directory containing transforms to base view
-master %S write sync info to <file>
-slave %S read sync info from <file>
-newFormat use
-hidePlane don't show the blue plane
... list of views to display
%S mesh prefix [required]
Set the base part of the model name. This prefix is used for forming mesh filenames and transform filenames.
-baseView %d set base view number
see transDir documentation below.
-transDir %S directory containing transforms to base view
Sets the directory where transform files are located. If the transDir option is set, all the views are transformed into the coordinate system of the base view, which is set with the baseView option. This means that transDir should contain transforms from each view to the base view. For example, if the mesh prefix is angel, baseView is 1, and we want to see views 1, 2, and 3, then the transform directory should contain transform files named angel.1.2.trans and angel.1.3.trans.
-wrlDir %S directory containing mesh files
Sets the directory where the mesh files are located. If not set, it defaults to the current directory.
-master %S write sync info to <file>
Sets the mesh slice viewer to be a "master" and sets the name of the synchronization file.
-slave %S read sync info from <file>
Sets the mesh slice viewer to be a "master" and sets the name of the synchronization file.
-newFormat use
Use the new convention for mesh file naming. To make it easier to parse mesh filenames, we changed the standard naming convention for mesh files. The new convention inserts an underscore after the prefix, so view 1 of the angel model would be angel_1.wrl instead of angel1.wrl.
-hidePlane don't show the blue plane
This is mainly useful for taking screen shots.
... list of views to display
A space separated list of the ids of views to display.
To create a MeshSlice viewer for robot0.wrl, robot1.wrl and robot2.wrl (indexed meshes) use:
MeshSlice robot 1 2 3
To compare the robot model under two sets of transforms, use the master and slave options:
MeshSlice robot -master /tmp/sync.txt -transDir trans_before 1 2 3 &
MeshSlice robot -slave /tmp/sync.txt -transDir trans_after 1 2 3 &