public class SimpleSnapRounder extends Objectimplements Noder
SegmentStrings. Implements the Snap Rounding technique described in the papers by Hobby, Guibas & Marimont, and Goodrich et al. Snap Rounding assumes that all vertices lie on a uniform grid; hence the precision model of the input must be fixed precision, and all the input vertices must be rounded to that precision.
This implementation uses simple iteration over the line segments. This is not the most efficient approach for large sets of segments.
This implementation appears to be fully robust using an integer precision model. It will function with non-integer precision models, but the results are not 100% guaranteed to be correctly noded.
| Constructor and Description |
|---|
SimpleSnapRounder(PrecisionModel
|
| Modifier and Type | Method and Description |
|---|---|
void |
computeNodes(Collection
Computes the noding for a collection of
SegmentStrings.
|
void |
computeVertexSnaps(Collection
Computes nodes introduced as a result of snapping segments to vertices of other segments
|
Collection |
getNodedSubstrings()
Returns a
Collection of fully noded
SegmentStrings.
|
public SimpleSnapRounder(PrecisionModelpm)
public CollectiongetNodedSubstrings()
Noder
Collection of fully noded
SegmentStrings. The SegmentStrings have the same context as their parent.
getNodedSubstrings in interface
Noder
public void computeNodes(CollectioninputSegmentStrings)
Noder
SegmentStrings. Some Noders may add all these nodes to the input SegmentStrings; others may only add some or none at all.
computeNodes in interface
Noder
inputSegmentStrings - a Collection of NodedSegmentStrings
public void computeVertexSnaps(Collectionedges)
edges - the list of segment strings to snap together