You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug, what's wrong, and what you expected.
I am plotting an unstructured grid and trying to edit things in there while I have a Plotter open. The focal point of the camera doesn't always go the cursor, but in some cases it does. In the video I added, I first pressed 'f' with the cursor on the top block and then on the bottom block. The focal point goes to the correct point for the lower block but not for the upper one.
Steps to reproduce the bug.
importnumpyasnpimportvtkimportpyvistaaspvfrompyvistaimportCellTypedeftestFunction(selected_grid):
ifnotselected_grid.n_cells:
returnghost_cells=np.zeros(grid.n_cells, np.uint8)
ghost_cells[selected_grid['orig_extract_id']] =1grid.cell_data[vtk.vtkDataSetAttributes.GhostArrayName()] =ghost_cellsgrid.RemoveGhostCells()
cells=np.array([8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15])
# cell type array. Contains the cell type of each cellcell_type=np.array([CellType.HEXAHEDRON, CellType.HEXAHEDRON])
# in this example, each cell uses separate pointscell1=np.array(
[
[0, 0, 0],
[1, 0, 0],
[1, 1, 0],
[0, 1, 0],
[0, 0, 1],
[1, 0, 1],
[1, 1, 1],
[0, 1, 1],
]
)
cell2=np.array(
[
[0, 0, 2],
[1, 0, 2],
[1, 1, 2],
[0, 1, 2],
[0, 0, 3],
[1, 0, 3],
[1, 1, 3],
[0, 1, 3],
]
)
# points of the cell arraypoints=np.vstack((cell1, cell2)).astype(float)
# create the unstructured grid directly from the numpy arraysgrid=pv.UnstructuredGrid(cells, cell_type, points)
plotter=pv.Plotter()
plotter.add_mesh(grid,color='blue')
plotter.enable_cell_picking(callback=testFunction,show=False)
plotter.show()
Describe the bug, what's wrong, and what you expected.
I am plotting an unstructured grid and trying to edit things in there while I have a Plotter open. The focal point of the camera doesn't always go the cursor, but in some cases it does. In the video I added, I first pressed 'f' with the cursor on the top block and then on the bottom block. The focal point goes to the correct point for the lower block but not for the upper one.
Steps to reproduce the bug.
System Information
Screenshots
Flux.PC.Remote.-.TeamViewer.2024-05-10.14-42-20.mp4
The text was updated successfully, but these errors were encountered: