Problem with hinge in folding meshes in kangaroo 2

Hi,

I am trying to fold a mesh using engine in kangaroo 2.

Meanwhile, I encounter a few problems. Firstly, two mesh faces didn’t weld properly when I am setting up for hinge component. As a result, when I extract the exterior edge it gave me the interior edge as well. I tried to solve this by isolating the unweld mesh, culling out the interior edge and replacing the path.


Apart from that, after grouping two adjacent mesh faces, some remain non-quadrilateral faces. I tried to solve this by culling out faces that have only 3 segments.

Currently, the maximum number of hinge faces that I can control is 69, anything more than that return an error at the hinge component.

Eventually, the folding behavior is also weird with the values I used in the engine.

Please find the gh code in the attachment.
Thank you.

A3_TLam (question to ask rod).gh (62.5 KB)

Hi Timothy,

There are several issues here.

First regarding the mesh joining - Weld won’t join vertices that are almost coincident within some tolerance. In Rhino you can use the AlignMeshVertices command for this, or in Kangaroo the Combine&Clean component. It also looks like you have many meshes on separate paths, so you’d need to flatten them to join.

As for the hinges - the sets of points being selected need to be on pairs of adjacent triangles. The cull pattern here is picking points all over the place, which is why the simulation is crumpling oddly (you can check this visually by drawing a line between tip1 and tip2)

Have a look at this definition for an example of setting up hinges. I think the easiest way is to use the HingePoints component to get the right sets of 4 points for all possible hinge edges in your mesh, then cull or assign different angles to these as needed
Origami_k2b.gh (43.5 KB)

Thank you Daniel!
It helps a long just by replacing mesh joining with Combine and Clean.
the HingePoint is also another powerful component that simplify my task!!

Hey Daniel,
I was following this conversation, and tried the script you mentioned (Origami_k2b.gh). However i am facing an issue. My initial mesh is a 3D object, so i am not starting from a flat sheet. Each of the edges, that i have referred as my mountain folds, or valley folds have a different angle at any given time. Is there a way to deal with this? because from what i understand there is only one input for the rest angle, and if i was to input a list to the rest angle ( to which i can do an addition and make it fold), how would i calculate the current angles for each of the folds?

221114 origami.gh (66.1 KB)

Thank You,
Arya