I received this script in my last post. It’s nearly working as I want it to. The only problem I still have is that I want the final result, not ass one poly surface. I want it to be many pieces that are like the red outline I marked in the image. In the end, it should still be the same form just in many of those pieces.
I started with code I posted to your thread six days ago:
At first I tried a C# cSwp1 thing from another thread but it was slow and left gaps (disabled gray group) so I resorted to the Clipper plugin to do an offset, then scaled and lofted to get hexagonal solids.
Thanks but I don’t consider myself an expert at Grasshopper. I’ve used it for nine years(?) and been active on this forum and its predecessor for eight years. I’ve read a lot of other peoples’ code, which is a great way to learn. I was a programmer in conventional languages for ~40+ years, with a penchant for detail (OCD?).
The code I posted here wasn’t perfect, though I fixed some things (below). I actually started with code from this post, not the reference I made earlier:
The current code is based on some observations of the dome geometry.
There are 720 triangular surfaces.
Disc and CullPt(white group) tells me that there are 362 unique points.
These points are the centers of the hexagons and pentagons.
So each of the 362 points has 5 or 6 nearby points around it.
I used Closest Points(‘N’ = 6, not 7) to get those nearby points but need a way to ignore one of them for the pentagons. I had used Smaller than 2 to cull them but that depends on model dimensions and would break if the dome were larger or smaller… So I’ve replaced Smaller with the purple group (below) to tell me if I should use only five or all six of the points.
The rest is details. Like sorting the 5 or 6 points AlongCrv(circles) to get them in proper sequence before connecting them with PLine, etc., etc.
Other facts I learned about the dome geometry:
There are 362 “polygons” - no surprise, same as the number of unique points.
Of those, there are 32 planar surfaces - 12 pentagons and 20 hexagons. All the rest are not planar.
I used Clipper because standard GH Offset Curve didn’t work correctly. Since then, I changed the way I derive the relevant planes so decided to check again, but no joy. Instead of Clipper I now use Scale to make an offset (inset) of the Pline curves, which works fine. No plugins at all now.
I explored several ways of deciding whether to use 5 or 6 of the closest points (purple group), including variancecomputed in Pyhon, but in the end used a simple method that compares the distance for the last point to the average distance of the first five points. The ratio (rounded) is 1 for hexagons (6 points) vs. 2 for pentagons (5 points). Works well, regardless of size.