# Squish limitations and algorithm

Hi,

I am working for a company that specialises in the cold forming of steel plates. We are currently working on a project for which I want to try using the squish command within rhino as it allows for faster interaction between the 3d model and the plate flattening command in this case. Now I know that squish doesn’t work great on developable surfaces and was wondering how close to developable a plate may get before squish stops working properly. Also a very general explanation of what the algorithm does would be good to get support for the alternative method within the company.

thanks,

Arnoud Herder

Hi Arnoud,

Here’s a wiki page with some technical info on how Squish works… http://wiki.mcneel.com/labs/advancedflattening
If you have a sample file you’d like to flatten and can explain what restraints exist, please upload it here or send it to tech@mcneel.com and we’ll take a look.

@dalelear may know of a more in depth document regarding Squish as well.

G’day @BrianJ,

Slightly off-topic, it concerns me that unrollsrf is converging towards being a squish like command.

Note the topic on unrollsrf being modified to work with a greater tolerance.

IMO they should be kept well apart:

• Unrollsrf for developable surfaces
• Squish for double curvature surfaces

Squish is an algorithm that works on meshes. Squish flattens the mesh by “minimizing the changes in facet area and changes in facet edge lengths” between the 3D mesh and the 2D mesh, subject to some “constraints”.

I’ll give an over-simplified example of what “minimizing the changes in area and or edge lengths” means.

For example, if A,B,C are the corners of a 3D triangle and a,b,c are the corresponding corners of the 2D triangle, the changes in edge length are

``````d1 = |Distance(A,B) - Distance(a,b)|
d2 = |Distance(B,C) - Distance(b,c)|
d3 = |DIstance(C,A) - Distance(c,a)|

da = |Area(A,B,C) - area(a,b,c)|

DL = d1+d2+d3.

DL2 = d1^2 + d2^2 + d3^2.

DA = da.

DA2 = da^2.

``````

D = some combination of DL, DL2, DA and DA2.

The “minimizing the changes in area and or edge lengths” above means create the 2D mesh so that “D” is as small as possible.

In practice there are thousands of facets and many ways to minimize D, most of which don’t make practical sense. So squish “constrains” the answer to prevent the 2D mesh from folding back onto itself and forcing certain 3D points end up in specified 2D locations.

A trimmed NURBS surface is squished by squishing a dense mesh of the surface.

The squish options determine how DA, DA2, D1 and D2 are combined and allow for more complicated ways to calculate of DA, DA2, D1 and D2 and to allow for a bias towards stretching or compression.

However, the squish algorithm is much too simple to even begin to model the true physical properties of most materials that come in sheets, particularly those that where material thickness plays a role and those that can compress or stretch any appreciable amount,

In short, if a sheet of material is expensive, cutting it is expensive, or bending it is expensive, or related issues in the manufacturing process are time critical or money critical, then you might consider using squish to give you an initial hint about the shape of a pattern, but real material and manufacturing expertise will have to be used to create a pattern that will work on the shop floor.

1 Like

Thanks @dalelear for all the info on Squish. @aherder, I hope that helps in your project.

Thanks Dale. I find Squish incredibly useful. Following are a few practical hints I’ve discovered which may be of help to people.

Squish uses the underlying mesh of the surface (correct me if I’m wrong @dalelear). As we all know, Rhino can create some “interesting” mesh topology behind the scenes. I’ve found that most of the dramatic failures of Squish can be traced back to the quality of the mesh it is trying to flatten.
So rather than flattening a surface, it is best to mesh it first and then squish that. Fiddle with your mesh settings to get as close as possible to an even distribution of facets with square aspect ratio. Also note that singularities (ie. where lots of facets share a single vertex point) are death to Squish. Trim/split away any singularities first.
I get best results with aiming for roughly square quad meshes without tri borders (ie. jagged seams checked). Mesh density enough to follow the detail but no more (or your CPU will have smoke coming out of it).

Hope that helps, Steve

1 Like

Thanks a lot for the useful information. Good to know how the command deals with meshes. We’ll be running some tests for the project soon so I’ll prepare the meshes as clean as possible. I know unroll should be used for developable surfaces, but am not completely sure what works best when a surface is close to, but not quite, developable. Will experiment with this as well though.

Greetings and thanks,

Arnoud

Thanks Dale for the explanation!

I was wondering if it is possible to rewrite the squish code and add a custom mesh property. So the user can choose the mesh settings for every object.
I think it would be easier to produce a more accurate expansion with this option.

We work with an super old plugin called Expander for sheet metal manufactoring purposes. This plugin only works with rhino v3. We don´t want to use any other application than Rhino… So we are dying to use someting like Squish for our processes.

I added some pictures of the plugin to get an idea of the meshing.

Help has much of the same info now as well-
http://docs.mcneel.com/rhino/5/help/en-us/commands/squish.htm

-Pascal

1 Like

Thanks Pascal, I read the Squish help serveral times.

The question is the meshing.

If we can customize the mesh per surface, the output would be better.

How is the meshing determined for squishing in the current situation?

Hi Thomas, I believe the render mesh is used. (DocumentProperties > Mesh page for global document settings) but of course you can use the Mesh command to mesh the object, with all the Mesh detailed controls, and then Squish the mesh. This is a good way to squish polysurfaces. You may want to Weld the mesh at 180 degrees before squishing.

Does that help at all?

-Pascal

Yes that does help, but in that case we have to go from nurbs to mesh en back. If this is combined in the squish command it would be better.

Hi Thomas,

Yes I remember the custom meshing in Expander and I certainly miss it along with the nice gradient display of Expansion/compression.
I’ve found the best solution with Squish is simply to mesh the surfaces myself to control the density and distribution of the mesh faces.

Steve

Ok, so you convert the (poly)surfaces to meshes, set a nice density and flatten the mesh with squish?
The next step would be to get the mesh edges.

Do you also use these flatten meshes for manufactory purposes?

Thomas

Hi steve,

We did a test at our office. Expander vs Squish. All the results of the test are listed in the notes of the attached file.
We used surfaces instead of meshes in this case. You said using meshing will result in better solutions.

Can you explain what mesh settings we should use to get a good meshing? If we use surface A in the attached file en generate a mesh, the border indeed got some triangles. Do you suggest to trim that all to rectangles? If we have to flatten 100+ meshes that would be time consuming…
What kind of workflow do you use for this kind of situations?

The explanation of dalelear is very clear. The material thickness issue can be reduced when the neutral line (half thickness offset) is used. For the physical properties, does anyone has experience with aluminium or steel “squishing”?