I have added some more options for various objects.
for simple objects.
place axis at peak of objects.
for tube like objects, with parallel lines to Z axis.
for circular truncated cones, without any parallel lines.
11th Moon/ Toshio Fuji/ firstname.lastname@example.org/ 20111122
This XPresso restores axis position and direction, from reference points in the polygon.
First, please make a null object named like “axis”,
then place it under the polygon object you want to restore axis.
Next, apply this XPresso to the “axis”.
Select 1 or 2 points (A, A and B) and press “get center point” button.
case 1 point; Then the “axis” is moved to the point (A).
case 2 points; Then the “axis” is moved to center of the points ((A + B)/2),
Also X axis is rotated to one of the points (A or B, use “reverse X axis” option to select one).
If you selected only 1 point in previous step, Select 1 point (B) and press “get X axis” button.
Then X axis is rotated to the point (B). Else skip this step.
Select 1 or 2 point (C, C and D) and press “get Z axis” button.
case 1 point; Then Z axis is rotated to the point ©.
case 2 points; Then Z axis is set to parallel to vector (C - D or D - C, use “reverse Z axis” option to select one).
case 2 points (“use center point” option enabled); Then Z axis is rotated to center of the points ((C + D)/2).
After that, X axis should be rotated from the point (B), to keep axes orthogonal.