[vtkusers] Problems using vtkExtractEdges with vtkUnstructuredGrid, quadratic solid cell types

scotsman60 doug at beachmailing.com
Wed Sep 27 04:30:32 EDT 2017


Hello,

For completeness, and to help anyone else who runs into problems trying to
get correct free edges on higher order cells, here is what I implemented and
find to be working nicely

            uggFilter = vtk.vtkUnstructuredGridGeometryFilter()
            uggFilter.SetInputData(self.mesh)
            
            edges = vtk.vtkExtractEdges()
            edges.SetInputConnection(uggFilter.GetOutputPort())
            
            edgeMapper = vtk.vtkDataSetMapper()
            edgeMapper.SetInputConnection(edges.GetOutputPort())

            self.freeEdgeActor = vtk.vtkActor()
            self.freeEdgeActor.SetMapper(edgeMapper)
            self.freeEdgeActor.GetProperty().BackfaceCullingOn()   
            self.freeEdgeActor.GetProperty().SetDiffuseColor(0, 0.5, 0)
            self.freeEdgeActor.GetProperty().SetEdgeVisibility(1)
            self.freeEdgeActor.GetProperty().SetEdgeColor(1, 0, 0)

I have another actor that actually draws the Faces so that I get a shaded
with edges style plot

            meshFreeSurfaceFilter = vtk.vtkDataSetSurfaceFilter()
            meshFreeSurfaceFilter.SetInputData(self.mesh)
            meshFreeSurfaceFilter.Update()
                       
            meshFreeSurfaceMeshMapper = vtk.vtkDataSetMapper()
           
meshFreeSurfaceMeshMapper.SetInputDataObject(meshFreeSurfaceFilter.GetOutput())
                
            self.freeFaceActor = vtk.vtkActor()
            self.freeFaceActor.SetMapper(meshFreeSurfaceMeshMapper)
            #self.freeFaceActor.GetProperty().SetRepresentationToWireframe()
            self.freeFaceActor.GetProperty().BackfaceCullingOn()   
            self.freeFaceActor.GetProperty().SetDiffuseColor(0, 0.5, 0)
            self.freeFaceActor.GetProperty().SetEdgeVisibility(0)
            self.freeFaceActor.GetProperty().SetEdgeColor(1, 0, 0)
            self.freeFaceActor.GetProperty().SetOpacity(0.5)



Doug




--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html


More information about the vtkusers mailing list