How to coinstrain an element with two others in an IK chain

rhino6

(Lorenzo Tognarini) #1

Good evening to everyone,

I’m a student and a beginner user of a trial free version of Bongo 2, I’m learning slowly through online tutorials but I have some problems. One of these is the fact that i can’t select the button “Costrain to object" command under “Pivot costraints” in a object part of an IK chain, as you can see in the picture.
Can you support me to understand?

Furthermore, I need to understand how to coinstrain an element with two others in an IK chain. Specifically, I would like to constrain “object 2” (already bound to “object 1”) to “point 2” that moves along the path of “segment 5”. I would like that the only movement of “object 2” is along the X axis.
Here you can find the file:
Studio Animation.3dm (53.7 KB)

Thanks to everyone,
Lorenzo


#2

As nieko nesuprantu.


(Luc Adriaenssen) #3

Hi Lorenzo,
The common language on this forum is English. This is what Google Translate makes of your Italian:

"Good evening to everyone,
I’m a student and a beginner user of Bongo, I’m learning slowly through online tutorials but I’m having some problems.

One of these is the fact that you can not select the “bind to object” command under “constraint on the pins”, as you can see from the image. Can you tell me the cause?

_Furthermore, I would like to understand how to link an element to two others in an IK chain. Specifically, I would like to constrain object 2 (already bound to object 1) to point 2 that moves along the path of segment 5. I would simply like the only movement of object 2 along the X axis. I attach the file."

All the same…
The image above does not look complete. The section allowing you to pick a object to constrain to (‘vincola ad oggetto’). On my system it looks like this.

Clicking on the button image activates the “constraint to object” setting.
Can you please check out whether this part is really missing on your system. Do you have the latest versions of Rhino and Bongo?

Further it is obvious the rather ambiguous distinction between “Simple constraint” and “IK constraint” is bugging you. Maybe this tutorial can clear things out for you:

I’ll comment on your model tonight or tomorrow.

Luc


(Lorenzo Tognarini) #4

Thanks a lot Luc,
Yes, I’m sorry for the language problem, I proceeded to correct.

However, looking at the tutorials I noticed the difference in the Bongo interface and the lack of such commands.
I’m using the trial/evaluation versions of Rhino 6 and Bongo 2 with the latest updates available.

Lorenzo


(Luc Adriaenssen) #5

This looks like a technical problem, beyond my competence. I ask @marika_almgren to take a look.

Helping you out with the model will have to wait, because the missing part is definitely needed. :disappointed:
Luc


(Lorenzo Tognarini) #6

Thank you again very much Mr. Luc.
For the time, I managed to gloss over the problem using Bongo 2 for Rhino 5 (not Rhino 6 like before), in this way I didn’t find any kind of problem with the interface and commands!

However, I could not fix my model as I wanted… :sweat:
This is the new file-test made with Rhino5:
Test Animation 5.3dm (63.4 KB)

Lorenzo


(Luc Adriaenssen) #7

Nice going. Lucky for you Rhino 5 is still operative.

About “Test Animation 5” – I made some improvements in Test Animation 5bis.3dm (58.1 KB)

a: There is no need for “Punto 1” – I’ve deleted it (and the curve it is constrained to). “Oggetto 0” (the ‘head’ of the IK chains) can simply move down according to the 2 keyframes. There is no need for it to be Constraints, Joint, whatever …
ani%200
By the way …the setup in your model “Studio Animation 001” above, with “Punto 1” Simple Constrained etc… worked fine but the technique is really far too complicated to simply make “Oggetto 0” move down.

b: “Punto 2” and “Punto 3” IK-constrained to the horizontal curves can work, but only if they are at the end of the IK-chains. So “Punto 2” should be child of “Oggetto 2” and “Punto 3” child of “Oggetto 4”. This way they will guide all the objects in between themselves and the ‘head’.
By the way … the curves they are constrained to need to be a bit longer because the Puntos will move outwards a bit at first.

C: “Oggetto 2” and “Oggetto 4” must be able to rotate relative to their parents (“Oggetto 1” resp. “Oggetto 3”) so they must be ‘Hinges Y’.
ani%201

D: No need for “Oggetto 1” and “Oggetto 3” the be ‘Joint and constraint’. They must simply be a ‘Joint’ (Hinge Y indeed).

So finally this works but … as you see “Oggetto 2” and “Oggetto 4” wobble, wiggle and waggle. I don’t think that’s your plan.

In Test Animation 6.3dm (54.4 KB) this is fixed.
Puntos 2 and 3 are deleted. Instead “Oggetto 2” and “Oggetto 4” are not only ‘Hinged’ but also ‘Constraint’. The Constraint ‘Keep pivot location, orientation and scaling’ would make the objects freeze in space, but Relaxing the X Position enables them to move left and right… but only that.


PS click the image above. It doesn’t show fully here

Any more questions? Just ask!
Luc


