Talk:VTK/Examples/Python: Difference between revisions
From KitwarePublic
Jump to navigationJump to search
(abc) |
(abc) |
||
Line 26: | Line 26: | ||
line.InsertCellPoint(4) | line.InsertCellPoint(4) | ||
line.InsertCellPoint(6) | line.InsertCellPoint(6) | ||
# Add the verteics and edges to unstructured Grid | # Add the verteics and edges to unstructured Grid | ||
G = vtk.vtkUnstructuredGrid() | G = vtk.vtkUnstructuredGrid() |
Revision as of 18:38, 23 April 2015
# Establish the specified edges using CellArray line = vtk.vtkCellArray() line.Allocate(8) line.InsertNextCell(2) line.InsertCellPoint(0) line.InsertCellPoint(1) line.InsertNextCell(2) line.InsertCellPoint(0) line.InsertCellPoint(2) line.InsertNextCell(2) line.InsertCellPoint(2) line.InsertCellPoint(3) line.InsertNextCell(2) line.InsertCellPoint(2) line.InsertCellPoint(4) line.InsertNextCell(2) line.InsertCellPoint(3) line.InsertCellPoint(4) line.InsertNextCell(2) line.InsertCellPoint(3) line.InsertCellPoint(5) line.InsertNextCell(2) line.InsertCellPoint(4) line.InsertCellPoint(5) line.InsertNextCell(2) line.InsertCellPoint(4) line.InsertCellPoint(6) # Add the verteics and edges to unstructured Grid G = vtk.vtkUnstructuredGrid() G.GetPointData().SetScalars(degree) G.SetPoints(Points) G.SetCells(vtk.VTK_LINE, line)