Rhino WIP Feature: Two new algorithms for Squish

We’re introducing two new algorithms for the _Squish command that offer more control and robustness compared to the original implementation. Like before, these methods flatten a 3D mesh into 2D by minimizing distortion, but now with enhanced physical realism.

The new solvers account for orthotropic material behavior, allowing independent control over stretch, compression, and shear along principal fiber directions. This enables more accurate flattening of materials like woven fabrics, composites, or anisotropic sheets.

Two new algorithms

The new Squish variants explore two strategies for mesh flattening: a physical and a geometric approach. Both approaches aim to preserve the original mesh’s shape as much as possible in 2D, but offer different levels of control depending on your application.

Physical Strain

This method uses a physically based formulation. It minimizes strain energy derived from directional stretch and shear, measured relative to orthotropic material axes. This requires users to specify material properties like strain and shear modulus as described in detail below. Try it in _TestSquishPhysicalStrain.

Geometrical Stretch

This method takes a geometric approach, evaluating stretch and shear from triangle shapes. It models deformation by analyzing triangle shapes and minimizing relative distortion, without requiring material parameters but rather ratios or weights for the different components. Try it in _TestSquishGeometricalStretch.

Fabrics and sheet metal

We are focused on providing fabric designers with control over material behavior. These algorithms are also very robust to many different kind of meshing defects, and work just as well on isotropic materials like steel. Sheet metal drafters should also see benefits to using these new algorithms. If you have example problems in these areas, we are really looking forward to hearing from you.

Improvements

One known limitation of the original Squish command is its difficulty handling surfaces with large bends. The example below shows a case where both new commands can handle the deformation:

Another interesting comparison point are the TexturingTools flattening methods, such as LSCM and ARAP. Unlike these, the new Squish algorithms let you assign material properties per direction and specify a fiber angle. This allows directional control over stretch and shear, which is not possible in traditional geometric methods.

How to try it

The new algorithms are available as _TestSquishPhysicalStrain and _TestSquishGeometricalStretch. These may be integrated into the main Squish command later, but are currently separate to allow more flexibility during development. The available command options for both are described below.

Command Options

For both commands
  • FiberAngle: Angle (in degrees) between the weft fiber direction and the global x-axis. This sets the material’s principal directions for anisotropic energy terms and influences how stretch is measured and minimized. The default is 0.

  • MaxIterations: Maximum number of iterations for the local/global optimization loop; default value is 50.

  • ConvergenceTolerance: Specifies the energy-change threshold for early termination of the optimization. If the change in total energy between successive steps falls below this value, the algorithm stops. Lower values enforce stricter convergence, while higher values allow faster but potentially less precise results. Default is 1e-6.

For TestSquishPhysicalStrain
  • StrainModulusU, StrainModulusV: Strain modulus in the u and v directions (warp and weft), measured in N/mm. Controls how resistant the material is to stretching along u and v. Higher values represent stiffer materials that stretch less under force.

  • ShearModulus: In-plane shear modulus of the material in N/mm·rad. This parameter governs how resistant the material is to shearing (i.e., distortion of angles) between the u and v directions. A higher value leads to more resistance against local angular deformations.

For TestSquishGeometricStretch
  • WeightStretchU, WeightStretchV: Controls the weighting of stretch energy along the weft and warp direction of the material. Increase this to more strongly resist distortion along these axis.

  • WeightRigid: Sets the weighting factor for the rigid energy term in the optimization. A higher value penalizes deviation from rigid transformations more strongly, favoring solutions that preserve local shape and orientation.

In the example below, we vary the WeightRigid value for squishing a half-sphere. The higher this weight is, the more the edges of the mesh will be stretched when going from 2d to 3d, but the least closer to a square the flat mesh is:

What’s next

The new Squish algorithms are in active development and still have many limitations and missing features such as improved result visualization, restriction to meshes only and computational time. However, we are looking forward to receiving your feedback on both algorithms as we continue developing them.

41 Likes

Interesting I need to learn how to use squish looks useful

1 Like

Hi @smpeter

Two things comes to mind :

Are there plans to add parameters to take thickness into account?

Material behave differently in various thickness…. even if the simulation is with a 0 thickness open mesh [maybe Srf too later on]. we’ll need ways to account for the “real world” material in a given thickness.

And what about adding a [small] library of commonly used materials ] to make it easier to start with the new commands…?

thanks a lot

