This guide walks through the Grasshopper definition for a force-controlled multi-material shoe stack simulation: preparing the Rhino geometry, assigning a material model to each part, merging them, configuring the simulation, and dispatching it to Metafold. It's identical to the standard [[Getting Started — Shoe Stack Simulation]] guide in every step except one: the piston uses Force Limit on Metafold DTB Rigid to cap the load, instead of relying purely on its velocity profile to define the full stroke.
💡 Tip: Work through the steps in order — the simulation step depends on every part having a material assigned, and the merge step depends on all parts existing first. If you've already been through the standard shoe stack guide, Steps 1, 2, 4, 5, and 6 will look familiar — the only real difference is in Step 3, where the piston picks up a Force Limit input.
Step 1: Prepare the Rhino File
Open the Rhino file (generic_gh). Each component of the shoe lives on its own layer:
upper_solemidsolepiston(also called the Last — the foot-shaped rigid form that drives the simulation)outsole
Grasshopper references geometry by layer, so before anything else, confirm each part is sitting on the correct layer — if a part is on the wrong layer (or Default), the corresponding Grasshopper reference block downstream will pick up nothing or the wrong geometry.
Step 2: Open the Grasshopper Script
Open the .gh file alongside the Rhino model. At a glance, the canvas is organized into purple groups, each one doing one job:
- Upper Midsole / Lower Midsole / Outsole / Last — one material-assignment group per part (Step 3)
- Merge — combines all parts into one list (Step 4)
- Simulation Setup — the simulation's numerical parameters (Step 5)
- Metafold Login and Run Simulation — authenticates and dispatches the job (Step 6)
Step 3: Assign a Material Model to Each Part
Every part needs two things wired together: a material component (defines how it physically behaves) and a Deformable or Rigid wrapper (attaches that material to the actual geometry). Metafold uses this pairing to know how each part should respond during the simulation.
Upper Midsole
Midsole geometry → Metafold DTB Maxwell-Weichert Material → Metafold DTB Deformable
The Maxwell-Weichert model is a viscoelastic material (time-dependent stiffness) — inputs include Bulk Modulus, Terminal Shear Modulus, and a Modes table (relaxation time/modulus pairs, e.g. {0.0025, 3.5e4}), plus Density, Thermal Conductivity, and Specific Heat.
Lower Midsole
Midsole2 geometry → MF Mooney Mat → Metafold DTB Deformable
A Mooney-Rivlin hyperelastic material, driven by C1 and C2 (stiffness constants — here 658000 and 356000) and Poisson Ratio (0.48, near-incompressible, typical for foam/rubber).
Outsole
Outsole geometry → Metafold DTB Mooney-Rivlin Material → Metafold DTB Deformable
Same material family as the lower midsole (Constant 1, Constant 2, Poisson Ratio, Density, Thermal Conductivity, Specific Heat) — outsole-specific values go here since it's typically a stiffer rubber compound than the midsole foam.
Last (Piston) — force-controlled
last geometry → Metafold DTB Rigid Material + Metafold DTB Rigid
Unlike the other three, the Last doesn't deform — it's the rigid body that drives the compression. As in the standard guide, a Py3 expression block still generates a velocity profile feeding the Velocity Profile input, controlling how the Last moves down into the stack. What's different here is the Force Limit input: a Panel value (8000 in this setup) is wired into it, so the piston still follows its velocity profile until the measured force reaches that value — at which point it jumps to zero velocity and stops pressing. This turns a purely displacement-driven run into a load-limited one: instead of always compressing by a fixed amount, the piston stops once the shoe stack is pushing back with a specific force, which is the more realistic way to reproduce a force-controlled compression rig.
Python expression ("convert displacement + time + steps to speed") generates the velocity keyframe table, feeding MF Rigid Mat and MF Rigid, with Force Limit set to 8000 via the yellow Panel.Step 4: Merge the Parts
All four parts feed into a single Merge component (inputs D1–D4 used here; D5–D7 are spare inputs if you add more parts later). The output, R, is the combined part list the simulation step needs.
Step 5: Simulation Setup
Metafold DTB Sim Config sets the numerical parameters for the run:
- Max Resolution — mesh/voxel resolution (
64) - Max Time — total simulated time (
0.068) - Delta Min / Delta Max — solver time-step bounds
- Output Interval — how often results are written out
- Mesh Scale — geometry scaling applied on export
- 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 just wired in so it's easy to flip on later if needed (right-click → Set Boolean → True).
This config, together with the merged Parts list and a Name (e.g. generic midsole), feeds into Metafold DTB Simulation, which packages everything into the simulation definition used in the next step.
Step 6: Authenticate & Run
Metafold Login takes a Login URL and returns a Client object (your authenticated session) and Status.
Metafold DTB Multiple Simulation Experiment ("Run Simulation") takes that Client, the Simulation(s), and a Project Name, and dispatches the job:
- Exports meshes and builds manifests
- Zips the experiment and POSTs it to the Metafold API
- On success (
202 Accepted), returns a Project URL — a link to the running experiment in the DTB dashboard - Log streams the full dispatch sequence for troubleshooting if something fails
- Open Project opens the result in your browser once dispatch completes
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. Use Download Results to export the numbers or Apply Filter to narrow the table when comparing multiple runs.
- Force-Displacement — the overall compression curve for the assembled shoe stack: force (N) against piston (Last) displacement (mm). In a force-controlled run, expect this curve to rise as usual and then flatten out (or stop) once it hits the Force Limit value — that plateau/cutoff is the piston stopping, not a material or solver issue.
- Von Mises Stress — since the shoe has multiple deformable parts, this panel is tabbed per part (Midsole von Mises Stress / Midsole2 von Mises Stress / Outsole von Mises Stress), each showing a histogram of stress distribution across that part individually — useful for spotting which layer is carrying the most load.
- Energy Absorbed-Interior Volume — plots the stack's absorbed energy against its interior (void) volume.
- Simulation Preview — an animated, color-mapped playback of the compression (switchable between metrics like Effective Strain via the dropdown), with a frame scrubber and FPS control at the bottom. The adjacent Part Preview tab shows the geometry with the animation.