(Lorenzo Tognarini) #8

Thank you so much, Luc!
I really appreciated your support, simple and precise. Now I understand how to get on with my work.

Lorenzo


(Lorenzo Tognarini) #9

Hi @Luc
Sorry for the continuous questions… now the model is more complicated and I’m stuck again.

As you can see in this file:
Test Animation 010.3dm (790.8 KB)
The problem is that the parent at the head of the IK chain shouldn’t be the “CENTRALE A” element (previously called “object 0”) but the two external elements “Spicchio 1” and “Spicchio 2”. Is it possible to set two parents with a single child in common (CENTRALE A)?

Also, the IK chain should close cyclically, but it does not.
I had to copy several times the object “Spicchio 1-2-3-4-5-6-7-8”, this because (for example) I could not bind the object “Spicchio 2” to both the objects “ala 2” and “ala 3” near as it.
In conclusion, the four “Spicchi 1-2-3-4” should drive the other elements bound to them approaching towards the center when they close (the red square is the limit).
Step 1:


Step 2 (how it should be):

I did some experiment of movement as you can see in the file, without success, but the animation of the elements should be similar to that of “CENTRAL A” and “Ala 1 - 2” and “Spicchio 1 - 2”.
Step 1:


Step 2:

I hope it’s understandable, and thanks again for all in advance,
Lorenzo


(Luc Adriaenssen) #10

No sorry. It’s my pleasure dealing with questions (and enigmas) like these.

Indeed now the model is far more complex. Actually somewhat an overkill for an apprentice. I can understand you got stuck, it really is a mindbender, even for an experienced user .

But first: the rule in Hierarchical linking is simple:
one parent can have many children,
but a child can have only one parent.

In Test Animation 011.3dm (568.2 KB) the technique developed in the previous model is taken a bit further:

  • 2 diagonal curves are introduced to be use as ‘guides’, since the ‘Spicchio’ should move centripetal.
  • A kind of proxy (curve) is used to ‘drive’ the mechanism. Hence CENTRALE A (made telescope child of ‘driver’) is set free to move down and inwards.

Both ‘Spicchio 1’ and ‘Spicchio 2’ are no longer attached to the World (the previous Pivot constraints “Keep pivot location, orientation and scaling”). They are now attached to one of the diagonal curves by means of some auxiliary point-children.

Two are needed to keep ‘Spicchio 1’ horizontal (try deleting point-object ‘constr 1.2’ and see what happens). Only one can suffice for ‘Spicchio 2’ since the system is stable thanks to the previous two.

Nice, but… this techniques doesn’t allow to fulfill your needs (folding up completely). CENTRALE A should go up again but then Bongo has no means to force the ‘Spicchio’ to continue their way inwards. They would simply go back.

Time to change strategy: a different driver: ‘Ala’ is the only element in the system that makes a continuous movement – rotate 180°. But ‘Ala’ not only rotates but it also moves in horizontally! This asks for advanced IK-insight.

After struggling with your model for a while (the horrifying “Bongo: constraint goal not reached” notification) I noticed some miniscule deviations in the position of the solids – probably the side effect of copying.
lorenzo
*So I rebuild the model Test Animation 100.3dm (410.3 KB) – just to make sure.

I also rescaled the model (factor 0.1) to feel more comfortable and also to make the pivots and specifically the IK-decoration more visible.*

In Test Animation 101.3dm (437.4 KB) ‘Wing 1’ (the former ‘Ala 1’) is given keyframes to rotate and it is made telescopic according to the X and Y axis. Hence it will rotate but is free to move around in a Horizontal plane (a “Universal” joint must be used in order to have multiple relaxation).Wow!
An IK element that e.g. is a Telescope cannot be moved via keyframes but it can be rotated or scaled. A hinge on the other hand can only be moved or scaled via keyframes but not rotated. Etc…

‘Part 2’ again is kept in position by two auxiliary point-children constrained to the diagonal curve.

Building out the entire structure in this way, in one long chain, would end up in a cyclical system, since ‘Part 1’ (or a child of it) will be constraint to ‘Wing 1’ (or a child of it). Hence IK-calculation would become recursive! This tought led me to Test Animation 102.3dm (437.6 KB)

