1. Stefan Göbel
  2. oppositeFace


oppositeFace 0.2

Autodesk Maya plugin to find opposite faces in a polygon mesh.

Note: This plugin was developed for Autodesk Maya 2009, and only tested
with this version. It is likely to work with any later version, though,
the relevant APIs seem to be unchanged.

This plugin provides the following function:


Find the opposite face to the selected face in the same polygon mesh.


    -offset       (-o)    default: 0.01
    -tolerance    (-t)    default: 1e-6
    -distance     (-d)    default: 1000

It seems that all values have to be specified in cm no matter what the
current unit is set to. This may be the case only for specific versions
of Autodesk Maya.


Select a face of a polygon mesh and run the oppositeFace command. The
return value of the command will be a list with this information:

    [ face_number, distance, hit_point_x, hit_point_y, hit_point_z ]

    face_number  -  the index of the opposite face
    distance     -  distance between the two faces
    hit_point_*  -  x, y and z coordinates of the hit point

All the list elements are strings, you need to explicitely convert the
values if required!

The function will start the search for an opposite face at a point
located in -offset distance from the center of the selected face (in
negative face normal direction), the search will continue in negative
normal direction until a face of the same (!) polygon mesh is hit. The
point hit on that polygon will be returned in hit_point_x, hit_point_y
and hit_point_z (ie. the last three elements of the result list). These
are world space coordinates.

The -distance parameter specifies the maximum distance within which hits
will be considered.

The -tolerance parameter is directly passed to the API function
MFnMesh::closestIntersection, please consult the API documentation for
more details:


If no face was found face_number will be "-1", all other values will be


Modify the Makefile according to your needs, then run


You need to copy the compiled plugin to an appropriate directory so it
can be accessed by Maya. Please see the Maya documentation for details.

Copyright And License

Copyright 2009, 2014 Stefan Göbel - <oppositeface -at- subtype -dot- de>

This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.