OOF2: The Manual
Name
Snap Refine (SnapRefine) — Subdivide elements along pixel boundaries.
Synopsis
SnapRefine
(targets
,criterion
,min_distance
)
Details
-
Base class:
SkeletonModifier
-
Parameters:
targets
- Target elements to be refined. Type: An object of the
RefinementTarget
class. criterion
- Exclude certain elements. Type: An object of the
RefinementCriterion
class. min_distance
- Minimum distance of transition points along a given edge from each other and the end-points, in units of the maximum pixel dimension. Type: A real number in the range [0.01, 3].
Description
SnapRefine
is a SkeletonModifier that attempts to
combine the most desirable features of Refine and SnapNodes into a single method. The
method operates like Refine,
except that the Element
Segments
are split by points located at the
interface of two different pixel
categories. These points become the corners of new elements
that subdivide the original elements. Figure 6.106 illustrates the result of applying
SnapRefine
to the starting Skeleton
depicted
in Figure 6.105.
SnapRefine
can yield a Skeleton
with a
comparable homogeneity to a Skeleton
produced by Refine, but often with significantly
fewer elements. SnapRefine
can also be
more flexible than SnapNodes in
fitting a Skeleton
to a microstructure, because
SnapRefine
introduces new nodes and
additional edges that can be made to follow the boundaries of
pixel categories. For example, Figure 6.107 shows the result of using the
standard Refine method and the
result of using the stand-alone SnapNodes method on the original
Skeleton
.
Figure 6.107. Refine and Snap Separately

The result of Refineing
the Skeleton
from Figure 6.105.

The result of appling SnapNodes directly to the Skeleton
in Figure 6.105. Most borders are
resolved well, but some aren't resolved at all.
However, SnapRefine
can lead to the
creation of very thin elements (see Figure 6.106). The creation of such
badly-shaped elements may be prevented in many cases by a
judicious choice of the parameter min_distance
.
SnapRefine
will not place a new Node
within a distance min_distance
of one of the
corners of an Element
. min_distance
is given in
units of the pixel size.[36]
In general, iterating SnapRefine
produces
very bad results, with a lot of very thin elements. A good
strategy is often to use the regular Refine method first, and to apply
SnapRefine
just once at the end to smooth
out jagged edges.
Currently, SnapRefine
finds at most two transition
points along an edge.
The method also generates
both triangular and quadrilateral elements liberally
(corresponding to the liberal rule set in Refine). Note also that
SnapRefine
does not use an alpha
parameter. Instead, it takes into account the pixel categories
underneath the element edges, as well as the bisection of the
edges, when deciding among several ways of subdividing an
element. The subdivision of an element may also introduce new
nodes within the element. These nodes may also be located at the
interface of pixel categories.