Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Static stress analysis

analysis.static_stress tells you whether a part holds its load: the largest stress and deflection, the reactions at the supports, and the safety factor against the material’s yield. It is linear elastic finite element analysis with second-order tetrahedra. Nightfall’s study runner meshes the part with Netgen and solves with MFEM, in a separate program, the way the FreeCAD oracle runs FreeCAD: nothing of either is linked into Polykrom.

Setting it up

The analysis runs Nightfall’s nf, built with its studies. Point Polykrom at it:

export POLYKROM_NIGHTFALL=/path/to/nightfall/build/occt/tools/cli/nf

Without it, the command says so and does nothing. SOLIDCRAFT_NIGHTFALL still works. The browser build has no analysis.

Running it

Supports and loads are points inside the faces they act on. body_topology (MCP) lists every face with a point that lies on it.

{"command": "analysis.static_stress", "params": {
  "body": "Bracket",
  "fixed": [[0, 5, 5]],
  "loads": [{"faces": [[200, 5, 5]], "force": [0, 0, -10]}]
}}
ParameterMeaning
fixedPoints inside the faces held in place
loadsEach {faces, force: [fx, fy, fz]} in N (the total, spread by area), or {faces, pressure} in MPa
materialA built-in material; default: the body’s
youngs_modulus_mpa, poisson_ratio, yield_mpaOverride the material’s values
mesh_sizeElement size in mm; default: a fifteenth of the part’s size
refinetrue: three meshes, each 1.5 times finer, and the convergence order of each result
budget_sSeconds the solve may take (600)

The reply gives max_von_mises_mpa, max_displacement_mm, applied_n and reaction_n (they balance), safety_factor and yield_mpa where the yield is known, the material used, and the mesh. A point that lies on no face, or on an edge between two, is refused with its place in the call (loads[0].faces[0]).

Materials

The built-in metals and plastics carry typical room-temperature handbook values:

MaterialE (MPa)νYield (MPa)
Steel200 0000.30250
Stainless Steel193 0000.29215
Aluminum69 0000.33276
Brass100 0000.34200
Copper117 0000.3470
Titanium114 0000.34880
Cast Iron110 0000.26— (brittle)
ABS Plastic2 2000.3540
PLA3 5000.3650
Nylon2 7000.3970
Polycarbonate2 4000.3762
Glass70 0000.22— (brittle)

Oak and the default material have no elastic data. Give the values yourself, from your own supplier’s data where it matters.

What it is and isn’t

  • Linear and small-strain: a stress above the yield means the part yields, not that it carries that stress. 3D-printed parts are weaker across their layers than these isotropic values say.
  • The stress at a sharp inside corner grows as the mesh gets finer (it is a singularity). Round the corner, or read the stress away from it, and use refine to see what converges.
  • It is checked against beam theory: a 200 mm aluminium cantilever under 10 N bends within 2% of P L³ / 3 E I, and its reactions balance the load.