How to lay item flat

How can I take a ring jewelry item modeled standing up, and lay it flat as shown in the attached pictures? I want to do it automatically via GH to ready hundreds of models for rendering.

@DanielPiker Could there be a possible kangaroo solution to this? Need to find contact points on the front side of the model so that it can lie flat on a surface.


1 Like

Hello,

For this precise example, a simple rotation or Orient would be enough.
If you have different shapes, maybe using the bounding box to compute the correct rotation could be possible.
I’m assuming you have the rings modeled in Rhino and you need the output also in Rhino with layers/materials ready to render ? If so Elefront plugin will be helpful to bake the rotated ring/stones back in the appropriate layers…

Here is an example. If you need more help we’ll need some Rhino files…

RingRotateExample.3dm (13.0 MB)
RingRotateExample.gh (14.0 KB)

1 Like

I tried your example with your file and a flat ring model of mine. it’s rotating from the middle of the shank bottom to the top of the bounding box middle corner, which is not level between the 2 points

Yes, I know. This was only a raw idea on how to proceed, not a definitive solution. As said above, it will be hard to find a geometric rule that works for all your models without you providong at least some example files…

Thanks for your reply. If you can get it working with your ring, then we have a place to start. Your model has the primary constraints: wider top than bottom.

Another method using Kangaroo rigid bodies. It’s not perfect but the best I can think of now.

I can’t mesh my sample ring properly so used Populate Geometry instead.
The final transform is rather slow so I used Metahopper to disable it while Kangaroo is running. This is not mandatory.

FlatRingKangaroo.gh (17.9 KB)

A simple way to find position is to use Convex Hull


Here i just use the 10 bigger (use the slider) faces to orient the object. One better way will use the center of gravity of the object, if it is on the triangular face, the object will be stable.

put object on plane.gh (12.3 KB)

And here a version with Center of Gravity. I had to add Dendro to have a valid volume has some ob closed brep doesn’t lead to closed mesh. But whatever I get an approximate closed volume that I use tp calculate CoG then I just take faces of the 3d convex hull that contains the CoG. I take the 1000 bigger faces. I obtain 8 stable positions.
Frame-00
Frame-01
Frame-02
Frame-03
Frame-04
Frame-04
Frame-06
Frame-07
Frame-08

A version with CoG, automatic flip and the bake from @magicteddy


put object on plane with center of gravity and bake.gh (11.3 MB)

4 Likes

@laurent_delrieu Thanks for pointing out Mesh Edit plugin that I didn’t know. Seems to be a small collection of very useful tools, and it doesn’t add another tab on the ribbon : definitely a keeper.
I had the convex hull in mind yesterday but since native GH only has 2D convex hull I couldn’t get very far. Very nice solution !

There is Convex Hull also in Ngon.

Thanks, I thought about it since some times but never used because I mostly model thinks that stands. But sometime if object doesn’t stand I add some objects.

This is great! Thank you very much!

A few more tweaks to what I’m looking for as an end result :slight_smile:

2 Likes

Hi Laurent,

The geometry flipping on a negative dot product is causing inverted normals on the final geometry. Instead, rotate the geometry around the y axis of the origin plane.

Here’s some updates I did that 1. does the y axis rotation around the source plane, and 2. Recenters the geometry on the final orientation plane (because the original geometry is not centered on the source plane)

1 Like

Indeed Using Flip was a mistake it changes the object. Just translation and rotation must be alllowed.

1 Like

Rhino | Shot with GeForce - YouTube

1 Like

Very nice tool.
I didnt try but it could also be possible to sort the views with something related ro the distance of cog from the face or an angle between the CoG and the face. So the first position will be the most stable.

1 Like

That actually works really well! Thanks for the suggestion

The last suggestion works well, but I found if moving the source geometry away from the world origin, I was getting different results as the initial stable value.

This solved the problem.

Here’s a sample file for you to try, let me know if any issues: Requires MeshEdit Components plugin and Dendro plugin.