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.
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)
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).
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.
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.
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.
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.
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 Acceptedwith 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
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.