How to Align a vtk Cylinder to a Known Vector

I think the simplest way to achieve that would be the following:

  • retrieve the existing control points as numpy arrays
  • using those, compute the two endpoints of your desired line
  • create a markupsLineNode with these new points as control points
  • hide the label text and the new control points to only show the line

To do all that, I recommend looking at the examples in the script repository and/or search for previous answers in the discourse.

1 Like