# Mechanical modeling: placing a bar between two ball joints

Background:
I need to place a bar (cylinder) between two ball joints (roundcubes).
You might think "Uh! Such an easy task deserves a post here?"

Well, the task is less easy than you could think at first:
As you can see, these joints are positioned really weird in the space.

So, I thought to a quick solution: I could position a bone, with the head centered on a joint, the tail on the other one and finally parent the bar to the bone.

This way I'd get the bar located, scaled and rotated to match the ball joints. NOPE.

Positioning a bone EXACTLY is really trivial.
You set the cursor where you want the bone's head to be and set the head to the cursor position.
Repeat for the bone's tail. DONE.

What I tried:
I tried parenting the object to the bone, but the cylinder went to some random position in the space.
I also tried using the eSnap addon, to no avail.
I tried using hooks, but I couldn't make them work as I expected to.

All complicated by the fact that my right arm is currently enveloped in chalk...

Something like this:

1. Place the origin of the cylinder at one end.
2. Parent the cylinder to the first sphere. Reset the cylinders origin (Alt+O) to position the end of the cylinder at the first sphere.
3. Add a Track To constraint (Ctrl+T) to the cylinder with the target as the second sphere. Adjust the track axes until the cylinder is aligned towards the second sphere.
4. Apply the visual transformation (Ctrl+A) and delete the Track To constraint.
5. Scale the cylinder along the local Z axis (S,Z,Z) until it intersects with the second sphere.

• Looks promising! Let me see if I can put it to work. – Phantômaxx Mar 21 '16 at 15:14
• Something weird happens. When I try to parent the cylinder to the sphere, the cylinder disappears – Phantômaxx Mar 21 '16 at 15:20
• Make sure you've applied scale on your object (Ctrl+A) in Object mode – user1853 Mar 21 '16 at 15:23
• @cegaton I applied location, scale, rotation, ...same story. – Phantômaxx Mar 21 '16 at 15:25
• Random fiddle is the way I get most of my constraints working anyway. Sometimes you have to scroll the panels up to see the constraints - I don't know why It's probably a bug. – Xtremity Mar 21 '16 at 16:32