OOF2: The Manual
Name
Swap Edges (SwapEdges) — Rearrange internal edges in pairs of neighboring elements.
Synopsis
SwapEdges
(targets
,criterion
)
Details
-
Base class:
SkeletonModifier
-
Parameters:
targets
- Which elements to modify. Type: An object of the
SkelModTargets
class. criterion
- Acceptance criterion Type: An object of the
SkelModCriterion
class.
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.
The general procedure for SwapEdges
is as follows:
-
Create a list of
Elements
chosen by thetargets
parameter. To avoid any potential artifacts from the internal ordering ofElements
, the list of targetElements
is shuffled. -
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).
-
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, theElement
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.