TorsionSketch
Copyright © 2026 Massachusetts Institute of Technology (MIT).
Author: Theron Guo.
Funding: ONR Grant N000142312573 and MIT Department of Mechanical Engineering.
README: How To Use TorsionSketch
TorsionSketch estimates the torsional rigidity of a 2D cross‑section. You draw a shape, the app converts it into a signed distance field (SDF), and a neural network uses the SDF to predict torsional rigidity.
Quick workflow
- Draw a closed shape in the left panel (free draw or vertex mode).
- Set the
Grid Spacing(distance between grid points in each direction) andGrid Size(number of grid points in each direction). - Check the SDF preview.
- Review the area, perimeter, and predicted torsional rigidity.
- The sentinel value is scale-independent and internally used for the prediction.
Coordinates and grid
- Cursor coordinates are shown relative to the canvas center (0, 0).
- To avoid corner/boundary artifacts, avoid placing points in the immediate vicinity of the sketch-canvas boundary.
- The grid slider sets the
Grid Size(number of grid points in each direction). - For the SDF, the drawn shape is automatically centered and scaled to a fixed area; extreme aspect ratios may affect accuracy.
Prediction accuracy
- The model predicts the scale-independent sentinel, defined as
(torsional rigidity × perimeter²) / area³, and then the torsional rigidity. - The model was trained and tested on many cross sections, including ellipses, rectangles, triangles, I-, L-, C-shaped sections, polygons, and star‑shaped geometries.
- Average relative error: 0.9%. Maximum error: 20.5%. R²: 0.992.


Gallery












| Case | Sentinel Prediction | Sentinel Exact | Relative Error |
|---|---|---|---|
| Disk | 1.999 | 2.000 | 0.050% |
| Square | 2.249 | 2.250 | 0.044% |
| Equilateral triangle | 2.396 | 2.400 | 0.167% |
| Right isosceles triangle | 2.431 | 2.420 | 0.455% |
| Case | Sentinel Prediction | Sentinel Quasi-Exact* | Relative Error |
|---|---|---|---|
| I-beam | 1.592 | 1.583 | 0.581% |
| L-beam | 1.583 | 1.597 | 0.864% |
| C-beam | 1.506 | 1.521 | 1.019% |
| Polygon arrow notch | 2.324 | 2.283 | 1.779% |
| Polygon wedge | 3.013 | 3.252 | 7.360% |
| Star five point | 2.123 | 2.116 | 0.319% |
| Star mixed modes A | 2.164 | 2.167 | 0.165% |
| Star mixed modes B | 2.494 | 2.472 | 0.890% |
*Here Quasi-Exact refers to a finite element calculation on a fine mesh. The error | Prediction - Exact | is typically dominated by the neural network contribution; therefore, | Prediction - Quasi-Exact | differs negligibly from | Prediction - Exact |. Mesh convergence was verified using uniform mesh refinement and (conservative) extrapolation a posteriori error estimators: we can conclude that |Quasi-Exact - Exact|/|Quasi-Exact| is below 0.05%.
