- This topic has 6 replies, 4 voices, and was last updated 8 years, 6 months ago by .
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Using SOFA › [SOLVED] Normal force from arbitrary mesh
Hi everyone,
I have been looking through the examples, and I was curious if there was a simple way to generate a normal force at every point/face on an arbitrary mesh. Can someone kindly point me in the right direction?
Thanks,
-J
Hi Jason,
the component SurfacePressureForceField is probably what you need. The corresponding example is examples/Components/forcefield/SurfacePressureForceField.scn
Cheers,
I don’t think this is what I am looking for. I want to generate a force field at the center of every face and at every vertex of the mesh that points along the surface normal at those points. In this example, the surface pressure is a response to the mesh spring forces. When I remove those forces, the frog deflates.
Is there a way to generate a vector force field attached to an arbitrary mesh?
SurfacePressureForceField computes the force at each node like that:
for every triangle:
Deriv p = (ab.cross(ac)) * (pressure / static_cast<Real>(6.0));
f[t[0]] += p;
f[t[1]] += p;
f[t[2]] += p;
ab and ac are two edges of the triangle and (ab.cross(ac)) gives the normal. The force is therefore computed along the normal. With a constant pressure.
…and it’s similar for quads.
Isn’t it what you want? I’m sorry, I didn’t understand the sentence in your last comment where you explain what you want.
PS: I did not test the example scene I mentionned. It was just the only example with this force field. Maybe it’s not an appropriate example to show the basic features of this component.
Hi Jason,
Is your problem solved ?
If yes, could you tell us what you did ?
Thanks,
Guillaume.
Without answers from you Jason (@vagabond92), I close the ticket.
Cheers,
Hugo
Thanks Hugo,
Sorry for not replying to indicate that Alex’s description allowed me to figure it out. Thanks so much for the help everyone,
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.