Skip to content

Commit

Permalink
It wasn't showing surface when opening a inv3 proj
Browse files Browse the repository at this point in the history
  • Loading branch information
tfmoraes committed Jun 30, 2016
1 parent ac56ced commit 5cbf2e5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions invesalius/data/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,21 +351,22 @@ def OnLoadSurfaceDict(self, pubsub_evt):
surface_dict = pubsub_evt.data
for key in surface_dict:
surface = surface_dict[key]

# Map polygonal data (vtkPolyData) to graphics primitives.
normals = vtk.vtkPolyDataNormals()
normals.SetInputData(surface.polydata)
normals.SetFeatureAngle(80)
normals.AutoOrientNormalsOn()
# normals.GetOutput().ReleaseDataFlagOn()

# Improve performance
# Improve performance
stripper = vtk.vtkStripper()
stripper.SetInputData(normals.GetOutput())
stripper.SetInputConnection(normals.GetOutputPort())
stripper.PassThroughCellIdsOn()
stripper.PassThroughPointIdsOn()

mapper = vtk.vtkPolyDataMapper()
mapper.SetInputData(stripper.GetOutput())
mapper.SetInputConnection(stripper.GetOutputPort())
mapper.ScalarVisibilityOff()
mapper.ImmediateModeRenderingOn() # improve performance

Expand Down

0 comments on commit 5cbf2e5

Please sign in to comment.