|
|
Perhaps the wrong group, but I want to document something I
found.
I discovered while playing with R. Suzuki's density file
patch that when we use any interpolation type but 'no
interpolation' the density becomes vertex centered instead
of voxel centered. In other words the density specified by
the density file changes position.
With typical density files perhaps this has gone unnoticed,
but if using the density file with isosurfaces for example,
the density files can be quite small and the shift in
position is very noticeable.
If we want to stay voxel centered for all interpolation
types, we can accomplish it with some code like the
following. In the density_pattern function, in pattern.cpp,
just ahead of the interpolation switch block we would add:
interpolationType =
(TPat->Vals.Density_File->Interpolation % 10);
if ((interpolationType != NO_INTERPOLATION)
{ Ex -= (0.5 / (DBL)Data->Sx); // Result to voxel center
Ey -= (0.5 / (DBL)Data->Sx);
Ez -= (0.5 / (DBL)Data->Sx);
}
And the switch control statement would be changed to use the
already calculated interpolationType value.
Regards, Bill P.
Post a reply to this message
|
|