Planarize Ngons



Author:

Categories: PN3+DC3

Tagged with: | | | |


Lada Lutkova, Václav Centner

0_why

The inspiration came from projects by the University of Stuttgart’s Institute for Computational Design and Construction. They have created shell pavilions with complex forms, where the shell is constructed from NGon-based panels.

The reason this semester project focuses on understanding planarization is the failure of my (Lada’s) previous project, where I tried to design my own pavilion. I generated a complex form using the Kangaroo plugin, but I wasn’t able to successfully apply the NGon plugin to planarize the panels. 

1_what is planarization

Planarization is the process of transforming a set of non-planar polygons or surfaces into planar ones — that is, making every panel lie exactly in a single geometric plane — while trying to preserve the original overall shape as much as possible.

2_Ngon plug-in

https://www.food4rhino.com/en/app/ngon

This plug-in allows you to go from a desired overall form to a detailed, rationalized model that’s suitable for CNC cutting and assembly.

3_how to planarize without Ngon

Why bother planarizing panels in another way if we have the NGon plugin?
This project started from a previous attempt that failed, because NGon does not work reliably in every case. For some geometries, it is difficult — or even impossible — to get a good planarization result using NGon alone. So the question becomes: what other methods can we use to planarize panels?

3.1_ physical approach – using kangaroo solver

That’s the first thing that you will find on Youtube, if you ask about planarization.

This example uses hexagonal panels, since this is the most common panel shape in these types of structures. For the Kangaroo simulation to work, we need to define forces. In this case we used CoPlanar to make each set of points planar, Rod to keep polygon boundaries flexible, and Anchor to limit how much each point can deviate from its original position.

The input for the CoPlanar force is structured as a data tree, so it planarizes only the points belonging to each individual polygon, rather than all points on the surface. However, Kangaroo runs the simulation on all points simultaneously, so the data tree structure is effectively flattened once it enters the solver.

For some shapes this approach works quite well.

Physical approach – not what we need:

Kangaroo treats this like one simulation and tries to make planar not single panels but larger wholes.

On double-curved (i.e. non-developable) you cannot create a continuous tiling of perfectly planar polygons without distortion.

That’s why we need to allow each panel to move a bit more freely. Small gaps will form, but they are of no concern. 

3.2_planarize each Ngon separately

After the physical approach failed, the first idea was to planarize each n-gon separately in order to better understand how planarization works.

This script also uses the Kangaroo plugin, but instead of planarizing all NGons at once, it processes each one individually. We simply loop the script to run it for all polygons in the model.

That said, it’s honestly not the most efficient approach))

3.3_ geometrical approach

This time, instead of forcing points to be planar, we generate new points based on the original ones to create planar polygons from non-planar shapes. For each set of points, we approximate a best-fit plane, then find the closest points on that plane and construct new polylines. With this approach, each polygon becomes perfectly planar. This method allows you to planarize NGons on any shape you create.

The only drawback is that, for some shapes, the gaps between panels can become too large.

3.4_using NGon plug-in

So, how does the Ngon plug-in manage the same thing that we tried to do?

NGon uses a geometry-based approach, but it optimizes the overall surface as a whole. It adjusts the shape of each n-gon to reduce gaps between panels and make every face as planar as possible. In this case planes are not perfectly planar, but the difference is insignificant for real structures.

4_how planar are our NGons?

We wanted to know how big this insignificant difference is.

4.1_theory – how to measure

Any three points define a plane. We can select three points to construct a reference plane, then measure the distance from the remaining points to this plane. This tells us whether the points are coplanar, and if not, how far they deviate.

To do this mathematically we need a plane equation and an equation to measure distance from a point to plane.

formulas: curtsy to Chat GPT

4.2_calculations

In the begining it was necessary to create a tool to see how much deviation was in question. There fore a sheet was created. You can copy coordinates from Grasshopper to table and by choosing your points the remaining points get selected automatically.

The ambition was to create something as universal as this table. Where an error of selecting tow same points would be ruled out by the script. After failed attempt to create a Python script I landed at setting this solely in Grasshopper.

In the end the script is more simple to prepare. But requires more concentration to not use the same point when choosing the deviated ones.

4.3_measurements

Here the script clearly showes the inaccuracy in ceometry when using kangaroo

Plane defining points are green, deviated is pink, projection of the point is blue. Distance is represented by a pink pipe.

After using the same script on geometry generated by Ngon we can see that this plugin doesn’t make deviations. The “deviated” point and projected point are the same.

Plane defining points are green, deviated is pink, projection of the point is blue. Distance is represented by a pink pipe.

5_FILES

links:

https://discourse.mcneel.com/t/planarizing-an-ngon-mesh/140306/4
https://www.learn-visual-programming.com/ngon
https://discourse.mcneel.com/t/kangaroo-planarization-while-staying-close-to-the-original-surface/155591
https://www.matweb.cz/vzdalenost-bod-rovina