OOF2: The Manual

Name

Swap Edges (SwapEdges) — Rearrange internal edges in pairs of neighboring elements.

Synopsis

SwapEdges(targets,criterion)

Details

Description

SwpaEdges rearranges the interior Segments of neighboring Elements to improve their shape energy or homogeneity. The possible rearrangements are shown in Table 6.6.

Table 6.6. Swap Possibilities

Original Pair Possible Rearrangements
1 2 3 4
   
     

The general procedure for SwapEdges is as follows:

  1. Create a list of Elements chosen by the targets parameter. To avoid any potential artifacts from the internal ordering of Elements, the list of target Elements is shuffled.

  2. Loop over the target elements and start swapping edges. For each element, all of its neighboring elements are considered for swapping and temporarily will be swapped in all of the possible ways (see Table 6.6).

  3. At each site the configuration of Elements that best satisfies the specified criterion will be chosen and finalized. If none of the possible swap cases satisfies the given criterion, the Element will not be processed at all.

Here's a simple example of swapping edges. Figure 6.112 shows a Skeleton that features some element pairs (with thicker lines), which are to swap edges. The resulting Skeleton is shown in Figure 6.113. Two pairs (top and bottom ones) have improved their shape energy significantly. The pair in the middle has improved both shape energy and homogeneity.

Figure 6.112. Before Swapping Edges

Before Swapping Edges

Three pairs are ready to swap their edges.


Figure 6.113. After Swapping Edges

After Swapping Edges

A better looking Skeleton after swapping.