Make Symmetrical/Parent


Introduction

Maintaining symmetry can be problematic in Lightwave. Negative floating-point values have different internal representations, and what happens is that symmetrical points deviate in their x-position as multiple transformation functions are applied. This makes it difficult for the plugin  developer to maintain symmetry. Even some of my own tools are guilty of breaking symmetry sometimes, along with some of Lightwave's own native tools.

I personally feel that it should not be the plugin developer's responsibility to maintain symmetry. I think the ideal solution needs to come from the ground up. A great way to solve the problem is to use virtual geometry and make it so that the mirrored side of the geometry is inaccessible (both to the user and to the plugin developer).  All low-level mesh-editing functions can therefore be coded to ensure that the virtual side remains symmetrical, so that the plugin developer using these functions can write whatever code he pleases to affect the original side of  the geometry without ever breaking the other side. It would also serve to protect the user from having symmetry broken in his model when using specific plugins. If a user is in symmetry mode, obviously he/she does not want a plugin to make the model asymmetrical. Right now, the symmetry issue is just a major pain in the neck  for the plugin developer. Not only do we have to deal with symmetry manually, but the SDK does not even allow us to find out, without manually comparing each point's position, what pair of points are supposed to be symmetrical to each other.

To alleviate the symmetry problem, I developed Symmetry Manager. Basically, it will point out which points are asymmetrical and will correct them for you automatically.


Why is this useful? In many situations, you can simply delete half of the model and re-mirror the missing side to restore symmetry. However, when you have asymmetrical vertex maps on a symmetrical model (like an asymmetrical texture map), doing this will destroy the asymmetry of the vertex maps you have created. It is in these cases that you  need a symmetry 'fixer' rather than a symmetry 'creator.'

There is already a plugin that attempts to repair symmetry by Colin Cohen called
SymmRepair . You can find it at http://cohen-plugs.tripod.com/. Kudos to him for making the first symmetry repair tool, but I developed this out of a need for a more thorough solution.  The algorithm for his plugin works basically like this (highly simplified and does not account for left or right or center-point repairs):
For every point A:
Find *a* point B on the opposite side whose distance from the mirrored position 
of A is within the threshold provided.

Set point B's position to the mirrored position of A.
Repeat for the next point.
There are some issues with this approach. The biggest problem is that it only finds *a* point within the threshold  value, not the closest point to the mirrored position of A. As a result, it's probable that two or more points on the opposite side of A could be well within the threshold, and the plugin will simply choose the first point that it finds. As Mr. Cohen states on his page, too high a tolerance may cause points to be mismatched.

Also, with only the threshold value to use for matching, the plugin is problematic for correcting large selections in an object where the density of points varies. There will be no perfect threshold value that will correct the problem in one go in these cases, since a high threshold will cause the dense areas to be mismatched, and a low threshold will cause the sparse areas to not be matched at all. The plugin is more useful for manually correcting a few points at a time with varying thresholds.

The way my plugin works is like this:

For every point A:
Find *the best* point B on the opposite side whose distance from the mirrored 
position of A is within the threshold provided and is closer to the mirrored 
position of A than any other point.

Record the distance from A and B along with points A and B into a record within the 'Match List.'
Repeat for the next point.

Sort the Match List in order from the lowest distance to the highest distance.

For each record in the Match List:
If points A and B have not been symmetrized:
set B's position to the mirrored position of A.
Mark points A and B as having been symmetrized.
Repeat for the next record.
My plugin just adds several extra steps, but it makes a big difference. By finding the closest point instead of any point within a threshold, the threshold becomes less important. It doesn't determine the match, only the candidates considered for the match among which the best is chosen. The only time you'll get a mismatch is if you have multiple points selected and the symmetry is so off that another point is closer to the mirrored position of the opposite point than the intended point. This won't be the case if the symmetry in your model is lost just because of floating-point inaccuracies.

It also comes with a feature to view erroneous points to give you a preview of what points will be adjusted. This will also allow you to make sure that none of the points are way off. If they are, use my other tool, Make Symm, to correct those stray points.


Using Symmetry Manager



Here's a very asymmetrical model for the purposes of illustration. To correct the symmetry, open up Symm Manager.



The first thing you usually want to do is see what points are asymmetrical. To do this, hit 'Select Erroneous Points' or press the hotkey (S). Here is the result:



There are 18 asymmetrical points in this model and they're pretty far off. Normally, you might want to try Make Symm to fix some of those points that are really off. However, let's give symmetry manager a shot (you can always undo if you don't like the results).

At this point, we can do the more efficient 'fix selected' operation since we have all the erroneous points selected. However, just for the sake of seeing testing the extent of symmetry manager, let's try 'fix all' by pressing the 'A' key. I'll stay with the left->right option which will make the right side match the left side. Here is the result:



All 18 points were fixed. You can make sure everything's fine by doing 'select erroneous points' once again. The plugin should report that there are 0 asymmetrical points if everything was fixed.


Settings



Symmetry Tolerance - this sets the distance tolerance which determines what points are considered asymmetrical. Lightwave itself uses a symmetry tolerance (points don't have to be perfectly mirrored across the X points for them to be considered symmetrical by Lightwave). You can adjust this tolerance, but the default number I have it on seems to be pretty close to Lightwave's own tolerance.

Fix Threshold - this determines how close points have to be to each other's mirrored positions for them to be symmetrized by the 'fix selected' and 'fix all' operations. If you have the threshold set to 5 meters and the closest point to an asymmetrical point's mirrored position is greater than 5 meters, that asymmetrical point will not be corrected.

Use threshold - determines whether to use the fix threshold above. Normally, the fix threshold isn't necessary - you can usually get perfectly satisfactory results without it. Only consider using it if you want to try to automatically repair a model with some points that are really far off and want to place limitations on what to fix. In these cases, it's usually better to repair a few of those points first with Make Symm.

Select Erroneous Points - selects asymmetrical points in the viewport and reports how many were selected. This is a good visual tool.

Fix All - re-symmetrizes all points in the object if necessary.

Fix Selected - re-symmetrizes the selected points using only the selected points for matching.

Restore Default Settings - restores the default tolerance, threshold, and use threshold settings.

Quit - closes the panel and allows you to resume modeling.

Return to index.