vtkModifiedBSPTree.IntersectWithLine regression: random crashes. No error shown.
The following minimal example works fine with the python binding of vtk 9.1 but crashes for version 9.2. It crashes on first attempt on some computers and randomly on others. When running this example on C++ I get the error Expression: vector<bool> subscript out of range
- OS: Windows 10 22H2
- Python: 3.8.5
- input file: target.ply
import vtkmodules.all as vtk
from vtkmodules.vtkCommonCore import reference
reader = vtk.vtkPLYReader()
reader.SetFileName('target.ply')
reader.Update()
target = reader.GetOutput()
target_tree = vtk.vtkModifiedBSPTree()
target_tree.SetDataSet(target)
start_point = (19.316858, 0.17170048, -21.331856)
end_point = (-7.6906185, 14.95628, -9.431408)
tolerance = target_tree.GetTolerance()
t = reference(0.0)
hit_point = (0.0, 0.0, 0.0)
p_coords = (0.0, 0.0, 0.0)
sub_id = reference(0)
for _ in range(1000):
target_tree.IntersectWithLine(
start_point,
end_point,
tolerance,
t,
hit_point,
p_coords,
sub_id,
)
print('This call is successfull!')
Edited by Van Eycke Yves-Rémi