Getting Started — Force-Controlled Shoe Compression

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_sole
  • midsole
  • piston (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.

Figure 1: Preparing the Model in Rhino
Figure 1: Preparing the Model in Rhino

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)
Figure 2:
Figure 2: Full Grasshopper canvas overview (wide layout) — same canvas as above, laid out for a wider screen.

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.

Figure 3:
Figure 3: Upper Midsole material assignment — Metafold DTB Maxwell-Weichert Material (viscoelastic, with a relaxation Modes table) feeding Metafold DTB Deformable.

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

Figure 4:
Figure 4: Lower Midsole material assignment — MF Mooney Mat (C1, C2, Poisson Ratio) feeding Metafold DTB Deformable.

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.

Figure 5: Outsole material assignment
Figure 5: Outsole material assignment — Metafold DTB Mooney-Rivlin Material feeding Metafold DTB Deformable.

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.

Figure 6:
Figure 6: Last (Piston) — material + velocity profile — a 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.

Figure 7:
Figure 7: Merge — combines all part outputs (D1–D7) into the single list the simulation step consumes.

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.

Figure 8:
Figure 8: Metafold DTB Sim Config — sets the numerical parameters for the run: Max Resolution, Max Time, Delta Min/Max, Output Interval, Mesh Scale, Exp.

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
Figure 9:
Figure 9: Run Simulation — dispatches the experiment: exports meshes, zips and posts to the Metafold API, and returns the Project URL once accepted. The log panel shows the full dispatch sequence.

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.
Figure 10:
Figure 10: Results dashboard — Force-Displacement curve showing Force stops at 8000 , per-part von Mises Stress tabs, Energy Absorbed–Interior Volume, and animated Simulation Preview for the shoe stack run.
generic_stack_force_control.gh24 KiB