예제 #1
0
    def AddShadedPointsActor(self, pc):
        """Add a point cloud with shaded points based on supplied normal vectors
        
        The NumPy array should have dimension Nx6 where the first three
        dimensions correspond to x, y and z and the last three dimensions
        correspond to surface normals (nx, ny, nz)
        """

        obj = VTKObject()
        obj.CreateFromArray(pc[:, 0:3])
        obj.AddNormals(pc[:, 3:6])
        self.pointObjects.append(obj)
        self.renderer.AddActor(obj.GetActor())
        return obj
예제 #2
0
    def AddNormalsActor(self, pc, scale):
        """Add a set of surface normals to the visualizer
        
        The input is a NumPy array with dimension Nx6 with (x,y,z) and
        (nx,ny,nz) values for the points and associated surface normals
        
        The normals will be scaled according to given scale factor"""

        obj = VTKObject()
        obj.CreateFromArray(pc[:, 0:3])
        obj.AddNormals(pc[:, 3:6])
        obj.SetupPipelineHedgeHog(scale)
        self.pointObjects.append(obj)
        self.renderer.AddActor(obj.GetActor())
        return obj