petersvp wrote:
These days my head is puzzled in a crash in
return *(mCurrentVoxel + this->mVolume->getWidth());
Stack trace is:
Marching cubes:
execute() -> generateVerticesPerSlice -> computeCentralDifferenceGradient -> peekVoxel0px1py0pz
I'm afraid I don't have much insight here... but I do vaguely recall there was a bug with one of the peek..() functions long ago. Maybe try making the peek...() function always call getVoxel(), by removing the optimizaion? E.g. change:
Code:
template <typename VoxelType>
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel0px1py0pz(void) const
{
if( BORDER_HIGHY(this->mYPosInVolume) )
{
return *(mCurrentVoxel + this->mVolume->getWidth());
}
return this->mVolume->getVoxelAt(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume);
}
to
Code:
template <typename VoxelType>
VoxelType RawVolume<VoxelType>::Sampler::peekVoxel0px1py0pz(void) const
{
return this->mVolume->getVoxelAt(this->mXPosInVolume,this->mYPosInVolume+1,this->mZPosInVolume);
}
I'm really only guessing though.
petersvp wrote:
Maybe I am missing something, but I believe that execute() should at least be re-entrant?
On the same extractor object? If you call execute() simultaneously on
the same MarchingCubesSurfaceExtractor then I expect it will cause problems as it stores some state. If you call it simultaneously on two
separate MarchingCubesSurfaceExtractor instances then I would expect it to be ok. Unfortunately, as with all threading stuff in PolyVox this is largely untested.