Refit Mesh Object to new shape

I think in this case it would work best to make a cage with fairly simple topology on a reference hand, and pull the vertices of this cage onto the different target hands.
Then you could model the detailed structure around the reference hand, and morph from that to the target cages.
I’ll try and make an example.

Here’s an example showing wrapping a mesh onto a new target and morphing to that
wrappingmeshes.gh (619.2 KB)

3 Likes

Daniel… this is a really powerful tool for certain people :slight_smile:

I have purchased the upgrade to rhino 7 and should get the serial codes… tomorrow hopefully… then I can create the quadmesh… and object cages… and really give your script a good irish test :)… no alcahol involved :wink:

Thanks a million. I dont think many softwares have this option to refit meshes to new objects… super cool.

Ian :slight_smile:

1 Like

Great.
I think the workflow I show above still needs a lot of improvement, and hopefully some of the steps can in future be made simpler - like the way of creating and wrapping the red/blue meshes. Let me know if you have any trouble applying it to your shapes.

1 Like

Hi Daniel.

I just installed Rhino 7 and got 2 error messages with your last script ?
Any idea why that is happening ?

  1. Vertex geometry failed to load. Mesh topology may be corrupt.
  2. Face vertex exceeds mesh vertex count.

Here are the messages:

grafik

The component with the Play icon is a Data Dam component.
This delays the downstream components from calculating until you click it.

It is needed here because the final morphing can take a second or two, but the wrapping happens iteratively, and we don’t want to have to wait for the morphing each time it updates.
When wrapping onto different hands the ‘LengthFactor’ input might sometimes need adjusting so that it fits well, and it can be helpful to see live updates during this.
So in this definition you need to let the wrapping part run, checking that the mesh labelled ‘cage wrapped onto target hand’ fits well, and adjusting LengthFactor if needed. Once it has finished solving the Kangaroo component will say ‘converged’, then you can click the Play icon of the data dam to pass it to the morphing part.
This is what I’m referring to when I say I’d like to make it simpler - I think there might be a way to automate some more of these steps.

This is really interesting and would have a huge number of uses for things like prosthetic design and custom fit anything basically.

2 Likes

yup… then we could invest our time is desiging the best 3d products for disabled people… and not just in the repeative 3d production…

big win… amazing design… snap… onto the new leg or arm or hand… check and … :slight_smile:

2 Likes

Ok… so im trying Daniels new Mesh Snap system and… I love it :slight_smile:
Im on a train this evening for 6 hours… so 6 hours of testing :slight_smile: cant wait.

One little thing, can Daniel please explain to the idiot irish boy… how I create the cage mesh like you did in the above example ? I think I understand the rest…

With some tweaking and using the new beautiful quad resmeshes… this would be a big big tool for rhino 7 !

wrappingmeshes 24.03.2021.gh (614.3 KB)

this guy…

how did you create that cage ?

Thank you.
Ian :slight_smile:

Has he just split the original mesh with some cutting planes and then done a TriRemesh?

I started from a box, extruding and deleting faces, then quadremeshing and pulling onto the reference hand with a similar definition as the other part.

I like the way @martynjhogg describes though and it might actually be easier.

4 Likes

Indeed, using mesh split then remeshing that seems to work well

3 Likes

Wouldn’t it be an idea to add a boolean output to the Solver which triggers “True” on “Converged”? That way one could automate complex nested workflows in efficient ways.

// Rolf

1 Like

Evening Daniel.

I was trying out your code this evening.
One little thing I noticed… when you create the first cage… copy that and move it onto the new body… then change the cage a little to fit around the new body… well depending on what you do with the new cage… (changes) you get very off results… crushed up results or just simple weirdness… ( screen shot )

Just so I totally understand…
(1) Make a copy of your original object mesh-
(2) Split the new mesh so it covers where your object will be placed.
(3) Select your original object and also the new cut mesh ( cage ) into the top of the grasshopper system
(4) Copy that cage mesh and move it over the new body ( body 2 )
(5) Edit the new cage to best fit the new body ( body 2)
(6) Add the new cage and new body 2 into the grasshopper script.

Two questions. How best to edit the cage ? so I get a clean transfer ?
Second question. Should I re-quadremesh the original cage and also the second cage, so they both have the same quad count ?

Thank you. Ian :slight_smile:

I think you need to create the cage-mesh (and quad it) just one time

once you have a good cage-mesh, you will use it as:
→ cage n°1 as base-point for the transformation of the HQ mesh
→ a copy af the same cage-mesh (baked in Rhino → reoriented in space in such a way it kind-of covers the new hand → re-referenced back to GH) that goes through the Kangaroo definition and becomes the cage n°2 (final deformation)

so it’s the very same mesh with very same number of point, faces and adges, that gets just stretched around a new hand-model

I have also found useful to add a grab component in Kangaroo and play stretching a little bit the mesh here and there just to avoid those little waves that sometime happen
image

by the way, this discussion is just AWESOME <3

4 Likes

Tomorrow im back on the trains for another 6 hour stint… so im going to try Daniels script again. This time paying more attention to how we build the cages and also edit the cages…
Ill love to get enough feeling for this, that I could give it a real go next week and use to rescue some of my old work…

Thanks Daniel and… everyone for putting this together.
Ian :slight_smile:

I did something similar three years ago before we had quick and easy remeshing.

I believe still today you have to create your reference mesh manually so you get perfect topology. Quad Remesh does not create good topology all the time…

In my example I’m first using the OnCurve goal to pull the vertices of the coarse mesh to the curves and then OnMesh to pull the coarse mesh to the scanned geometry.

All that is needed for the mesh morphing recipe above to work is that the reference and target meshes have the same topology. It doesn’t need to be all quads, or even a particularly nice isotropic mesh.
The process of pulling onto the target shape is made a bit easier if the mesh is decent though.

Indeed, this is a good idea (and others have asked for something similar). The Zombie solver is one way of preventing downstream execution until after convergence, but that doesn’t show any updates at all during solving, and doesn’t allow the use of Grab.
I think for a boolean ‘converged’ output to be really useful there would also need to be a version of the Data Dam taking a boolean input.

2 Likes
+ 

// Rolf