I’m using Python 3.9 and vtk 9.1.0 on Windows.
vtkDataAssembly.SelectNodes() selects nodes in the vtkDataAssembly using a ‘/’ sperated path of the node names.
This method is supposed to return an empty vector/tuple if no nodes match the path,
however I find that the method always returns the root node if the supplied path has a ‘/’ in it.
In the snippet below I create a data asssembly and then call SelectNodes using two different paths. Since the data assembly is empty, I expect both calls to return an empty tuple.
In fact the first call, using the path ‘test’ does return an empty tuple but the second one returns the index of the root node. Any path that includes a leading ‘/’ returns the root node.
Am I missing something, or is this a bug?
data_assembly = vtk.vtkDataAssembly() print('test', data_assembly.SelectNodes('test')) print('/test', data_assembly.SelectNodes('/test'))
test () /test (0,)