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.101.

Figure 6.101. Transition Points

Transition Points

The Element in the middle has two transition points (marked with an X) where the Segments cross from the green to the magenta pixels.


The general procedure for snapping Nodes is as follows.

  1. Scan the current Skeleton to find candidate Nodes for snapping. The candidates are identified by the targets parameter.

  2. Loop over the Elements containing snappable nodes, and identify the transition points along each Segment of each Element.

  3. Find all possible snaps involving one or two Nodes of a single Element, assigning a priority to each according to the arrangement of its transition points. The priorities are listed in Table 6.5.

  4. Starting with the highest priority snaps (and choosing randomly from snaps with equal priorities) attempt to actually move the nodes. The move is accepted or rejected according to the given criterion parameter. When more than one snap is possible for one Element, all are attempted and the best is chosen. After successfully snapping the Nodes of an Element, the nodes of any neighboring snappable Elements are attempted, regardless of their priority.[35]

Because snaps with the same priority are attempted in a random order, undoing and repeating a SnapNodes operation may not reproduce the original result. For the same reason, repeating (without undoing) a SnapNodes operation may move Nodes that weren't moved the first time.

Table 6.5. Snapping Nodes

Element Type Quadrilateral Triangle
Priority 1 2 3 1 2
Type
Possible Snaps
 
 
     

Here's a simple example of snapping nodes of heterogeneous elements. Figure 6.102 shows a Skeleton that features some heterogeneous elements. The resulting Skeleton (after applying SnapNodes with α=1.0) is shown in Figure 6.103. The material boundaries have been resolved nicely, although many badly shaped elements have been created. This is because the procedure was performed with α=1, which emphasizes homogeneity and ignores shape.

Figure 6.102. Before Snapping Nodes

Before Snapping Nodes

A Skeleton with heterogeneous Elements.


Figure 6.103. After Snapping Nodes with α=1.0

After Snapping Nodes with α=1.0

After snapping nodes. All of the elements are still quadrilateral, although some have very short sides or corner angles of nearly 180°.


Snapping Nodes (like all Skeleton modifications) tends to produce badly-shaped elements when done with large values of α. However, SnapNodes is really a homogeneity oriented operation, and works best when given a large α. It's usually best to allow it to create badly shaped Elements, and to clean up afterwards by applying the Rationalize Skeleton modifier.

Figure 6.104 shows the same Skeleton, but after snapping with α=0.7 instead of 1.0. The elements have a much nicer shape, but very few nodes have been moved to material boundaries.

Figure 6.104. After Snapping Nodes with α=0.7

After Snapping Nodes with α=0.7



[35] This allows a series of snaps to zip along a line of Elements without introducing kinks.