birth position object volume minus moving shape
#1
Hello, this seems simple but here I am new and trying to find similar examples to what I'm trying to do. I need to fill an oil tank that has a large plug that protrudes into it from the lower side. The plug will get pulled horizontally and particles drain into a tray.

I've used birth>position icon/volume and added a collision on the plug but the particles intersect and fill the plug as well as the volume in the tank.

Any pointers for how I can fill a static volume around a movable object?

Below is a very crude drawing of what I'm trying to do.

   

Thanks for any pointers! I'm learning as I go Smile
JD
  Reply
#2
Well, I had a few drinks tonight, and I was in the mood to try it myself.  Smile

So, here is what it looks like:
https://youtu.be/nqfJqvvlvb8

I used Tyboolean to make these holes, objects, etc.. used Birth voxels, made them PhysX...then let them to settle up... 
Pretty much everything default, except I lower default gravity from -1cm to -0,5 (because my object was pretty small). 
Be aware, at this size of voxels (1cm) is pretty slow... maybe 30 minutes sim on my i7. For lower numbers (like 0,5cm) it can go 3-4 times slower. 
Not sure what type of "materia" you have in that trunk. Is it water, gran, corona? Smile 

I'll attach a scene (I saved it for 2017).
If you find anything that is not clear, feel free to ask.

Hope that helps
Cheers.


Attached Files
.rar   tanker.rar (Size: 80.59 KB / Downloads: 283)
  Reply
#3
That looks amazing! For some reason, Tyboolean crashes my Max every time I've tried it and unfortunately this file crashes upon load as well and I think it's the boolean causing the issue Sad Are you able to use proboolean or another method to cut the hole and I'll try again?

Hehe, some corona beer might be nice coming out of that tank!! I recently built up an AMD 3950x machine so this sim should really put it to the test.

Looking forward to learning from your example! Thanks again!
JD
  Reply
#4
What version of tyFlow are you using, Jason?
  Reply
#5
(05-03-2020, 12:39 AM)tyFlow Wrote: What version of tyFlow are you using, Jason?

I'm using the current version 0.16084 now however it has been crashing since I first played around with it several versions ago. It crashes on even the simplest boolean w/Max 2018. Hopefully its a minor fix to get it working on my system, looking forward to using it as much as I use Tyslice.

FYI, I'm using Max 2018, Corona 5, Nvidia 2060 Super, AMD 3950x
  Reply
#6
Please submit a minidump of the crash. Instructions are in the docs and also described in the bug subforum.
  Reply
#7
Oh
I had same problem, but Tyson fixed it in latest builds. 

Anyway, I converted models that used Tyboolean to edit poly, and it should work now. 
Let me know


Attached Files
.rar   tanker.rar (Size: 97.93 KB / Downloads: 289)
  Reply
#8
Wow, you were right, it does take a while for the sim to generate, maybe 5-10mins here. Any tips for making small changes and not waiting for it all to regenerate?

Few questions regarding the sim:
- so basically you set up a hidden volume of any shape to fill with voxels then the outer visible volume is the physx collider?
- how can I completely stop the voxels from moving before I pull the plug? This would be important to make it look real, everything is still to start.
- why do you have to halve gravity when the voxels get smaller? I'll need to change their size to 0.5" so just wondering what the relationship of size to gravity is. Seems the shape operator doesn't let you specify exact size sphere.

Thanks again for the time you spent on this, its quite an interesting approach.
  Reply
#9
Yo bro. Smile

Quote:Any tips for making small changes and not waiting for it all to regenerate?

Turn off the flow, do the changes, then turn it on? Smile
You can increase voxel size to 2cm, and it will be lot faster, but it will behave a little bit different probably. 

Quote:- so basically you set up a hidden volume of any shape to fill with voxels then the outer visible volume is the physx collider?

