I am trying to fold an unfolded mesh to form a polyhedra. I manage to fold the central part. However, I want to snap the folding points to the top and bottom polygon of polyhedra (if it is possible to keep top and bottom polygons as flat). How can I make the points to snap to intended polygonal face? (Keep the points connected shown with blue lines in the image while folding the pattern)
What is the intended output here?
It looks like you start from the assembled 3d shape, unroll it, and then you want to reverse that process? Is it to show the folding process as an animation?
I modified the code diving the unfolded pattern into three pieces. Then, trying to roll over the central part around the top and bottom layer as a second simulation by using onPlane components and Snap components of Kangaroo. However, I cannot manage to snap the points to rotated bottom and top parts of polyhedron.
Yes, polyhedra is also within the code. Brep unfolding to a crease pattern. But I want to simulate folding behaviour ln reverse for a given crease pattern. Because of that I used hinges. But I cannot achieve the final shape as a result of folding of hinges.
start with a brep face that’s already in the plane that you want the final unrolled result to be in, here the XY-plane and thus bottom face
chose one of its edges - let’s call it E -, and look for the next face that is not the current one but shares the same edge E with it
look for the angle between the current and next face (vector angle between their normals) and rotate all remaining faces around edge E by the same angle so that the next face lies flat in the same plane as the initial face
chose the next edge E’ on the just unrolled face and repeat steps 1 through 4, until all faces are unrolled
Of course this might be a little oversimplified, you might for instance have to check if the newly unrolled face intersects any other, already unrolled faces and backtrack if that’s the case, but it might be a good start and will give you full control over the process.
Hm, probably not. What I proposed is possibly easiest with some scripting (Python or C#), but should also be feasible with vanilla Grasshopper components that is if you need that amount of control and want to invest the time.
It depends on what you want to achieve.
There’s also the Ivy plugin. Have you already tried that?
No, I haven’t yet. Do you know any example files?
It is really disappointing that whenever I have tried to use Kangaroo, I cannot improvise sth that I want. It is really limited in terms of adaptability of the components. Just saying..
Check the link I posted above. The author has posted some examples along with documentation about plug-in there. I haven’t it used it thus far, but I know that it’s about unrolling.
Kangaroo takes some getting used to and sure has certain limitations as does Grasshopper. If you want more control and flexibility, you need to learn programming, but that’s a deep, deep rabbit hole.