Using Rhino's squish command in Grasshopper

I am trying to use the Rhino squish command in grasshopper. I have a python block that can run the command, but it requires baking to be part of the process. I am wondering if there is a way to use grasshopper meshes instead of ID’s selected from Rhino?


Screenshot 2024-06-27 114059

Squish issue.gh (9.5 KB)

You could try forcing this ‘physically’ with kangaroo - easier when you have a simple naked edge like in your case.

Triangulate your mesh and then unfold. This helps if you’re not after 100% exactness, which I think you weren’t anyway because squish doesn’t do that.

Check attached file:
Squish issue.gh (21.0 KB)

There’s also a simpler ‘fake squish’ for this case in the file, if you wish to stick with nurbs:

NOTE:
Make sure you press that reset button:
image

Oh wow! thank you that is all very helpful! I was looking to see if I could find a way to do this with python, as I am also trying to be able to un-squish curves to add onto the original surface.
Squish issue.gh (13.6 KB)

1 Like


To use the Rhino squish command in Grasshopper with Python, you can employ the Squisher from RhinoCommon.

import Rhino.Geometry as rg
squisher = rg.Squisher()
parameter = rg.SquishParameters.Default
a = squisher.SquishSurface(parameter, srf)

Squish.gh (8.4 KB)

3 Likes

Not sure what this was, no curves were in the file, maybe internalize them?

Equally unsure what your end goal or workflow is, not that I need to know, though :slight_smile:

Mahdiyar corrected the python - not sure it’ll work with your halved sphere automatically, though.

I tweaked* the previous file:
Squish issue.gh (37.9 KB)

*made trimesh border vertices use ‘co-circular’ goal, played with MeshMap and some surface morphing options to ‘unsquish’ some test curves - unsure that’s what you’re doing, though:

Cheers!

1 Like

Thank you! This was exactly what I was trying to do. I ended up figuring out how to use this to un-squish curves as well.

Squished.gh (16.1 KB)

Is it possible to squich points/curves with the surface ?
I am getting some errors simply providing points to sqich wit the points:

Please how to convert points to the proper format so the squicher sqiches ? :smiley:

I’m not 100% sure if I understand what you are asking correctly, so I apologize if I am misunderstanding. But I would try setting either the mesh or points inputs to list access?

Yes you are right, that was the main problem.
Thank you.