How to attract towards an arbitrary surface

   6359   11   1
User Avatar
Member
271 posts
Joined: March 2012
Offline
Hi all,
I'm trying to attach many FEM (or RBD initally for testing purposes) to an arbitrary surface, but I'm not sure how to go about this, but I have a general idea to try and create a vector field that points towards a surface.
Take a look at the attached image and imagine some field lines following those normals.

Attachments:
arbitrary_surface.png (669.6 KB)

User Avatar
Member
606 posts
Joined: May 2007
Offline
What you want is a gradient of an sdf volume. Let's leave the implementation as an excercise for now
User Avatar
Member
271 posts
Joined: March 2012
Offline
Thanks eetu…though I suspect I will be back shortly asking how this is done
User Avatar
Member
271 posts
Joined: March 2012
Offline
I'm trying to follow the example in the docs for the Volume Gradient vopsop, but having no success. The docs say this:

“For example, create a sphere and a point (with the help of the Add SOP). Connect the sphere to the IsoOffset SOP and change it to SDF. Next, connect the point and IsoOffset to the VOP SOP. In the VOP SOP, connect P in Globals to the N output using the Volume Gradient. In the viewport, the point normals will show you the direction. For it to work, the point must be located within the limits of the SDF field. Because the output yields the normalized data, it shows only the direction.”

I tried this and it shows nothing in the viewport at all. See attached file.
It seems so simple I'm not sure what I could be doing wrong here

Attachments:
volume_gradient.hipnc (49.7 KB)

User Avatar
Member
387 posts
Joined: Nov. 2008
Offline
You connected your sdf (isoofset) into 2nd input of VopSOP node (input #1) but inside you try to import volume from input #0 (OP Input Index in Gradient VOP). Set it to 1, turn on visualisation of normals and you can see the direction of gradient.
User Avatar
Member
271 posts
Joined: March 2012
Offline
Ah yes - thank you pezetko! Now to get this field to act as the force in a simulation. I'm going to assume that I can just export from the vopsop to a parameter named ‘force’and that should work?
User Avatar
Member
271 posts
Joined: March 2012
Offline
Ok, I seem to be stuck. I have my field force set up in my DOP network, but the simulation just seems to be inactive or something, because my array of sphere objects just do not react to the field force at all.
Any ideas?

Attachments:
attract_to_surface.hipnc (275.5 KB)

User Avatar
Member
606 posts
Joined: May 2007
Offline
Oh, two things.

- You were bringing in all the cells as one big dynamic object. If you want to bring many objects from one SOP location, you need to specify which pieces of the geometry are to be considered separate physics objects. Here you should use an RBD Fractured Object to bring your cells in, and that needs the copy sop to create a group for each separate piece of geo.

- Your force was just too small to register

Attachments:
attract_to_surface_ee.hipnc (297.1 KB)

User Avatar
Member
271 posts
Joined: March 2012
Offline
Ahh, thanks again eetu
It's a shame that the effect isn't quite what I was after
I was going to turn the spheres into FEM spheres and make them grow (somehow) so they squash up against each other. Using this force field doesn't seem to work well enough for keeping the spheres attached to the surface.

If you have any suggestions I'd love to hear them
I've attached my current scene - imagine those spheres squshing up against each other and you'll see what I'm after.

Attachments:
attract_to_surface_cells.hipnc (315.3 KB)

User Avatar
Member
606 posts
Joined: May 2007
Offline
I'd recommend ditching the point cloud and use volumes. Here is a solution where I make an sdf of the geometry and take its gradient, and use that as a field force in DOPs. (Actually what I meant in my first post)
Edited by - April 13, 2014 07:38:25

Attachments:
attract_to_surface_cells_ee.hipnc (408.2 KB)
attract_to_surface_cells_ee.jpg (231.5 KB)

User Avatar
Member
271 posts
Joined: March 2012
Offline
That looks more like it. I'll download and take a look as soon as possible
Thanks again!
User Avatar
Member
271 posts
Joined: March 2012
Offline
That worked a lot better than what I had previously.
Do you have any ideas about how to get the spheres to grow while being simulated with finite elements? (or cloth if that's easier, just something that makes them look organic and squishy)
  • Quick Links