"Karsten Rodenacker" <Karsten@rodenacker.de> wrote in message
news:opshchejoj9g3e7u@llkaro.gsf.de...
> After reading several entries in the news list concerning ISOSURFACE,
> SHADE_VOLUME, INTERVAL_VOLUME, MESH_... I am still a bit confused.
>
> Look at the attached piece of code, where a 15^3 volume containing a 3^3
> cube of value 100 is displayed using the mentioned idl routines with
> different values/isovalues/thresholds.
>
> ISOSURFACE is dispayed at Z=0, SHADE_VOLUME at z=-4 and INTERVAL_VOLUME at
> z=+4. Beside the strange volumes calculated, I had expected nearly
> simmilar results, ISOSURFACE does not follow SHADE_VOLUME as described in
> the help, in fact it is seemingly using INTERVAL_VOLUME, at least
> partially.
>
> Maybe there are some experts to explain this behaviour.
>
> However I have the impression that the graphics folks seem to have still a
> long way to find a common language.
>
> Any help is appreciated
OK, step by step.
IDL> r=bytarr(15,15,15)
IDL> r[6:8,6:8,6:8]=100
IDL> isosurface,r,100,v,c
IDL>
print,'ISOSURFACE',100,mesh_volume(v,c),mesh_validate(v,c,/c ombine),mesh_vol
ume(v,c)
ISOSURFACE 100 0.000000 48 8.00000
I think ISOSURFACE has a problem where it can emit two vertices located at
the same point, where it should have emitted only one. Before you combine
the vertices with MESH_VALIDATE, the mesh wasn't consistent and that's why
MESH_VOLUME didn't think that the mesh defined a closed volume. I hope to
fix this in the next release.
IDL> isosurface,r,50,v,c
IDL>
print,'ISOSURFACE',50,mesh_volume(v,c),mesh_validate(v,c,/co mbine),mesh_volu
me(v,c)
ISOSURFACE 50 24.1667 272 24.1667
The above-mentioned problem with ISOSURFACE comes up only when the isovalue
causes the surface to be exactly on the volume grid boundaries. With an
isovalue of 50, the surface is between the grid points, so it works.
IDL> isosurface,r,1,v,c
IDL>
print,'ISOSURFACE',1,mesh_volume(v,c),mesh_validate(v,c,/com bine),mesh_volum
e(v,c)
ISOSURFACE 1 52.5773 272 52.5773
Same as the above discussion.
IDL> isosurface,r,2,v,c
IDL>
print,'ISOSURFACE',2,mesh_volume(v,c),mesh_validate(v,c,/com bine),mesh_volum
e(v,c)
ISOSURFACE 2 51.8293 272 51.8293
Same as above. The results are the expected ones.
IDL> shade_volume,r,99,v,c
IDL>
print,'SHADE_VOLUME',99,mesh_volume(v,c),mesh_validate(v,c,/ combine),mesh_vo
lume(v,c)
SHADE_VOLUME 99 8.24121 104 8.24120
SHADE_VOLUME doesn't suffer from the ISOSURFACE issue I mentioned above.
But it produced no vertices with a value of 100. So, that's a difference
between the SHADE_VOLUME and ISOSURFACE routines. It looks like
SHADE_VOLUME does not include the samples that are exactly equal to the
isovalue as part of the isosurface, while ISOSURFACE does, and I'm not sure
which is the more accepted practice in the industry. I'll look into it and
perhaps consider a keyword to control the "less than" vs "less than or equal
to" aspect.
IDL> shade_volume,r,50,v,c
IDL>
print,'SHADE_VOLUME',50,mesh_volume(v,c),mesh_validate(v,c,/ combine),mesh_vo
lume(v,c)
SHADE_VOLUME 50 23.1667 104 23.1667
So this differs from the ISOSURFACE values of about 24. I think that the
correct ideal value is 27, since your isovalue defines a volume that should
be 3x3x3. Both SHADE_VOLUME and ISOSURFACE appoximate the true or ideal
isosurface. Both algorithms work by computing the intersection of the true
isosurface with a regular grid. In the case of SHADE_VOLUME, the grid is a
grid of cubes. In the case of ISOSURFACE, the grid is a grid of tetrahedra.
ISOSURFACE uses 5 tetrahedra for every cube that SHADE_VOLUME uses, so it
will produce better results, as we just showed.
You can improve the accuracy of both routines by increasing the number of
samples. Your grid is pretty coarse.
And the INTERVAL_VOLUME results are closer to that of ISOSURFACE, because
both use tetrahedral grids.
Hope this helps,
Karl
|