Getting Started — Single Lattice Cell Compression

This guide walks through the Grasshopper definition for a single-unit-cell lattice compression test: a lattice part gets a Neo-Hookean material, a rigid piston compresses it along a velocity profile, and the result is dispatched to Metafold as a simulation.

💡 Tip: This is a good first file to open if you're new to the Metafold DTB workflow — it has only two parts (lattice + piston), so it's a faster way to see the full pipeline end-to-end before moving to a multi-part model like the shoe stack.

Step 1: Prepare the Rhino File

Open the Rhino file. The model is a single lattice unit cell (X-shaped internal lattice with a flat top plate) split across two layers:

  • part — the lattice cell itself (the deformable body)
  • piston — the rigid flat compressor sitting above it

As with any Metafold DTB file, Grasshopper pulls geometry by layer, so confirm both parts are on their correct layers before running anything downstream.

Figure 1 :
Figure 1 : Rhino model view — the lattice unit cell (X-shaped strut pattern with a flat top plate), with the Layers panel showing part and piston as separate layers.

Step 2: Open the Grasshopper Script

The canvas has five groups:

  • Part — assigns the lattice's material (Step 3)
  • rigid piston — assigns the piston's material and its compression motion (Step 3)
  • Merge — combines both parts into one list (Step 4)
  • Simulation Configuration — the run's numerical parameters (Step 5)
  • Metafold Login and Running the Simulation — authenticates and dispatches the job (Step 6)
Figure 2:
Figure 2: Full Grasshopper canvas overview — all five groups in one view: Part, rigid piston, Merge, Simulation Configuration, Metafold Login, and Running the Simulation.

Step 3: Assign a Material Model to Each Part

Part (lattice cell)

Part_Single_Unit_cell geometry → MF Neo-Hook Mat → Metafold DTB Deformable

A Neo-Hookean hyperelastic material is used in this workflow, needing just five inputs: Shear Modulus (G = 344,500 Pa), Bulk Modulus (K = 644,500 Pa), Density (D = 150 kg/m³), Thermal Conductivity (TC = 45), and Specific Heat (SH = 0.00045).

Figure 3:
Figure 3: Part — MF Neo-Hook Mat (Neo-Hookean material: G, K, D, TC, SH) feeding Metafold DTB Deformable for the lattice geometry.

Piston (rigid)

last geometry → Metafold DTB Rigid Material + Metafold DTB Rigid

Like the shoe file's piston, this part doesn't deform. A Py3 expression (A = 14, T = 0.038, n = 17) generates a symmetric velocity profile — a table of Z-displacement values that ramp down and back up — feeding the Velocity Profile input on Metafold DTB Rigid to drive the compression stroke.

Figure 4: rigid piston
Figure 4: rigid piston — Metafold DTB Rigid Material and Metafold DTB Rigid paired together, driven by a Py3 velocity-profile expression that generates the compression stroke.

Step 4: Merge the Parts

Both parts feed into a Merge component (D1–D2 used here; D3–D7 are spare, unused inputs). The output, R, is the part list the simulation step needs. This is also where the contact is defined between the parts. In this case a rigid contact is defined between the piston and the part.

Figure 5:
Figure 5: Merge — combines the lattice part and piston (D1–D2) into the single part list the simulation needs.

Step 5: Simulation Setup

Metafold DTB Sim Config sets the run parameters:

  • Max Resolution — 64
  • Max Time — should be set as the maximum time defined in velocity profile
  • Delt Min, Delt Max — solver time-step bounds
  • Output Interval — how often results are written
  • Mesh Scale — geometry scaling applied when exporting your Rhino meshes
  • Exp — a true/false toggle (not a numeric input) that switches this run to the GPU (experimental) solver. Leave it False here — this file uses the standard solver. It's still wired in so it's easy to flip on later if needed: right-click the Exp input → Set Boolean → True (only required if you're using a GPU-only material like Orthotropic or Hyperfoam).

This, plus the merged Parts and a Name (single_unit_cell_compression), feeds Metafold DTB Simulation, which builds the simulation definition used next.

Figure 6:
Figure 6: Simulation Configuration — Metafold DTB Sim Config with Max Resolution set to 64, plus Max Time, Delta Min/Max, Output Interval, Mesh Scale, and Exp.

Step 6: Authenticate & Run

Metafold Login takes a Login URL and returns a Client and Status.

Figure 7:
Figure 7: Metafold Login — authenticates with a Login URL, outputting a Client object and Status.
Figure 8:
Figure 8: Metafold DTB Simulation — combines Parts, Config, and Name into the simulation definition.

Metafold DTB Multiple Simulation Experiment ("Running the Simulation") dispatches the job:

  • Exports meshes and zips them (Single-Unit_Cell_Compression.zip)
  • POSTs to the Metafold API and returns 202 Accepted with a project ID
  • Project URL links to the running experiment in the DTB dashboard
  • Log shows the full dispatch sequence
  • Open Project opens the result in your browser
Figure 9:
Figure 9: Running the Simulation — Metafold DTB Multiple Simulation Experiment dispatches the job and returns the Project URL, with the full dispatch log showing zip export, API POST, and 202 Accepted response.

Step 7: Visualize the Results

Once the run completes, opening the Project URL lands you on the results dashboard, laid out as four linked panels plus a results table:

  • Results — one row per simulation, with Volume, Absorbed Energy, Loading Energy, and Unloading Energy. Selecting a row highlights it across every other panel; use Download Results to export the numbers or Apply Filter to narrow the table when comparing multiple runs.
  • Force-Displacement — the core compression curve: force (N) against piston displacement (mm). The knee partway through the curve is where the lattice's internal struts start contacting each other and the part stiffens up sharply.
  • [Part] von Mises Stress — a histogram of stress values across the mesh, showing how stress is distributed through the part rather than just reporting a single peak value.
  • Energy Absorbed-Interior Volume — plots absorbed energy against the part's interior (void) volume, useful for comparing different lattice geometries against each other on an energy-absorption-per-volume basis.
  • Simulation Preview — an animated, color-mapped playback of the compression, switchable between metrics (e.g. Effective Strain) via the dropdown, with a frame scrubber and FPS control at the bottom. The adjacent Part Preview tab shows the geometry without the animation.
Figure 10:
Figure 10: Results dashboard — the four-panel view after a run completes: the Results table (Volume, Absorbed/Loading/Unloading Energy), the Force-Displacement curve, the von Mises Stress histogram, the Energy Absorbed–Interior Volume plot, and the animated Simulation Preview.
simple_compression.3dm19.5 MiB
simple_compression_tutorial.gh14.1 KiB