Now ‘Part 1’ is made head of the chain. Thus the end of the chain can be constrained to the diagonal curve (which is not part of the IK-chain).
This is another advanced IK technique (I didn’t even mention in my tutorial http://bongo.rhino3d.com/video/whys-of-ik.) : the driver of an IK chain isn’t necessary on the top of the chain. Also an element further down the hierarchy can drive the motion.

The pivot of ‘Part 1’ is rotate 45°. Hence it can be kept on track by making it a simple Telescope.

Don’t get confused. Higher up in the hierarchy (above the driver) “Constraints” can NOT be used but the “Joints” do work perfectly.

There is no longer need for ‘Wing 1’ to be a “Joint”. It executes its Rotation according to its parent ‘Part 1’ and moves along with it. Since ‘Part 1’ remains horizontal that’s just fine.

Finally in Test Animation 103.3dm (463.2 KB) the entire structure is fully completed in one long chain. At the end of the chain a kind of proxy ‘Part’ is formed and constrained to the diagonal curve ‘guide 1’, nicely outside the chain itself.

A lot to handle! Enjoy
Luc


(Lorenzo Tognarini) #11

I don’t know how to thank you!!! Over and over again you perfectly helped me, it’s really complicated!
It’s all how i wanted, but if i can i would like do one more question :sweat_smile:

If i wanted to rotate 180° all elements along one central and vertical axis while these expand, How should i do?
The mechanism no works if I constrain the Parent to a vertical segment that rotates 180°, all the pieces collide with each other. I tried to rotate the two horizontal guide segments, but nothing.

Thanks again for all in advance,
Lorenzo


(Luc Adriaenssen) #12

Now you are really taking it to the limit!

The idea to use a rotating proxy at the top of the chain is OK.

The main reason it fails is the constraint of object “Center A”. It is stuck to its X axis. When the constraint is abolished Center A does not remain horizontal (try this). There is no point in making it child of the rotating proxy - a Position constraint always uses ‘World Space’ never ‘Object space’.

The solution is to use a vertical plan to constrain to. The plane can rotate nicely along with the main rotating proxy. It can be “hidden”, also then it will perform its function.
Test Animation 104.3dm (496.4 KB)
On opening the model it will ‘Precalculate IK’. On my system it takes about 12 seconds – depending on your CPU it can take longer. Do not fear when Rhino seems to freeze – this can happen with complex IK chains (and also with unsolvable). Just let it be - since this chain is sound it will come out in the end.

Since the IK chain is getting fairly complex the Preview can get a bit jerky. Increasing the number of the Precalculation Sample to 200 helps.

I do not know what purpose you have with this overall rotation. When you want to make a turntable view then it is maybe easier to animate the camera to rotate around the object instead of keeping the camera steady and rotate the object .
Test Animation 105.3dm (492.6 KB)

Luc


(Lorenzo Tognarini) #13

Thank you again, sincerely, Mr Adriaenssen!

I have unfortunately another question: can I alter and modify an element which is part of the IK chain? In the beginnig I do all the animation and the IK chain, and after I will improve the morphology of animation elements. For example, can I scale 1D some of this elements without altering the animation?
Unfortunately, many times I encountered problems with this complicated mechanism.

Lorenzo


(Luc Adriaenssen) #14

Changing the morphology of the objects doesn’t bother Bongo. Pivots, that’s all it takes in account. But of course there is a relation between an object and it’s Pivot.

Rhino’s Scale1D an object e.g. will leave the pivot as it is. But, just because of that, you must be vigilant. For instance, when you make the elements in your model thicker (scale in Z direction) the pivots of various elements will no longer be in the correct position. You can to reposition them using the BongoMovePivot command. Moving an object Pivot will not alter the position of the Pivot of the children of the object (i.e. the chain remains intact).

Scale 2 or 3D will transpose the Pivot of the object itself but doesn’t influence the ones of the descendants. The chain is unaltered. Occasionally some 2 or 3D Scaling may have a weird effect on the behavior of the offspring= bug.

Rhino Move or Rotate an object will logically have an effect on the position/rotation of its offspring (see my video The whys ….) When you want to move/rotate only the object, it’s better to break up the chain (make the offspring independent) previously, and restore the relationship afterwards.

When the position of the pivot of an object is OK but only the object itself has to move (or rotate) you can unlock the pivot from the object IMAGE, move or rotate the object and re-lock the pivot. IK-chain is unaltered.

Some Solid-manipulations like: Split, BooleanUnion, BooleanDifference and BooleanSplit can disturb the Hierarchy of a chain. Parents can lose their children and vice-versa. It’s easy to fix via the Animation Manager.

A technique I occasionally use is to replace an object in a chain by a other one (a new and better one).

Here we go: Let’s say A to be replaced by B. Make sure B is in the right physical place. Then copy the animation properties of A to B (BongoMatchAnimationProperties command) – the B will get its place in the Hierarchy as a brother of A. Make sure the pivot of B is in the right place. In the Animation Manager drag the child(ren) of A to B, making A childless. Finally delete A.

WOW

When this is too much for you to handle, send me a sample of the modifications you need. When the project is confidential you can mail me personally luc@mcneel.com.

Luc

PS Some advice:

  • Previous to the main ‘work’, try experimenting on a simple model with only 2 or 3 objects in a chain, just to see what happens.testmodel.3dm (57.8 KB)
  • When working on a complex IK-chain, disable IK-Precalculation before manipulating the object. Thus unnecessary waiting (and even freezing of the model) is avoided.
    image
    Only enable IK- Precalculation when you ‘think’ everything is as it should (and save your work previously).