OOF2: The Manual

Name

Snap Nodes (SnapNodes) — Move nodes directly to pixel boundaries.

Synopsis

SnapNodes(targets, criterion)

Details

Description

SnapNodes moves Nodes to improve the Elements' Homegeneity Energy. If an Element edge crosses over regions of the Microstructure belonging to different pixel categories, then SnapNodes tries to move one of the Element corners to the crossing point. These points are called transition points, and are illustrated in Figure 6.107. See Section 2.4.4 for more on transition points and how they're detected.

Figure 6.107. Transition Points

Transition Points

The central Element has two transition points (marked with circles) where the Segments cross from the blue to the white pixels.


The general procedure for snapping Nodes is as follows.

  1. Scan the current Skeleton and build a list of candidate Nodes for snapping. The candidates are identified by the targets parameter. Randomize the list.

  2. Loop over candidate nodes, N.

    1. Loop over the candidate's neighbor nodes, M.

    2. If the segment NM hasn't been examined already, try moving each node, or both at once, to all the transition points on any of their Segments. Pick the combination move that best satisfies the specified acceptance criterion.

    3. Remove node N from the list of candidate nodes. Move node M to the top of the list, so that it's examined next.

    4. Go back to step 2 until the list is empty.

Figure 6.108 shows a Skeleton that features some heterogeneous elements and the result of applying SnapNodes with targets=SnapAll() and criterion=AverageEnergy(alpha=0.7) to it. Some, but not all, of the material boundaries have been resolved nicely.

Figure 6.108. Snapping Nodes

Snapping Nodes

(a) A Skeleton with heterogeneous Elements.

(b) The result of applying SnapNodes with alpha=0.7. In many places the element boundaries now follow the pixel boundaries.


Snapping Nodes (like all Skeleton modifications) tends to produce badly-shaped elements when done with large values of alpha. The Skeleton in Figure 6.109(a) is the result of increasing alpha to 0.9 in the previous operation. The element edges follow the upper-right part of the blue region and the upper-left part of the red region much more closely. However the three Elements marked in green and labeled Degenerate are very badly shaped. They appear to be triangles, but the two smaller ones are quadrilaterals with a very short side where they join, and the other is actually a quadrilateral with a nearly 180° angle at one node. The shape energy of the first two is almost maximally bad, 0.99, and the third's is 0.93.

The upper two green Elements labeled Inhomogeneous in Figure 6.109 illustrate a configuration that is impossible to improve with SnapNodes alone. It's not possible to fix these Elements just by moving Nodes.

However, it can be useful to allow SnapNodes to create badly shaped Elements, and to clean up afterwards by applying other tools. The Skeleton in Figure 6.109(b) is the result of applying Rationalize and SplitQuads to the problem Elements in (a). These tools can often fix messes left behind by SnapNodes.

Figure 6.109. Snapping Nodes with a Large alpha

Snapping Nodes with a Large alpha

(a) The result of using SnapNodes with a large alpha, 0.9, on the Skeleton in Figure 6.108(a). It has produced some badly shaped Elements and failed to make all of the rest homogeneous.

(b) The result of applying Rationalize and SplitQuads to the Skeleton in (a). The degenerate quadrilaterals have been converted to triangles by merging nodes (although that's not obvious in the image) and by splitting the large obtuse angle. The inhomogeneous quads have each been split into two homogeneous triangles.


See Also