The first phase of beautification is "clustering": looking for near-coincidences. So far, these programs seek only two kinds of near-coincidences: nearly parallel lines, and nearly equal x- or y- coordinates. One interesting experiment is to try setting to zero one of the tolerances for near-coincidence; this tells the beautifier to correct only a subset of the near-coincidences.

For example, if the distance tolerance is zero, the beautifiers try to make nearly parallel lines parallel, but they ignore near-coincidences of x- or y-coordinates. The two beautifiers use different mechanisms in this case. The equational beautifier directs nearly parallel lines to have their average slope (thus using only linear equations); the genetic beautifier "aims" to make the lines be closer to parallel, but does not prescribe a particular slope.

On the other hand, if the angle tolerance is zero, the two beautifiers use somewhat more similar mechanisms. The equational beautifier creates constraint equations on adjacent pairs of nearly equal x- or y-coordinates; the genetic beautifier "aims" to make point clusters narrower.

Matters become more complicated when both tolerances are nonzero.

Coordinate and angle constraints are not independent. In the equational beautifier, suppose we try to equate the y-coordinates of the endpoints of a line segment, but do not set the goal angle to zero. Then, either the segment must shrink to a point(!) or one of the constraints will have to remain unsatisfied. (The beautifier described in SIGGRAPH '85 coped with this problem using special pleading for angles that were multiples of PI/4.)

Cluster widths on angles are in units of radians, while cluster widths on coordinates are in screen units. In the genetic algorithm, "fitness" is a scalar function. What is a good way to combine units in radians and in screen distances?

Return to beautifiers page.