## Interwoven structure in Grasshopper

Using the same method by Entagma, for purpose of learning Houdini.

As part of my learning experience of houdini, I tried to recreate the houdini effect in Grasshopper. In many cases, I find the modeling process in GH is actually faster , but the mesh tool in GH is quite lacking, so some custom C# code is required.

For simple surface, evaluate surface node works great for generate midpoint normal, but it won’t work on brep. So it’s better to directly work with mesh from the start.

1. (Re)mesh Brep

To remesh the topology, there are sevral options in GH:

1)Using the Remesh node from kangaroo, which will remesh the mesh into roughly equal size triangle.

2)Frist using voxelate the geometry then convert back to mesh. This is can be done with Dendro plugin, which uses OpenVDB internally.

Here I use method 1) because it’s simpler.

2. calculate midpoint normal

To get the interwoven effect, first we will need to, and move the midpoint along the normal, and move the midpoint of dual graph in opposite direction.

To obtain surface normal, a common way in GH is Surface Closest Point -> Evaluate Surface, But this only work on Surface, not Brep.

Midpoint normal can be interpolated using the normal of two end points. While we can access the vertex normal using deconstruct mesh node, the connectivity information is not present in any node, thus we need to expose it via C#.

This snippet calculate the midpoint normal of all mesh edges

DataTree<Line> lines = new DataTree<Line>();

DataTree<int> start = new DataTree<int>();

DataTree<int> end = new DataTree<int>();

for(int i = 0;i < M.TopologyEdges.Count;i++){

var pair = M.TopologyEdges.GetTopologyVertices(i);

}

L = lines;

S = start;

E = end;

This simply literate through all existing mesh edges, for each edge, it’ll extract its start and end point, then append the index those to S,E output.

3. Generate dual graph

Dual mesh node form weaverbird to generate a dual graph. But this only generate polyline, not mesh face. To convert it to mesh use mesh tile node. Alternatively, we can compute the network to make a graph instead, and calculate the vertex normal by average its connected edge direction.

Generate pipe frame

Using the exoskeleton plugin or using the Multipipe node added in Rhino7 (Warning: may crash Rhino if don’t have enough memory)

The result can be exported to 3d print software, like reptiler-host, to generate gcode, then printed using a two-head printer to get the interwoven structure.