how to lay something to the ground

hi, here I am bothering all of you. Again :smiley:

I would use some suggestion to get (by script) some hollow cylinder, tilt-cut with rounded base, laying on the ground (XY plane). Of course a general procedure, for any shape, would be appreciated

Using images: i would like to get something like that


layed like that

suggestions?

thanks

either make it the active object in a rigid body simulation and add a plane as passive object as ground plane

or search the python forums for how to align selection to a face or similar, I remember a couple posts about it

thanks guys

@CoDEManX
Iā€™m not familiar with blender simulations. Could you suggest any tutorial or something about it?
Iā€™ll search for the post youā€™re talking about

@RickyBlender, unfortunately the posted suggestions donā€™t work for me
I tried the lieroā€™s script from your linked thread ang I got this


I also tried the ā€œdrop to groundā€ add-on, but I got this


Hereā€™s the required code:

Just adapt it to use the virtual or an actual ground plane!

Simulation tutorial: https://www.youtube.com/watch?v=rgjvgn9Xm20

sorry, maybe i didnā€™t get it: the pointed code is about creating lights normal to mesh faces, how can it be helpful for my case?

The math should be applicable for your use case too.

Use the cross vector of 3 vertices you select to get a normal. Calculate a 4x4 difference matrix to Mesh.transform() to desired orientation.

then may be you donā€™t have the right question!
looking at your first pic you are not really setting ob on the ground !

it looks like you need to set to ground s0mething but what ?
can you clarify
is it one face or a group of faces or some vert ?
or one face align parallel to another face ?

ounce goal is clear then finding an appropriate solution might be easier!

happy bl

@RickyBlender: sorry if I didnā€™t make myself clear. I would like to lay on the ground any object from a starting position as gravity acceleration is acting towards -Z (the overturning moment should be neglected). In the case above the tilt-cut cylinder should rest on the XY plane as shown in the second figure.

@CoDEmanX - Iā€™m not aware ot the math youā€™re talking about. Can you be a little more specific? I would like to learn more about that.

some other questions about the applied-physics-solution:

  1. since I would like to neglect the overturning moment, I have to move way way ā€œdownā€ the center of mass in order to avoid the effect. I figured out it can be done translating ā€œupā€ the mesh. Is some other way, maybe more ā€œelegantā€?
  2. how can I stick to object the translation-rotation reached at the end of the simulation (ALT+A) ? the object always come back to the initial positionā€¦
  3. how can I get directly to the final equilibrium position?