Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Tear, Pin, Cut, Fold and Mark
#9
Hi there!

(13-01-2022, 01:58 AM)cycle6 Wrote: And I understand you can get the "particle" by loop through all the ObiSolver.simplices. It seems it only return with an int, I'm assuming it's some sort of index? And it seems it's a mix of "points", "edges", and "triangles"?

ObiSolver.simplices contains simplex indices. A simplex is a convex shape made up of 1, 2, or 3 particles (point, edge, or triangle respectively). In the case of cloth, a simplex is always 1 particle (if not using surface collisions) or 3 particles (if using surface collisions).

Once you get a simplex index, you need to retrieve the particle indices in it. This is done using ObiSolver.simplexCounts.GetSimplexStartAndSize(simplexIndex, simplexSize);

This is all thoroughly documented and explained here with sample code (see "Retrieving the particle involved in a contact"):
http://obi.virtualmethodstudio.com/manua...sions.html

(13-01-2022, 01:58 AM)cycle6 Wrote: But I didn't find any way to related that index [color=#333333][font=Tahoma, Verdana, Arial, sans-serif][color=#333333][font=Tahoma, Verdana, Arial, sans-serif]with batchIndex and constraintIndex to find the according StructuralConstraint. Could you please show me who to approach? Thx a lot   Sonrisa 

There's no direct map from a particle index to a batch and constraint index, because one particle might be involved in an arbitrary number of constraints. It's not a 1-1 relationship. The only way to find a constraint given a particle index is to iterate trough all constraints until you find the one(s) that involve that particle. See:

http://obi.virtualmethodstudio.com/manua...aints.html

let me know if I can be of further help. Sonrisa
Reply


Messages In This Thread
Tear, Pin, Cut, Fold and Mark - by Valerize - 06-01-2021, 11:35 AM
RE: Tear, Pin, Cut, Fold and Mark - by josemendez - 06-01-2021, 01:04 PM
RE: Tear, Pin, Cut, Fold and Mark - by Valerize - 07-01-2021, 09:03 PM
RE: Tear, Pin, Cut, Fold and Mark - by Valerize - 16-03-2021, 06:17 PM
RE: Tear, Pin, Cut, Fold and Mark - by josemendez - 17-03-2021, 08:54 AM
RE: Tear, Pin, Cut, Fold and Mark - by Valerize - 18-03-2021, 10:21 AM
RE: Tear, Pin, Cut, Fold and Mark - by josemendez - 18-03-2021, 10:55 AM
RE: Tear, Pin, Cut, Fold and Mark - by cycle6 - 13-01-2022, 01:58 AM
RE: Tear, Pin, Cut, Fold and Mark - by josemendez - 13-01-2022, 09:37 AM
RE: Tear, Pin, Cut, Fold and Mark - by cycle6 - 13-01-2022, 10:31 AM
RE: Tear, Pin, Cut, Fold and Mark - by josemendez - 13-01-2022, 10:50 AM
RE: Tear, Pin, Cut, Fold and Mark - by cycle6 - 13-01-2022, 11:04 AM
RE: Tear, Pin, Cut, Fold and Mark - by josemendez - 13-01-2022, 11:36 AM