Yes. 
I did that for few reasons (separate model for birth). 
- First one is that according to your image, the volume was not full, but halfway full
- Collision model have shell, and it's a very slightly larger then the birth model, that doesn't have shell (so tyflow can birth on it's volume), Also, collision model doesn't have, doesn't need that cylinder shape inside it, just an opening. 


Quote:- how can I completely stop the voxels from moving before I pull the plug? This would be important to make it look real, everything is still to start.

One way or another, you need to give them time to settle, because we are using small spheres, so they have "space" when they are born as voxels. If we would use small boxes, maybe they would not have that space, and they would be settled right away, but then again, with boxes you would not have organic feel for the sim. 
Just render from where they are already settled, or born then in -30 frame, or something. 
You can use second Tyflow to born them after they settle, but I think that would be over too much of a hassle. 

Quote: why do you have to halve gravity when the voxels get smaller?

Just the personal preference, and gravity has nothing to do with voxel size. 
Here's the logic behind it. 
My scene is in cm, and I assume that tanker is very big (like 5 meters in height maybe), but I create it very small, maybe 50cm (10 times smaller), lowering gravity will compensate for that. If you do your scene at correct scale, you don't need to lower the gravity. 
Don't overthink it though, just place the gravity you feel is most natural. 

Quote:Seems the shape operator doesn't let you specify exact size sphere.

Shape operator works perfectly. :Smile
It does let you specify scale, but if you don't turn the scale on, it will automatically take scale you defined in the birth voxel operator. 
So, if you want to change scale on your particles, just use a birth voxel. 
--------------------------------

Hope this helps.
  Reply
#10
Wow thank you so much for the informative answer, super helpful!

I have almost everything set up but finding that some of the voxels are blowing out the top/bottom of the inner volume mesh if I set the physx collision on the plug to convex. Switching it to mesh works ok but since the plug is actually a tube, voxels are birthed inside of it which shouldn't happen in reality. I'm showing a cutaway view so you can see inside the plug.

If I drop gravity way down to something like 10, its a bit better but some of those rebellious voxels still escape. I also increased the sim substeps to 12.

Any ideas why this would happen?
  Reply
#11
(05-05-2020, 04:44 AM)jasond240 Wrote:  I'm showing a cutaway view so you can see inside the plug.

I don't see any image. 

However, here's some thoughts that might help. 
You must use the mesh in the physX collision, if you are  using concave surfaces (convex are really simple, always closed surfaces), otherwise, if it's on convex, it will make your geometry collision very simple and closed (you can view how collision shape looks with "display hull" option). 
Simpy - if The plug is cylinder for example, it can be convex, if it's tube (and you want particles to go inside the tube), it should be mesh. 

You need 3 meshes for this, and they all need to be built carefully. 
1) Tanker (make sure it has that hole (with standard boolean), and shell. 
2) Plug (just do it however you like it) 
(above 2 goes in Physx collision with mesh selected for both) 

3) Birth object for balls in tanker. 
Now, this one you need to do carefully. Make it's radius a little bit less then actual tanker (and height whatever you want). Also, with some boolean operation, make sure you build it, so it doesn't birth where your plug is. You need to build it. And also, it needs to be closed surface. 
Look at my sample again, and how the birth mesh looks like.

There is also a way, where you just birth voxels on simple cylinder, then test which one is touching the plug, then send them to delete, but at this point, I think it's easier for you to just build correct birth object. 
-----------------------------------

You mention that particles collides with each other. That shouldn't happen n if you used birth voxels, shape spheres, and didn't touch their scale. I assume it's because they are colliding with plug or the tanker (or both). That's why I said you need to build carefully birth object. 
But if you ever encounter a particle by particle collision between themself, just turn on scale (make variation to zero), and just make them slightly smaller, so they don't touch when they are born.
  Reply
#12
You're a great teacher! Your suggestion to look back at your birth mesh was what fixed the problem. I didn't notice that you had subtracted the plug from it. Ok, so its basically working now, thank you so much!

One observation shown in the attachment below is that some of the voxels are floating in the air even when the plug has stopped and they never drop. I tried reducing friction and adjusting gravity but that didn't do anything. I'm showing the physx mesh hull and the plug beneath. Its not a big deal but thought I'd ask.

Thanks again, learning a lot here! Adding tycache next.


Attached Files Thumbnail(s)
   
  Reply
#13
Really hard to see from screenshot, what's going on, but they shouldn't hover above the ground.
Maybe they collide with default ground plane (you can disable default ground on Tyflow icon, under the PhysX)?

I have no idea really.... but I repeat... they shouldn't do that in any case.
  Reply


Forum Jump: