Jump to content
Maciej

Scatter without selfpenetration

Recommended Posts

Hi everyone. My first post.

I`m sorry. I cant post Hip file. (NDA reasons)

I have scene, where I need to copy to points exact amount of pigs (varies between 8-20 - weighted distribution)

Everything is ok, but now I need to rid off self penetrations.

Is there an elegant solution to this problem? (Maybe VEX magic - loop through objects, then move a bit)

I tried following methods so far: 

1. Set pscale by Volum Spheres: It`s legit method, but it works best in 3D. I think it`s little bit overkill.

2. Houdini Simon`s method of subtraction. Its slow (I`ve found HDA which does the same, but in VEX - link: https://mcworldkit.gumroad.com/l/CollisionsRemoval)

I don't have full control how many pigs will be removed though.

 

Thank you for all your help

 

Graph.JPG

Packed.JPG

Unpacked.JPG

Share this post


Link to post
Share on other sites

Yes..Well I kinda found a solution.

link.

https://www.youtube.com/watch?v=G5K-0wqEJsU&ab_channel=Entagma

Work like charm, but in order to prevent pigs from rolling and tipping , I had to make bases "warhammer style".

Also I had to turn off RTX features, bc I dont have RTX card.

https://www.sidefx.com/docs/houdini/news/19/vellum.html
Shape match constraints require the latest driver for NVIDIA Ampere series cards. This is version 456.38 on Windows [www.nvidia.com] and version 450.80.02 on Linux [www.nvidia.com].

If you don’t update your driver, you can alternatively set the following environment variable to disable this feature: HOUDINI_OCL_FEATURE_DISABLE=CL_DEVICE_DEVICE_ENQUEUE_SUPPORT. For more information, see environment variables. [www.sidefx.com]

image.thumb.png.50216d9b2101306cb3b763b3db624223.png

The problem is, that it is now simulation based and I was askes to make a sequence of 10K frames in Alembic.

Is there any way to make a script (aka. "action" in photoshop) reset simulation, wait 20 frames, write alebic, change seed, repeat... ?

Share this post


Link to post
Share on other sites

Yes. I've tried UV layout approach, but distribution was to uniform.

Cool tip with xForm trick though. - thanks Konstantin!

Share this post


Link to post
Share on other sites
On 20/05/2022 at 11:07 PM, konstantin magnus said:

The UV layout node can do this for meshes, eg. from top.

pack.jpg.23c0d17bb292def66e1f43b27ec5862a.jpg

pack_2D.hip

I wish we could have some option to control the orientation of each asset in the UVlayout, so it will try as much as possible to maintain the initial orientation and also output the matrix transformation with pscale of each piece @konstantin magnus .

noIntersectPackByUVlayout.hip

Share this post


Link to post
Share on other sites
Posted (edited)
On 2022/5/13 at 5:19 PM, Maciej said:

Hi everyone. My first post.

I`m sorry. I cant post Hip file. (NDA reasons)

I have scene, where I need to copy to points exact amount of pigs (varies between 8-20 - weighted distribution)

Everything is ok, but now I need to rid off self penetrations.

Is there an elegant solution to this problem? (Maybe VEX magic - loop through objects, then move a bit)

I tried following methods so far: 

if you don't mind using bullet dyn,you can try this way

scatter_without_intersection_od.hip

 

Edited by Benyee

Share this post


Link to post
Share on other sites
Posted (edited)

Hey :) Thanks !

Yes i know this solution too.  But in my case, i m not sure i want to run over 4000 bullets sim  :)

I found how to help by using a pre scatter with wanted orientation, and layout after. Abd also rotating the island of the main direction to follow to further help while also compensating with ratio by few basic math, it's a bit hacky but do the job.

Can't pretend it has the elegance of a @konstantin magnus's solution, but as soon is result is good , fast and consistent , im okay :)

Edited by vinyvince

Share this post


Link to post
Share on other sites

thanks, and that's interesting,firstly, you guys' approaches are nice and impressive:D.
the point is,for some particular situations we should select some particular ways to solve the problems,
handily and efficiently. as a matter of fact, it's handy to handle 4000 points(with constraints) with bullet solver,even more.
but how to handle 4000(eat out around 55gb ram?) or 8000 unpacked uv islands and geometries whitout crash risk, that could be unavoidable.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×