[vtkusers] OBBTree IntersectWithLine
Manh Ta
niuton152 at gmail.com
Mon Nov 5 21:26:07 EST 2018
Hi everyone,
I am trying to use vtkOBBTree to find the intersection between a line and a
mesh. I rewrote this example
https://www.vtk.org/Wiki/VTK/Examples/Cxx/DataStructures/OBBTreeIntersectWithLine
using Activiz .NET in Matlab. Here is my code:
sphereSource = vtkSphereSource.New();
sphereSource.Update();
% Create the locator
tree = vtkOBBTree.New();
tree.SetDataSet(sphereSource.GetOutput());
tree.BuildLocator();
% Intersect the locator with the line
lineP0 = [0.0, 0.0, 0.0];
lineP1 = [0.0, 0.0, 2.0];
intersectPoints = vtkPoints.New();
cellIds = vtkIdList.New();
tree.IntersectWithLine(lineP0, lineP1, intersectPoints, cellIds);
I am not sure how to replace the "NULL" in C++ by something similar in
Matlab, so I ended up using a vtkIdList instead. I got an error at the last
line saying that *"No method 'IntersectWithLine' with matching signature
found for class 'Kitware.VTK.vtkOBBTree'."*
I would appreciate if someone can give some suggestions. I got a similar
error message when trying to use vtkCellLocator and vtkModifiedBSPTree.
Thank you,
Manh
--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
More information about the vtkusers
mailing list