4 Likes

Sounds very promising! I will test it on orthopaedic shoe lasts. Feedback will come, give me some time to play.

1 Like

This is exactly how the exactflat plugin flattens 3d parts to a true 2d flat pattern.

they use a database for the material properties,

1 Like

What’s the easiest way to run these commands with geometry from grasshopper?

@Akash Thanks for all your questions! I hope the following helps:

These new algorithms are only modeling membrane stresses (i.e. assume that bending forces are 0), so varying the thickness would only change the external forces applied to reach the 3d shape from the 2d pattern, and would only change these with a constant multiplicative factor. Since we are not outputting these, changing the material thickness in TestSquishGeometricalStretch and TestSquishPhysicalStrain will not change the results at all.

This usually tracks pretty well with real world behavior that for thin plates in non-isometric deformations, bending forces are small compared to stretching forces. As long as the thickness is small compared to the length and width of the material, the influence of the thickness on the result of the flattening algorithm is negligible.

Of course, some materials like composite fabrics can have varying membrane properties when they are made in different thicknesses. We can’t really model that without knowing in detail the material you are using, but you can still account for that by changing the ratio of StrainModulusU/V to ShearModulus.

We are looking into making a small library of material properties for materials like shearable fabric, stretchy fabric, leather, sheet metal. It will be a rough approximation but should help getting started with a project.

TestSquishPhysicalStrain already has preloaded values for a simple fabric with low shear resistance and symmetric warp/weft stifness: StrainModulusU/V = 0.946 N/mm, ShearModulus = 0.159 N/mm rad.

@martinsiegrist No Grasshopper integration yet, your best way forward is to bake everything and run the command in Rhino (or script the baking and command calling from GH, as is often done for the many Rhino-only commands).

What workflow were you thinking about or would use as a first solution? Have you worked with the ShapeMap plugin at all? It doesn’t have the new algorithms available in it, but it is an attempt at a more modern Squish workflow in Grasshopper. Is it useful at all for you?

I haven’t used Shapemap.

Will try to bake and run it in Rhino…

I compared the new flattening method with a handmade flattening, made with wrinkled paper, a method that I am used to for flattening shoelasts for pattern design of uppers.
Both methods come close as for the results, it is already much better than the older Squish.
I first applied Quadremesh on de 3D scan, for better and faster results.
It might be that the corrections I normally have to make to my hand made flattenings when drawing patterns will be less needed when using the new squish command. I will need to do more practical test to find out.
I also tried different settings, but I did not see much effect in setting different values for the options in both commands. Am I missing something here?
Attached an example of (half) an orthopaedic last, the hand made flattening and some results of the new Squish.
(Note: The last scan is a few mm. smaller then the actual last, because I had to trim something off
the edges to get smooth contours)

MijnLeestNeskridFlattentest.3dm (5.4 MB)

1 Like

4 posts were split to a new topic: Squish: Requests for enhancement and bugs in existing Squish command

These squish commands are looking promising. But how can we flatten details on the mesh with it?

@smpeter @pierrec Great to see better flattening being added to Rhino! Any chance this could work for flattening shoe upper shoemaking patterns (from 3D shoe last to flattened pattern like the one below)?

1 Like

If you have a Rhino 8 license you can download the WIP and test it yourself.

1 Like

Just been testing it out now. It only works with meshes? It runs very slow, and not getting very good results.
I was getting better results with an earlier version of ShapeMap but oddly worse in the latest edition. It would be great to see ShapeMap given more attention and brought into Rhino directly rather than just via grasshopper. Or maybe Squish somehow leverages whatever ShapeMap is doing. What’s great about shapemap is it can do polysurfaces.
This kind of pattern flattening is really common in shoemaking, and I bet there are a lot of shoemaking rhino users that would really appreciate being able to do this.

1 Like

Have you tried Botcha plugin?

https://www.food4rhino.com/en/app/botcha-x-rhino

No. It does look good. I develop a plugin myself, 3DShoemaker. So I’m hoping to make use of internal Rhino tools rather than something from another plugin. Squish does an okay job for half the last, but not so good for comprehensive one piece uppers. The new Squish tools look promising, but aren’t quite there, are very slow, and only do meshes. The ShapeMap tool is much better from my experience, so I’ll keep exploring that direction. It would be great if it became core functionality instead of a grasshopper extension. It seems much more promising than the new squish commands.

2 Likes