Shrink Wrap with Kangaroo

this is very cool Daniel, I noticed that the convex edged that stay crisp are also the ones that have a row of points (red) along them, and the ones that get ‘eroded’ or undefined are the ones that do not have these points. I’m not familiar with Kangaroo yet, is this a solver problem or an input problem?

1 Like

The remeshing step after taking the convex hull can keep sharp the mesh edges which are on sharp edges of the hull. Then in the relaxation these points can be kept on those edges.

However, as the mesh shrinks it can collide with new parts of the solid being wrapped, with sharp edges that weren’t part of the convex hull.
Since it is only the points of the wrapper mesh that are being checked for collisions, mesh edges can still end up passing through the solid.
Ideally we’d check for collisions of the edges or faces of the wrapper mesh with the solid, and then split or flip those triangles to make new crisp edges form as needed. It gets a bit complex, but I think could be a route towards the kind of crisp shrinkwrapping that magics can do.
There was some nice work on this kind of approach for cloth simulation in last year’s SIGGRAPH:

Some day I’ll have a go at making something more like this.

Thank you very much for the reply. But I am getting an error message next to the right most mesh command saying that data conversion failed from line to mesh. And also, do I have to set my objects in the Brep? once I do that, the grasshopper goes Not Responding. I am trying to Set Multiple Breps with complex and large size. Is that maybe why the grasshopper goes not responding? Because my final purpose was to wrap my building which would be complex and multiple objects. Please let me know what I should do. Thank you very much!

that makes sense Daniel, thanks for the explanation. Having a solution where no points/edges touch the input mesh would be ideal. Even having a nominal offset amount, so instead of the wrinkwrap touching, it can stay always away by a keep-out distance. Than can also be controlled by offsetting the input mesh I guess, but when those are complex and non-manifold, or have self intersections, the mesh offset fails.

This error is due to the output from the Solver consisting of my than just a mesh (mesh and lines). If you use the ‘explode tree’ component, and then plug the second output (consisting of only the mesh) into the mesh component, it will clear that error.

You can plug your Breps into the first component…replacing the boxed-shaped brep that’s already in there. As for your Breps…it would probably be best to use one singular, closed Brep that’s a simplified form from your building.

Thank you very much Ahnjoe94

hello, I used this definition days ago, but suddenly it is not working…?

I thought maybe it was a problem with the definition I had been working on, but I just redownloaded the one on this forum, and same problem.

I had been working on it on a different computer, but my Rhino is updated, I have all the components the definition required.

Have you changed the starting geometry referenced from Rhino?
What is the error message on the Convex Hull component?

Yes, I changed it.

The error message was:

  1. Solution exception:Could not load file or assembly ‘Plankton, Version=, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified.

Actually today, I downloaded Plankton version 4.0 specifically, and now the definition works but the shrink wrap is still not as ‘slack’ or stretchy as it was. It’s pretty rigid, like it stopped at wbTriangles in the definition. Also Rhino gets a LOT slower/just freaks out and goes non-responsive for a good 3 minutes once I set a new brep for the definition.

What my wrap looked like:

Now w/ Plankton 4:

Dear dan,
I also have some problem. It appears that Simple remesh is installed !
but then when I restart the rhino it wants me to download it does not show, and I can’t find component anywhere on the web to download it manually.

Hi, were you able to solve the issue with the error message? I have the same error message on the convex hull with rhino 7… I also tried with Plankton 4.0 and end up with similar results.

Was anyone able to solve the error message on the convex hull command? I tried replacing the original plankton .gha with plankton v4 but nothing has changed.

I’m on rhino 7, the definition works fine except for that small error.

Daniel, thank you for the amazing script and custom goal.
Do you think there is some way to make it work for this set of branches in 3d space?
Basically I have joined the branches and a interior mesh but the branches for some reason are not detected. Is that because the subdivision of the wrapper is too big? Or is there something I can do in code to enhance the detection of this relatively small volumes compared to the bigger mesh of the interior?

Hi @ankere

For something like this where the parts are spiky and very thin relative to the overall volume I think a different approach might be needed. The point-solid or edge-solid collision approaches above probably won’t work here.
Can you describe a bit what you have and what end result you are after?
Is the input a collection of closed manifold meshes?
Do you need a specific topology for the resulting mesh?
Do you want to to fit the shape tightly everywhere or are you looking for something that forms webs or curved regions between the branches?

@DanielPiker, thanks for your fast reply!

I’m writing a tool that would combine branches into shell like structures as part of PhD work. I used a custom made equations and ipopt solver for this results (but probably would switch to Kangaroo2 in the future as there are too many problems with my implementation). Here is a bit idealised sample without the spiking parts which would be there in some cases:

Basically, I want to wrap this structure with something like semi-transparent elastic (cloth?) material and then calculate the total area needed for quantity estimations.

Topology is not as important as the final result looks that should look realistic without sharp edges. Ideally a tight, one shell surface fit is best for this case, but I am also really interested if it’s possible to form find something in-between the branches that can act as structure or panel? Do you think this is solvable?

The meshes were processed and are all closed, went trough Mesh Repair but some could contain very few (4-10) non manifold edges or other problems even after the repair but I had no time to fix manually all. Scale is real size (mm). I can send a sample file if you think that can help?

Here’s an updated version of the approach using the convex hull like I posted further up this thread.
The outermost spikes are the ones that tend most to slide through the mesh, so here it anchors all the points which lie on the hull. (80.8 KB)
There’s still the possibility that other spikes which are internal to the original hull end up poking through as the fabric shrinks, but it’s a start.


Wow thanks for the fast answer Daniel!
Somehow it gives an error on the TriRemesh - Invalid cast: Point » GeometryBase which is quite strange as all points are valid and the convex hull is working without any errors. I tried to convert to Point class that is derived from the GeometryBase or even cast to it but still shows the same error :confused: It also does the same error on your sample so it must be some library mismatch? If anyone has ideas please share.

That sounds like a bug which was in previous versions of the component, but is fixed now. If you update to a more current service release it should work.


Thanks :slight_smile:
I generally ignore updates for around 6 months once everything is working but will check now.

I tried the gh definition and it works now with your samples on latest rhino but for my data it does not want to. All steps till the solver and merge are OK but when I enable the merge for the data to go to solver it just freezes rhino. I tired with all branches (waited 1.5h) and only with three and the result is the same. What could be the reason for this freeze?

Here is the file I worked on: branchshelter.3dm (3.4 MB)