Obi Official Forum
Help Best Practice for Project - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help Best Practice for Project (/thread-3690.html)



Best Practice for Project - roberthey - 10-12-2022

Hi!

I have a project and wanted to ask for suggestions on how to best accomplish my goal with Obi Physics (which I think is suitable for the task). I have some but not much experience with using Obi Physics. I own both the Rope and the Cloth Package.

What I want to do is:


  1. Have a flexible wiener with a nice bend resistance to it 
    My Idea: Use Rod instead of Rope, read about Bend Constraonts but can't find them in the package
  2. The weiner should have rounded ends attached to it 
    My Idea: Obi Particle Attachment with dynamic type?
  3. The weiner has to be cuttable when it touches a knife 
    My Idea: Use Tear() method? - might only be applicable to rope and not rod though.
Any suggestions, pointers, tipps or ideas are welcome. I hope my question doesn't breach any rules here since it technically doesn't fall into any of the available categories.

I am using:

Obi Rope: V6.5
Obi Cloth: V6.5

Thank you very much in advance.

Best,

Robert


RE: Best Practice for Project - josemendez - 12-12-2022

Hi Robert,

Unless you need torsion/twist simulation (imho a sausage has very little twisting motion to simulate) or you need to have a non-straight rest shape, you shouldn't need to use rods. Also, rods cannot be cut at runtime so that wouldn't help with your use case.

Quote:The weiner should have rounded ends attached to it 
My Idea: Obi Particle Attachment with dynamic type?

Dynamic attachments are meant for two-way coupling with rigidbodies, so they would be overkill in this case. You just need a rounded shape "glued" to the end of the rope, you can use the included utility script ObiRopePrefabPlugger to place prefabs at the start/end of the rope as well as plug the cut regions.

Quote:My Idea: Use Rod instead of Rope, read about Bend Constraonts but can't find them in the package
You'll find bend constraint settings in the ObiRope component. Global bend constraint settings are found in the ObiSolver component, inside the "Constraints" foldout.

Quote:The weiner has to be cuttable when it touches a knife 
My Idea: Use Tear() method? - might only be applicable to rope and not rod though.

Yes, this will work. See the manual for more info on getting contact information at runtime and dealing with custom rope tearing:
http://obi.virtualmethodstudio.com/manual/6.3/scriptingcollisions.html
http://obi.virtualmethodstudio.com/manual/6.3/scriptingropes.html

kind regards,


RE: Best Practice for Project - roberthey - 12-12-2022

Dear Jose,

thank you so much for your input! I found the bending constraint and it behaves like I wanted to. Just one more quick question:

To get a high material strength -> low felxibility I set the bend compliance to 0 and the max bending to 0. To further increase the force that works against the bending I increase the iterations on the bending in the solver. Is that hacky or fine?

Best, 

Robert


RE: Best Practice for Project - josemendez - 12-12-2022

(12-12-2022, 11:14 AM)roberthey Wrote: To get a high material strength -> low felxibility I set the bend compliance to 0 and the max bending to 0. To further increase the force that works against the bending I increase the iterations on the bending in the solver. Is that hacky or fine?

Hi Robert,

That's fine, it's the intended way to do it. By increasing the amount of bending iterations, you're essentially telling the solver "hey, achieving the bending compliance I set (zero in this case) is important, so spend some more time enforcing bending constraints".

This does not guarantee zero compliance will be reached, but will increase the importance of bending constraints. The actual compliance reached depends on a couple factors:

- Your rope's spatial resolution: How many particles/constraints are there in the rope. This is controlled using the rope blueprint's resolution parameter. Lower resolution->less constraints->it's easier for the solver to reach the compliance target. In the extreme case of zero resolution, there's just two particles in the rope (one at each end) so zero compliance is trivial to achieve: you can't bend a single straight line segment!

- Your simulation's temporal resolution: Unity's fixed timestep and the amount of substeps used by your ObiFixedUpdater. The more often you update physics, the easier it is for the solver to meet all constraints, regardless of the amount of iterations used.

So the rules to follow are: use the lowest rope resolution that works for you, increase the amount of substeps to a reasonable amount (4 id the default, you can go higher) and then increase the iteration count of specific constraints you're most interested in.

kind regards,


RE: Best Practice for Project - roberthey - 12-12-2022

(12-12-2022, 11:31 AM)josemendez Wrote: Hi Robert,

That's fine, it's the intended way to do it. By increasing the amount of bending iterations, you're essentially telling the solver "hey, achieving the bending compliance I set (zero in this case) is important, so spend some more time enforcing bending constraints".

This does not guarantee zero compliance will be reached, but will increase the importance of bending constraints. The actual compliance reached depends on a couple factors:

- Your rope's spatial resolution: How many particles/constraints are there in the rope. This is controlled using the rope blueprint's resolution parameter. Lower resolution->less constraints->it's easier for the solver to reach the compliance target. In the extreme case of zero resolution, there's just two particles in the rope (one at each end) so zero compliance is trivial to achieve: you can't bend a single straight line segment!

- Your simulation's temporal resolution: Unity's fixed timestep and the amount of substeps used by your ObiFixedUpdater. The more often you update physics, the easier it is for the solver to meet all constraints, regardless of the amount of iterations used.

So the rules to follow are: use the lowest rope resolution that works for you, increase the amount of substeps to a reasonable amount (4 id the default, you can go higher) and then increase the iteration count of specific constraints you're most interested in.

kind regards,

Awesome. Thank you so much for your elaborate support. That is some standout stuff.