[vtkusers] cracked surfaces

henrikw at hgu.mrc.ac.uk henrikw at hgu.mrc.ac.uk
Mon Mar 27 10:38:11 EST 2006


Hello vtkusers,

I am having a problem with VTK 4.2/Python2.3.4 which involves viewing surfaces
when some opacity is used. 

I create a surface using vtkMarchingCubes from some SLC data. The data is first
smoothed with VtkImageGaussianSmooth(). vtkMarchingCubes is run using the
following code.

mcSurf = vtkMarchingCubes()
mcSurf.SetInput(smImg.GetOutput())
mcSurf.ComputeScalarsOff()
mcSurf.ComputeGradientsOff()
mcSurf.ComputeNormalsOn()
mcSurf.GetOutput().ReleaseDataFlagOn

I then change the opacity using vtkActor.GetProperty().SetOpacity(). When the
opacity goes below 1.0 then the cracks/holes appear on the surface.

I believe the cracking has something to do with normals pointing in the opposite
direction to the rest of the triangles. I have tried using vtkPolyDataNormals to
recalculate the normals using different options but I always get the same result.

There is a sample image at http://homepages.inf.ed.ac.uk/s9638800/img.jpeg

Any help would be appreciated,

Henrik



More information about the vtkusers mailing list