Page 1 of 1
Maxwell Scatter Remove Overlapping bug
Posted: Thu Aug 27, 2015 10:48 am
by ababak
Maxwell Scatter is killing too many instances when it removes overlapping. I've spotted this on the teapots video but thought that it was some weird setup.
So I've created
a simple scene and I see the problem exists. I've highlighted most of the instances that could obviously stay alive. There are also some instances that still could live but are a bit close to others (I don't know the threshold so I didn't select them).
I wish there was an option that tries to fit all the instances by changing rotation, scale and positions. Even if it takes too long, I'd better wait because the result is invaluable. Also it would be great to have a list of objects to choose randomly or (maybe better) to have several scatter nodes to communicate with each other to prevent overlapping.

Re: Maxwell Scatter Remove Overlapping bug
Posted: Thu Aug 27, 2015 2:05 pm
by F. Tella
Hi Ababak,
Yes, we are aware of the problem. We are trying to improve the method.
Now it is working with bounding boxes, and if it finds a chain of overlapping instances it removes most of them as one is invalidating the next. It's the fastest way of doing it but as you noticed it removes too many instances. I'll let the developers know about your suggestions.
Regards,
Fernando
Re: Maxwell Scatter Remove Overlapping bug
Posted: Thu Aug 27, 2015 2:45 pm
by ababak
Hi Fernando,
Thanks for answering.
I think it would be also great to let the user select the matching method: either bounding box, a sphere or a simplified cage and make an option to adjust the radius/size (for example, 1 for exact bounding box, 0.75 for 25% reduced).
Again, I'd better like it doesn't kill the instances but use this algorythm:
Place the first instance and then try to fit the next one (using all available scale/rotation/position variations) in continuos loop until it's done.
Even better, when it can not insert any new instance it could try to rotate/move existing ones to accommodate a space (like live particles that stick to surface).
I do understand that it requires a lot of computation but this happens only once and I think we can wait as much as it needs to finish its job.
That way we could at last make thousands of believable small water drops on a bottle)).
Thank you!
Re: Maxwell Scatter Remove Overlapping bug
Posted: Thu Aug 27, 2015 7:02 pm
by Mihai
I also think an iteration type algorithm would work best in most cases. Let the user choose the nr of iterations for more accurate packing.
Re: Maxwell Scatter Remove Overlapping bug
Posted: Thu Aug 27, 2015 7:41 pm
by seghier
F.Tella wrote:Hi Ababak,
Yes, we are aware of the problem. We are trying to improve the method.
Now it is working with bounding boxes, and if it finds a chain of overlapping instances it removes most of them as one is invalidating the next. It's the fastest way of doing it but as you noticed it removes too many instances. I'll let the developers know about your suggestions.
Regards,
Fernando
bounding cylinders better than boxes ; because cirlces have the same radius in all directions
i see grasshopper example : Packing Algorithms in Rhino + Grasshopper
this algorithm help to grow circles and avoid intesection between them ; than replace cylinders with objects will give nice result
https://www.youtube.com/watch?v=SSWudanJc7c
Re: Maxwell Scatter Remove Overlapping bug
Posted: Fri Aug 28, 2015 10:26 am
by ababak
Image based circle packing looks like my dream feature!
Re: Maxwell Scatter Remove Overlapping bug
Posted: Fri Aug 28, 2015 11:08 am
by F. Tella
These algorithms about optimal packing are not easy at all and have multiple solutions (or sometimes no solution at all) and if you have too many instances you'll end up with visible herringbone patterns with instances of the same size...
Anyway we take note of your suggestions.
Thank you!
Fernando
Re: Maxwell Scatter Remove Overlapping bug
Posted: Fri Aug 28, 2015 12:47 pm
by seghier
thanks Fernando
in this algorithm they use physics with a plugin called : kangaroo ;
and its like voronoi texture if many circle packed together their shapes changed ; if the algorithm for example based on voronoi texture and every object will created in the center of every shape of voronoi
like this :

