Geo Nodes - ShrinkWrap only convex areas of mesh?

Hey everyone

I’m working on a wrap generator using geo nodes and I am running into an issue I am unsure how to solve. I basically want to shrink wrap a curve circle around an object but I want it to wrap around the object naturally (like a tight strap) so that it doesn’t get projected into the concave areas of a mesh. As soon as it reaches the peak of a convex area of a mesh, the tension line of the curve should be straight until it reaches the next peak (as seen in the attached image below).

I would greatly appreciate any advice on how to approach something like this.

Thanks!

a convex hull node may do the trick

convex

6 Likes

Thanks Dan! I had no idea that node even existed. That’s exactly what I was after :sweat_smile:

1 Like

Apologies, I think I may have flagged as solved a little early. I did some more testing today and ran into a few issues.

  1. I cannot create a convex hull on the shrink wrap object as I want to wrap onto all kinds of non uniform shaped objects (for example, a horn). The convex hull will fill the volume of the objects bounding box.

  2. Because of the above problem, I thought it would be better to instead use the convex hull node on the individual wrap edges/curves themselves. This produced promising results on curves that are perfectly flat as it will create the desired result and just fill the shape with an Ngon which is easily removed. However, since the generator will add random rotations and shrink wrap these curves down onto non uniform objects, the wrap curves will never be perfectly flat. Because of this, the convex hull node produces some nasty geometry (and adds thickness so there are no boundary loops to be selected):


    My first thought was to try isolate the edges based on the angle sharpness however this isn’t a great solution because the angles can be vastly different depending on the object you are shrink wrapping to and the random rotations of the wrap curves.

Any thoughts on a more solid method of approaching this?

Thanks again.

Not sure if I got the idea right, but if you want to add circular rubber bands to an object, they would always be flat on a plane, with the plane being randomly rotated right? So I guess if you would just get the boolean intersection for said randomly rotated plane, you could just get it’s concave hull, delete whatever faces you don’t need and go from there?

rubberband03
rubberband06

That would be how I’d approach it (if I get the main idea that is) Could probably even make it additive with a repeat/sim zone.

3 Likes

for the 2 sided geo thing… many ways to approach this, but you could just use the intersecting edges of any boolean operation between the scaled up and the extruded convex hull -


convexhull

2 Likes

Ah I see what you mean now. That’s a great way of approaching it. Using Boolean intersections rather than shrink wrapping curves takes a lot of the complication out of the setup and avoids all the issues with the messy topology. I’m going to have a play tonight and see what I can come up with.

Thanks again :slight_smile:

I’ve created a setup that works well using the boolean/repeat zone however I am still having a few difficulties cleaning up the border convex hull edges.

I tried the method in your last post but it doesn’t work too well on more messy geo from the convex hull boolean intersections. The star example you showed works, I think, because the geometry is very simple and doesn’t triangulate heavily when converted to a convex hull. But when you start to introduce a heavily triangulated mesh it generates a lot of errors in my tests unfortunately.

So far the cleanest approach I to extract the boarder edges of the convex hull is to use edge angle and compare how close/equal it is to 180 degrees followed by a merge. It gets close but it still leaves behind quite a few artefacts due to all of the tiny elongated triangles around the border edge.

I used the boolean intersection of the plane I used for slicing and the extruded concave hull. Seems to work pretty well for more complex stuff as well -
rubberband07
Anything that works though, I’m sure there are lot’s of ways to do this.

1 Like

Ok, I think the scale and size of the extrude was messing things up on my end. It does work quite well, especially when you use the original plane used to boolean as the intersecting mesh. It can generate some jaggy edges due to the extrusion of lots of triangles but I found that blurring the position attribute helped soften all of that out.

Thanks for all your help!

1 Like

either that or just a merge by distance node to make sure those edges ain’t too messy. good thing about geo nodes, many ways to get the desired result.