[vtkusers] Intersection of two iso surfaces

Luke hazelnusse at gmail.com
Mon Dec 5 22:21:37 EST 2011


> Since Marching Cubes works on a discrete grid, you might find multiple
> roots is you try to refine the vertex with a continuous function.

I was thinking something along the lines of the following.

For each point (x, y, z) that is generated by vtkContourFilter, we have:

f1(x, y, z) ~= c

I'm not sure how big abs(f1(x,y,z) - c) would be, but I think it is
conservatively upper bounded by the square root of the sum of the
squares of the discretizations:

abs(f1(x,y,z) - c) <= sqrt(dx^2 + dy^2 + dz^2)

It is probably much better than this, but I know for sure each point
from Marching cubes can't be any further from the iso-surface than the
hypotenuse of the cube.  In any event, we have points that are "close"
to the surface.

So, what I was think was to use a Newton-Raphson on f1, with y and z
treated as constants, and to use each point from vtkContourFilter as
the initial guess that would be "close" to the actual surface.  So
this would "polish" the roots by adjusting the x coordinate to ensure
find x_new such that

abs(f1(x_new, y, z)-c) < eps

where eps would be the desired level of accuracy.  It would probably
be good to examine the gradient of f1 at each point to determine
whether to adjust x, y, or z.  I can imagine more elaborate approaches
which move in the direction of the gradient, but I think this simple
way would work well as long as you started out with a pretty small
mesh and were dealing with relatively well behaved functions.  But
yeah, any time you use a Newton-Raphson, you have to be careful you
don't jump out into left field or converge to the wrong root.

~Luke



More information about the vtkusers mailing list