5

I was reading the Wikipedia entry on Marching Squares, and was confused by the explanation of the saddle point disambiguation:

Ambiguous Case:

enter image description here

Basically, given the saddle points, the ambiguity is resolved by using the average data value for the center of the cell. I don't understand why this would help resolve the ambiguity. It seems to just select the longer pair of lines over the shorter pair. Is there any reason for this approach?

https://en.wikipedia.org/wiki/Marching_squares#Disambiguation_of_saddle_points

  • 2
    "It seems to just select the longer pair of lines over the shorter pair." What? All the red lines in the figure are the same length. –  Jun 01 '17 at 21:51

3 Answers3

5

Imagine that a black dot represents a value of -1 whereas a white dot represents a value of +1. You are looking for the iso-line(s) where each point upon the line is 0.

For this example you could either place the iso-lines like on the left or the right:

enter image description here or enter image description here

The difference between the solutions is the value in the center. In the left case we assume 1s whereas in the right solution we assume -1s. So we check the center value and based on that value decide which solution fits best. If the center value is 1, we pick the left solution. If the center value is -1, we choose the right solution.

JustABit
  • 176
  • 4
0

That disambiguation method often selects the shorter pair of line segments over the longer pair.

A different method which can be shown (with some algebra) to always select the shorter pair of line segments over the longer pair is based on bilinear interpolation, i.e. fitting a polynomial of the form
axy + bx + cy + d
to the given data values at the 4 corners of the cell.

The contour curve at height h is the locus of points (x, y) that satisfy
axy + bx + cy + d - h = 0.

Such a contour curve is a hyperbola, which has 2 branches. The portion of each branch of the hyperbola inside the cell is then approximated with a line segment connecting the intersection points of that branch with the 2 cell edges that it intersects.

0

Continuing on the answer by user3405743, using a bilinear model, we have that the intersection curve is an hyperbola with axis-aligned asymptotes, so we link the left intersection to the top or bottom one, whichever is leftmost (the segment lengths themselves are unimportant).

enter image description here

The piecewise bilinear model is appropriate in that it defines a continuous surface.