MoI discussion forum
MoI discussion forum

Full Version: Randomize spheres in a specified area

Show messages:  1-10  11-25

From: Don (DON_CHEKE)
21 Nov 2020   [#11] In reply to [#9]
Thanks for the link Brian. Certainly not a read for the faint of heart. :-)
From: Don (DON_CHEKE)
21 Nov 2020   [#12] In reply to [#10]
Thanks Christian. I don't know Sketchup at all so I would need to spend time learning it first and might consider that.

I did ask on a couple other forums and it looks like it can be done quite easily in SolidWorks with a basic motion study. I have access to that, so I will try in there first. The attached is from the SW forum.

Attachments:
bubblegum.mp4


From: christian (CHRI)
22 Nov 2020   [#13] In reply to [#12]
Hi Don

I understand
SolidWorks is a great soft and easy to used

Chri

Image Attachments:
SPHERES EMPILEES 02.png 


From: Phiro
22 Nov 2020   [#14]
Hi all,

Perhaps could you see this page github.com/schteppe/cannon.js
You could find a simple 3D physics engine for js with many samples like spheres falling.
During simulation, you could have the coords of spheres fallen.
I you find a script taking coords to place your spheres in MOI3D.

An idea perhaps to help you...

This idea could be used to place objects physically or narturally ?

Have fun !
From: Ken (OKURO)
22 Nov 2020   [#15] In reply to [#14]
Thanks Phiro,
some more info about MSPhysics on Github:
here you go..............................................
https://github.com/AntonSynytsia/MSPhysics
http://sketchucation.com/forums/viewtopic.php?f=323&t=56852

Regards
Ken
From: Frenchy Pilou (PILOU)
22 Nov 2020   [#16]
If you want a complet tuto about MS Physics (for SketchUP) take a look at this ;)
26 little videos :) ps Sketchup is 10 times more easy than Blender! :)


From: Frenchy Pilou (PILOU)
22 Nov 2020   [#17]
CHRI is a SketshUp specialist! ;)

ELse you can do that inside MOI :)

Populate your volume with Tangent cubes ...it's not a big deal!
Then draw a sphere at each center box!

script: /* Attribute a point at each center box's object selected*/ var objs = moi.geometryDatabase.getSelectedObjects(); for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); var pt = obj.getBoundingBox().center; var ptfactory = moi.command.createFactory( 'point' ); ptfactory.setInput( 0, pt ); ptfactory.commit(); }

http://moi3d.com/forum/messages.php?webtag=MOI&msg=2749.36
This one move an object(s) to points yet drawn

Must be existing something for attribute automatically an object to all points selected
but don't remember it for the moment! :(

Must be this one : copy to points :)
http://kyticka.webzdarma.cz/3d/moi/#CopyToPoints

So copy the 2 files inside the folder commands
and make a shortcut "copytopoints" or press Tab and write Copytopoints...or COpyToPoints etc...
any letters you want except spaces

Have fun!


From: Frenchy Pilou (PILOU)
22 Nov 2020   [#18]
Damned seems there is a SyntaxError: Expected token ')' somewhere in this
???

script: /* Attribute a point at each center box's object selected*/ var objs = moi.geometryDatabase.getSelectedObjects(); for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); var pt = obj.getBoundingBox().center; var ptfactory = moi.command.createFactory( 'point' ); ptfactory.setInput( 0, pt ); ptfactory.commit(); }

this is the good one!!! (don't know where is the difference but... :)
script: /* Place a point at each selected object's bounding center */ var objs = moi.geometryDatabase.getSelectedObjects(); for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); var pt = obj.getBoundingBox().center; var ptfactory = moi.command.createFactory( 'point' ); ptfactory.setInput( 0, pt ); ptfactory.commit(); }


From: Frenchy Pilou (PILOU)
22 Nov 2020   [#19]
You can also draw 2 Circles (constant radius) in a view
then now same radius circle but now Tangent !
Copy rotate at any moment in another view!for the third and upper...

At the end no problem to remplace all by spheres with the plugins seen above!

Like this you can simulate any natural falling bubbles! :)
From: Don (DON_CHEKE)
22 Nov 2020   [#20]
Thank you all for the input. It is so nice to be able to ask questions on a CAD forum and get so much help.
From: Frenchy Pilou (PILOU)
22 Nov 2020   [#21] In reply to [#20]
Of course the last trick is some manual and not so automatic! :)

And at the start draw the second circle vertically above the first one
for have a good start of propagation...


From: bemfarmer
22 Nov 2020   [#22] In reply to [#18]
Either script works fine for placing a point. (no syntax error)
- Brian
From: christian (CHRI)
22 Nov 2020   [#23]
Hi

new files

Chri

Image Attachments:
SPHERES EMPILEES SKP 01.png  SPHERES EMPILEES SKP 02.png  SPHERES EMPILEES.png 


From: Frenchy Pilou (PILOU)
22 Nov 2020   [#24] In reply to [#23]
Yep that is the more easy for the moment! :)

If there are different sizes of spheres just take different color for each size!
(so for each familly of points...maybe successive imports... )

How is done the import from SketchUp ?
SVG, OBJ, DXF ... ?
From: Don (DON_CHEKE)
22 Nov 2020   [#25]
I just wanted to say thanks again. I did end up doing it in SolidWorks. Attached is a very low res animation.

Attachments:
Bumball Machine Animation LowRes.mp4


Show messages:  1-10  11-25