This is an alternative to voxelizing according to bending moment in the Surface Voxelization example and serves more as a representation of what Karamba does. This example takes a text file, created in Processing, which contains point information to extract a set of curves. The curves are shortest paths from a base point to the outer boundary of the 3D array input. These path curves are then used as the guides to determine where the subdivided voxels populate.
Grasshopper plugins required:
If you’d like the files, send me an email!
Step 1. For this example, we have an 3D array ready in the Surface_ShortestPath_Voxelization_01.3dm file– so first off, we need to extract the paths from the text file. Open the ImportExport-CK05.gh and find the path parameter.
Step 2. Right-click the path parameter and select ‘set one file path’. A new window will open. Navigate to the location of the AgentTrail.txt and open the file. This sets the file path to that parameter so Grasshopper can find it on your computer.
Step 3. You can now see the generated curves if you preview the curve parameter. However, as you can see, its a bit shifted from the 3D array. But no worries, theres a quick fix for this. Bake the curves as a group so we can position them correctly.
Steps 4-7. Go to top view in rhino, and make a line horizontal to the bottom edge of the 3D array (Step 5). Take the bottom most point of the group of curves and move it perpendicular to the horizonal line boundary until they intersect (Step 6). So, we just shifted the whole group of curves up so they fall within the 3D array. But to make it perfect, the final step is to mirror the whole thing. So take any point on the curves and mirror along the horizontal (Step 7).
Step 8. Take a look at your beautiful work and then go take a break 🙂
Step 9. Welcome back! Open PolySubdivision_02.gh in the same rhino file. You will see all the needed inputs on the left as well as the output parameters near the bottom left.
Step 10. First, input the 3D array by right-clicking the parameter labeled 3D array.
Step 11. Input all the necessary parameters accordingly. The inputs are basically the same as in the Voxel_Tests_R05.gh file, with the exception of the path curves created in the previous part of the example and additonal large mesh layer with the base cubes.
Step 12. Run the entire script by clicking on the data dam, or the play button.
Steps 13-15. Preview the results by turning on the geometry previews. Bake out the meshes through the mesh parameter labeled ‘final mesh’. And there it is in Rhino, ready to be put back into Processing.