``` def draw_lines(self): index = 0 for line_type, end_point in self.path_points: # print line_type, end_point self.points.InsertNextPoint(end_point[:3]) self.colors.InsertNextTypedTuple(self.path_colors[line_type]) line = vtk.vtkLine() if index == 0: line.GetPointIds().SetId(0, 0) line.GetPointIds().SetId(1, 1) else: line.GetPointIds().SetId(0, index-1) line.GetPointIds().SetId(1, index) self.lines.InsertNextCell(line) index += 1 # free up memory, lots of it for big files self.path_points = [] self.poly_data.SetPoints(self.points) self.poly_data.SetLines(self.lines) self.poly_data.GetCellData().SetScalars(self.colors) self.data_mapper.SetInputData(self.poly_data) self.data_mapper.Update() self.path_actor.SetMapper(self.data_mapper) ```