22 MeshType =
itk.Mesh[itk.F, Dimension]
25 def CreatePointOnlyMesh():
29 p0 = [-1.0, -1.0, 0.0]
39 print(
"Points = ", mesh.GetNumberOfPoints())
42 points = mesh.GetPoints()
43 for i
in range(points.Size()):
50 def CreateMeshWithEdges():
51 mesh = CreatePointOnlyMesh()
62 cells_array = np.zeros(4, dtype=np.uint64)
63 cells_array[0] = pointId0
64 cells_array[1] = pointId1
66 cells_array[2] = pointId2
67 cells_array[3] = pointId3
69 cells_vector = itk.vector_container_from_array(cells_array.flatten())
72 mesh.SetCellsArray(cells_vector, itk.CommonEnums.CellGeometry_LINE_CELL)
74 number_of_cells = mesh.GetNumberOfCells()
75 all_cells = mesh.GetCells()
78 for i
in range(number_of_cells):
79 current_cell = all_cells.GetElement(i)
80 point_ids = current_cell.GetPointIdsContainer()