5
$\begingroup$

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

$\endgroup$
1
  • 2
    $\begingroup$ "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. $\endgroup$
    – user106
    Commented Jun 1, 2017 at 21:51

3 Answers 3

5
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ But what if the values are all different ? $\endgroup$
    – user1703
    Commented Apr 24, 2023 at 10:31
  • $\begingroup$ @YvesDaoust Which values do you mean? $\endgroup$
    – JustABit
    Commented Jul 18, 2023 at 8:03
1
$\begingroup$

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.

$\endgroup$
0
$\begingroup$

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 $\left(x,y\right)$ that satisfy $$ axy + bx + cy + d - b = 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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.