I have a variety of - internal - C#'s that do unroll jobs. They layout/label developable faces not in the way that you want … but I could over-simplify and modify one this w/e (there’s a F1 race but is in afternoon [Mexico]). Have in mind that this would be a 100% black box for you if you are not familiar with coding: i.e something freaky like this:
first of all a friendly reminder not to destruct any existing data structure.
(90% of this definition is just to restructure the pyramids in rows and columns)
now, I fiddled a little bit and found that since the pyramid shapes are quite irregular, I don’t think you will find a ‘golden’ algorithm to unwrap them. in this definition, you can unwrap them in small groups (I think ideal is 2 or 3)
In my mind, if this is a school project, you’re better off gluing 30 or 40 pieces than spending a week finding an algorithm to reduce them to 9
A decade this way (optimistically speaking) … or an hour the other way:
First (general case: using a BrepFace) you should detect islands in the divTree (representing each non null quad pts set as a bool Matrix cell: that’s classic Matrix stuff). A Surface doesn’t need that … but where’s the challenge?
Then you should create your pyramid 4 sides per quad pt collection (where none is null) in a controllable manner keeping track what side is connected to what.
For each side you should create mapping planes for the unroll (per quad sides) task. Why not using the Unroller? Well … I’m not 100% sure about what that thing does (i.e. if it respects the face order - but I guess that it does that).
For each pyramid quad set you should create mapping planes (from, to) related with what side is connected to that other. These would allow you to map an unrolled set to the previous one (the one that in the Matrix is related with the new, that is).
When ready with breps, planes, cats and dogs … is a classic backwards recursion task where you may go back and rearrange the unrolled sets already placed if a ccx event with the candidate one occurs.
Don’t even think to do that with components or Anemone.
Shown some WIP tests (speed is all what I am after, mind) where the pyramids have random hights (dMin-dMax).
If so as a challenge and using a BrepFace do the 2,3,4 steps.
Other than that the Unroller gives up quite fast: See some test results VS corrected ones meaning that while there’s a solution around (that’s obviously not assured for any Brep) the thing is rather in a hurry to provide some result
This problem is very difficult!
Fortunately, some brilliant mathematicians have worked out some beast-level theory in this area.
And Andrei Nejur has done an amazing project to make it into a Grasshopper plug in called Ivy.
You should be able to get results with Ivy.