Re: Maxwell Scatter Remove Overlapping bug
Posted: Sun Aug 30, 2015 11:58 am
by seghier
the algorithm already exist

: Lloyd's algorithm
https://en.wikipedia.org/wiki/Lloyd%27s_algorithm
this example created with rhino script
and this with grasshopper using : Lloyd's algorithm

Re: Maxwell Scatter Remove Overlapping bug
Posted: Tue Sep 01, 2015 5:59 pm
by juan
Hi all,
Thanks a lot for the suggestions.
This remove overlap thing is a perfect example of how sometimes you try to develop something simple and it explodes in your face
Packaging of volumes into other volumes or surfaces is a whole branch of math, a very alive one. Even problems that seem easy to solve like packaging spheres on a cube easily become very difficult or even not solvable with arbitrary meshes, especially if they are not convex. I understand it seems easy for a user to say "I want this tool to be smarter and not only avoid overlaps but maximize space occupation, no matter how complex my mesh are, and of course it should keep the randomness". But this is very difficult, and that is why there are specialized companies that develop products to deal with this. Developing MWScatter further would mean that someone would need to stop working on the render core to be entirely dedicated to this small area for a long time. We obviously can't do that our goal was to provide a simple tool useful for some simple cases but not to compete with dedicated tools. Our developers are very good at rendering, and this is where we should spend most of our efforts
Namely dealing with animation issues would be a hell, and while I am not an expert on the matter at all it seems a non solvable problem in the general case. The same happens with MWGrass, it is not meant to be animated, if it is useful for you in some cases great, if not, you should look for an specific tool because Maxwell is not a vegetation tool, nor a scatter tool but a renderer (by the way we provide compatibility with some of the most popular vegetation/scatter plugins out there, and now that we are releasing a public API more companies could develop plugins for Maxwell), and all these features where included for free as useful things that could be very handy in many cases, specially in platforms that lack of a good ecosystem of 3rd part plugins.
That said, in the next build the remove overlapping thing will be more efficient, and will remove less instances.
Thanks again for your feedback!
Juan
Re: Maxwell Scatter Remove Overlapping bug
Posted: Tue Sep 01, 2015 6:26 pm
by ababak
Hi Juan,
Thanks for sharing your vision.
Are these scatter particles scriptable through Maxwell Render SDK? (Perhaps not). Any chance to get them scriptable if not?
Re: Maxwell Scatter Remove Overlapping bug
Posted: Tue Sep 01, 2015 6:31 pm
by juan
Hi Ababak, the scatter extension just creates regular instances, so that is perfectly doable using the sdk.
Re: Maxwell Scatter Remove Overlapping bug
Posted: Tue Sep 01, 2015 8:52 pm
by seghier
Thanks Juan
We are not developpers ; we only want that maxwell become the best
I remember since long time i asked in facebook page about volumetric and they replied me
That is impossible and something like there is no plan to do that but maxwell developpers did it

The same as assign material emitter to particles ; it was impossible but now it is possible.
I trust maxwell developpers and not all users can buy these expensive tools and also buy autodesk softwares or other softwares just for scatter drops or trees
Our dreams are easy but for developpers are difficults ; and thanks alot for maxwell render ; you always give your excellent work as free update
Re: Maxwell Scatter Remove Overlapping bug
Posted: Wed Sep 02, 2015 11:26 am
by juan
Thanks for your nice words Seguier
I am not saying it is not possible, but just that is a problem more complicated that it seems and this is why there is a bunch of dedicated products out there to solve this issue. We intended to provide a simple, useful tool for many people, but realizing it was not meant to be a competitor of all these cool dedicated tools. But of course if we find out ways of improving it we will.
Juan
Re: Maxwell Scatter Remove Overlapping bug
Posted: Wed Sep 02, 2015 4:56 pm
by ababak
Thanks for the information.
Will it be possible for scatter to honour the displacement and surface offset in the future?