Skip to content

lucianoambrosini.it

The 2D Minimum BoundingBox in 3D Space

Trying to keep fit is always a good idea! I found this interesting challenge made by Ryan Hughes (here)

 

Looking for a computational design challenge? I’ve just mocked up a quick test for some of the applicants to our internship program, which we are still accepting applications for (link below).

The challenge is to find the minimal bounding surface (flat box) for an arbitrary set of points in 3D space without using any Grasshopper plugins. You can, however, get bonus points if you write code and use external libraries – e.g math or numerical libraries – hint hint.

Link to the GH file:
https://lnkd.in/eMuX39Gj

the most interesting thing is to get the solution to solve the challenge by Grasshopper default nodes only and, then, try to implement a script/code if you prefer.

A) I started with the Grasshopper nodes only (and I think it was great), only in some specific cases (tricky/custom/projects) do you need to get your hands-on scripting and coding.

Tips: playing with Points. Planes, Rectangles and certainly BoundingBox it is the right way

 

B) Then I coded a Python node to provide a compact solution with only some useful outputs.

Tips: try to think of the workflow/algorithm elaborated at point A

 

 

I must emphasize, that have implemented in the output the possibility of extracting the Convex Hull curve, I did not rely on codes (C # and/or Python) widespread on the net that encode algorithms such as:

  • Graham scan
  • Quick Hull (divide and conquer)
  • TC (Timothy Chan) algorithm

But I mainly made use of the libraries already present in Rhino + Grasshopper: RhinoCommon, Grasshopper, RhinoScriptSyntax.

In particular to solve the Convex Hull (Quick Hull algorithm) and the correct orientation of the Bounding Box used.

No plugins have been installed for both points A) and B)

 

 

 

Finally, as expected, the version encoded in C # (C-Sharp) is faster in the execution than the one encoded in Python by ~40%

I noticed that Ghpy and Visual Studio seem to have some issues in compiling a piece of code – now I have put these two components (Python and C#) in WIP mode…stay tuned

Here below you can download the “clusterized” version of the Python and C# components as a GHX file:

download  📁 —> LA_2DminBBox_v1

 

Interested in my works? see *About Me* section and contact me by email and/or by social