[vtkusers] slicing artifact when rendering semi-transparent mesh

leonid leonid.gluhovsky at gmail.com
Mon Jun 19 04:09:37 EDT 2017


Dear all,

I have a triangle mesh with no non-manifold edges, with computed normals and
correctly oriented
triangles.  The mesh is available at:

        http://schket.freeshell.org/prog/chamber-euclidean.vtk

I want to render it semi-transparent.

Paraview renders it perfectly.  But when I render it in VTK, using this
straightforward code:

    import vtk

    def main():
        window = vtk.vtkRenderWindow()
        window.SetSize(500, 500)
        ren = vtk.vtkRenderer()
        window.AddRenderer(ren)
        interactor = vtk.vtkRenderWindowInteractor()
        interactor.SetRenderWindow(window)
        interactor.Initialize()
        reader = vtk.vtkXMLPolyDataReader()
        reader.SetFileName('chamber-euclidean.vtp')
        reader.Update()
        polydata = reader.GetOutput()
        mapper = vtk.vtkPolyDataMapper()
        mapper.SetInputData(polydata)
        actor = vtk.vtkActor()
        actor.SetMapper(mapper)
        actor.GetProperty().SetOpacity(0.5)
        ren.AddActor(actor)
        interactor.Start()

    main()

I get artifacts which look like there are some slicing planes inside the
mesh (in reality there
are none).

The artifacts are observed only at certain viewing angles.

You can see an image with artifacts here:

        http://schket.freeshell.org/prog/artifact-image2.png

The artifacts occur both with VTK 6.3 and vtk 7.0, both on Windows and on
Linux.  The hardware
is NVIDIA.  Paraview on the same hardware renders without artifacts.

What am I doing wrong?  How to get rid of them?

Many thanks,

leonid

                                           



--
View this message in context: http://vtk.1045678.n5.nabble.com/slicing-artifact-when-rendering-semi-transparent-mesh-tp5743682.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list