How do I create a mesh (tube/cube) from 2 points? (find points around a vector)

Hello!

I have two points (A - B) in 3D space and I want to find the vertices to build a mesh around the vector AB.

6922028--812096--upload_2021-3-10_21-15-1.png

The direction of the vector AB is not fixed (it changes during the execution) and I’m struggling to find the solution (the base can be a square, not a circle)

Do you know how can I achieve this?
Thank you!

You can look in my MakeGeo project for some mesh-making solutions. There’s just a random smattering of different ways of making meshes at runtime.

MakeGeo is presently hosted at these locations:

https://bitbucket.org/kurtdekker/makegeo

https://github.com/kurtdekker/makegeo