[vtkusers] Intersection of two iso surfaces
Leo van Ruijven
LvRuijven at gmx.com
Tue May 3 03:41:07 EDT 2011
Hi Luke,
One way is to calculate the signed distance to f2_w for all points in the polydata representation of f1 and than extract the isocontour with value zero.
But be aware that the accuracy of the result approximates the average edge length of the polydata. So unless you sample f1 with a very fine grid, the result will not be very accurate. Also, the calculation of the signed distances may be more expensive than constructing a polydata representation from surface f2_w and intersect that with the polydata representation of f1.
regards,
Leo.
> Date: Sun, 1 May 2011 11:56:41 -0700
> From: Luke <hazelnusse at gmail.com>
> Subject: [vtkusers] Intersection of two iso surfaces
> To: vtkusers at vtk.org
> Message-ID: <BANLkTim8DahWWmV9S9gGnp6qdg_x8rhhBw at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> I have the following two real valued functions:
> f1(x,y,z) = 0
> f2(w,x,y,z) = 0
>
> And I would like to compute their intersection surface in the x,y,z
> space. In the x, y, z space, the intersection surface will be some
> sort of 2d surface parameterized by w.
>
> The first function is a fairly simple one and I have already used
> vtkImplicitFunction to plot the iso-surface of that function alone.
> The second function is computationally more expensive to evaluate.
>
> The next step I would like to do is to treat w as a parameter, and
> compute the intersection of f2_w with the surface defined by f1=0.
> This should result in a curve in the x,y,z space. I can imagine doing
> this for a large number of values of w, so that I get a bunch of
> curves in the x,y,z space, each defining the intersection of the two
> surfaces.
>
> It seems like the efficient way to do this is to compute the polydata
> for the first function's iso-surface (using vtkMarchingCubes), and
> then for every cell in that surface, compute the intersection with the
> function f2, for all the values of w that I decide upon. This would
> allow for the polydata of the first surface to only be traversed only
> once. What I'm not clear on is how to implement this second
> intersection testing for each cell of the first surface and for each
> different value of w.
>
> Finally, once I have all the the intersection curves for each value of
> w, is there a way to plot these as a surface, rather than a bunch of
> lines? This would give me what I am ultimately after, namely the 2d
> intersection surface in the x, y, z, space.
>
> Thanks,
> ~Luke
>
> --
> "Those who would give up essential liberty to purchase a little
> temporary safety deserve neither liberty nor safety."
>
> -- Benjamin Franklin, Historical Review of Pennsylvania, 1759
More information about the vtkusers
mailing list