Vision and Mobile Robotics Laboratory | Software
|
|
Home | Members | Projects | Publications | Software | Videos | Internal |
This program provides methods for setting the orientatation of surface normals in a mesh. In the wrl files, the normals are not represented explicitly. Instead, they are encoded in the ordering of the points within each triangle. Within the MeshToolbox, we define triangles in counter clockwise order when viewed from the top (i.e., if a triangle contains points p1, p2, and p3, normals are computed from the cross product of p2-p1 with p3-p1).
Usually, a sensor will output triangles in a consistent fashion, and the resulting
wrl file can be used as is. The other programs within the MeshToolbox (e.g.,
CleanMesh, IntegrateMeshes) will produce surface meshes with consistent normals
provided their input meshes have consistent normals. On the rare occasion that
the normals in a surface mesh are found to be inconsistent, the Orient program
can be used to correct the problem. This is the only place in the MeshToolbox
where normals are changed. The ShowNormals program can be used to verify the
correctness of surface normal orientation.
Orient.c - the main program. Just a command line interface for calling routines in the surfaceMesh library.
By typing Orient - the following options (format description default) are printed:
Usage: Orient (see orient.html for complete usage)
%S in mesh filename [required]
%S out mesh filename [required]
-flip reverse order of points in triangles
-toPoint %F %F %F point to orient normals to
-out orient normals out
-in orient normals in
%S in mesh filename [required]
Name of the input wrl file.
%S out mesh filename [required]
Name of the output wrl file, which has modified normals.
-flip reverse order of points in triangles
Reversing the order of points will flip all normals.
-toPoint %F %F %F point to orient normals to
Useful for pointing the normals toward the sensor origin.
-out orient normals out
Orient the normals outward with respect to the centroid of the data points. This only works well for convex objects. Also, disconnected patches are treated separately, each oriented with respect to the centroid of that patch.
-in orient normals in
Performs the inverse of the -out option, except that the normals will be flipped.
To flip all the normals in orig_mesh.wrl:
Orient orig_mesh.wrl flipped_mesh.wrl -flip