Developer
Developer

Reputation: 8400

Python (VTK): Connect two 3D points by an oriented cylinder

Consider we have two points in 3D space, wishing to connect them by a cylinder with specified radius. Apparently the height (length) of cylinder will be the distance between tow two points. However the standard Cylinder object has nothing to be oriented to follow the above.

How to do this?

Upvotes: 3

Views: 1511

Answers (1)

dudu
dudu

Reputation: 705

The simplest way I can see is using TubeFilter. Basically you draw a line between the two points and then apply the filter. Here is an example in c++, but it should be straightforward to port it to Python.

EDIT: And here there's an example in python if that helps.

Upvotes: 2

Related Questions