AI agents can automate software engineering because a compiler or a test suite checks that the code does what the user or the agent intended. In engineering analysis, however, the steps that precede the computation have few easily verifiable checks: modeling a design or an object, deciding how it is used, where supports and loads are applied, and what material each part is made of. A human expert therefore makes these decisions, carries out the steps, and judges the result, one object at a time. We present MechFoundry, an agentic loop coupled with bespoke software that automates structural analyses of real-world objects without a human in the loop. From an object's lexical description, it generates a shape, poses a loading case relevant to how the object is used, assigns a material to each part, solves the nonlinear structural response, and improves the design against the loads it carries. A differentiable GPU solver built on an adaptive octree that need not conform to the surface enables the transition from shape generation to simulation and optimization. Across 50 everyday and engineering objects, the agent posed and solved a loading case in 6.5 minutes and for US$1.3 per object on average. Without a test suite to check against, we had language-model reviewers grade each session, as a first indication of where the agent's engineering judgment holds and where it fails.
Introduction
AI agents now carry out substantial software engineering, writing, running and revising code with limited supervision. They work in part because software supplies its own verification: the code compiles and runs, and the unit tests pass or fail. For engineering analysis, finite element method (FEM) solvers automated the computation of how an object deforms decades ago: given a geometry, a mesh, a set of supports and loads, and a material model, a solver returns the response without a human in the loop. The computation itself can be checked, but the steps that precede it have neither a compiler nor a test suite: how the real object is used, where boundary conditions for loads and supports are applied, and what material model and properties each of its parts should have. A human expert therefore makes these decisions, carries out the steps, and judges the result, which is why structural analysis of a real-world object still takes hours to days [1], and why it is still carried out one object at a time.
The need for expert actions at these steps shapes engineering practice. Because setting up the first meaningful simulation of a new object is expensive, analysis and redesign usually come late, after the key design decisions have been made. Many objects are never analyzed at all, because the conventional workflow starts from a parametric computer-aided design (CAD) model built in a narrow design space, and everyday hardware, legacy parts and free-form real-world shapes often have no such model. Design optimization, which could in principle improve any of them, is sensitive to the initial design [2], particularly for shape and level-set methods that cannot form new topological features [3, 4]. Good starting points for free-form objects are scarce, and multistart strategies need many of them [5].
Recent work approaches this problem from two directions, and neither closes the gap. Language-model agents now plan and run experiments in chemistry and materials science [6, 7], and in mechanics they drive finite element workflows, writing meshing and solver scripts for commercial and open-source codes [8, 9, 10]. These studies mostly analyze structures whose geometry is parametric, given in CAD or specified by detailed instructions or a knowledge base, and are benchmarked against reference solutions built manually or analytically, so the agent is asked to operate a solver rather than to decide what to solve. In the other direction, generative models turn text, sketches or images into free-form shapes in seconds to minutes [11, 12, 13, 14], and recent work makes such shapes ready for simulation, mostly as rigid assets annotated with scale, joints and affordances, or optimized for stability under gravity [15, 16, 17]. Work that simulates generated deformable objects loads them mainly by gravity or grasping, or analyzes them linearly on voxel grids [18, 19, 20]. In none of it does the system infer the loading case from how the object is used, solve its nonlinear response, and feed that response back into the design to enable optimization.
Closing that gap for AI agents on a generated free-form shape is obstructed at every step. Generated surfaces contain disconnected pieces and self-intersections, which conventional tetrahedral mesh generators reject and robust meshers accept only within a user-set envelope [21], and conforming hexahedral meshes are harder still to produce automatically [22]. A generated surface carries no CAD faces on which supports and loads can be placed, so an agent is left testing raw coordinates, such as finding all points with height z<0.05 to assign a base support, which demands costly visual reasoning and trial and error for complex topology. The surface is not organized into parts, which limits per-part material assignment. And any change of shape during optimization requires a new mesh, which can fail again.
We present MechFoundry, an agentic loop coupled with bespoke software that carries a real-world object from its name to a nonlinear structural analysis without a human in the loop, and on to an improved design (Figure 1). An AI agent operator, a coding agent working from generic engineering instructions, answers every approval gate of the workflow in place of a user: it writes a case brief stating how the object is used, where it is held, what loads it and how large each load is, and inspects each rendered result before approving it. AI subagents propose supports, loads and materials on the segmented parts of the generated surface. Each shape is carried as a signed distance field on an adaptive octree that need not conform to it, on which the diffuse Nitsche method [23] applies supports and loads through a thin diffused layer and solves the nonlinear elastostatic problem on graphics processing units (GPUs) [24]. Because the solver is differentiable, the same loop continues into shape and topology optimization, redistributing material to optimize performance. We run the loop on 50 everyday and engineering objects from brief descriptions alone, compare its solutions against body-fitted finite elements, and have language-model reviewers grade its geometry, supports and loads, and materials, as a first indication of where the agent’s engineering judgment holds and where it fails.
Figure 1. MechFoundry carries an object from a text description to a posed and solved loading case, and can then improve its design. a, The five steps of a deformation simulation for “a sitting rabbit”, carried out by a human engineer (top), by a general-purpose AI agent writing its own scripts (middle, illustrative only: a schematic of how generated shapes can break conventional tools) and by MechFoundry (bottom). b, The MechFoundry workflow, taking the Stanford bunny for illustration. Shape generation (orange): a text-to-CAD model, TripoSG, or Hunyuan3D-2.1 with images generated by Stable Diffusion XL (SDXL). Pre-processing (blue): the surface is segmented into parts that receive supports and loads (boundary condition, BC), and materials. Finite element analysis (FEA) and optimization (green): the signed distance field (SDF) of the surface defines an adaptive octree carrying a diffused body, namely a phase field, solved by the diffuse Nitsche method. Sensitivities with respect to the SDF (shape) and to the phase field (topology, optional with dashed arrows) update the geometry. Star: steps that AI subagents (large language or vision-language models, LLM/VLM) can assist. Chip: differentiable GPU code in NVIDIA Warp. A person drives the workflow through the web user interface (UI), or the AI agent operator through the command line interface (CLI).
Results
A workflow an AI agent can run autonomously
Simulating how an object deforms, conventionally with finite element analysis, takes five steps (Figure 1a): building its shape, dividing it into a mesh of small elements, specifying where it is supported and loaded, assigning its materials and, when the design is to be improved, changing the shape and repeating the analysis. A human engineer carries out each step manually in CAD and finite element software, requiring hours or even days (Figure 1a, top row), and a general-purpose AI agent writing scripts for the same tools meets the obstacles of generated shapes described in the Introduction (Figure 1a, middle row). MechFoundry replaces each step with one that works on generated shapes and that a language agent can reason about and drive (Figure 1a, bottom row), with nonlinear solutions and optimization built in.
Shape. A text prompt, a rough sketch or an image conditions a pre-trained 3D generator (Figure 1b, orange), which is TripoSG [11] by default. Alternatively, a text-to-CAD model [13, 14] returns a CAD solid, or an image drawn from the text by Stable Diffusion XL (SDXL) [25] conditions TripoSG or Hunyuan3D-2.1 [12], or the user uploads a surface. Small disconnected pieces of a generated shape are removed so that one body is kept, and the surface is scaled to its real-world size (Methods, “Implicit geometry”, and Supplementary Section S1.2).
Supports, loads and materials. The surface is segmented into parts by clustering the per-facet features from a pre-trained network, PartField [26], or, for a CAD solid, by its faces (Figure 1b, blue). This allows AI agents to perform targeted selections on the surface with less reasoning and trial and error. From the AI agent operator’s reasoning or the user’s written description of how the object is held and loaded, an AI subagent writes a short program for each support or load region, which selects surface facets by combining operations such as picking a part, a position or a facing direction. The AI subagent also proposes the load values and the material constants, one material per part when the parts differ in material (Methods, “Boundary-region identification” and “Language-model-assisted workflow”).
Mesh and solve. The surface is turned into its signed distance field (SDF), whose value is the shortest distance from a spatial location to the surface, and whose sign is decided by the generalized winding number [27], negative inside and positive outside. From this field, an adaptive octree is built on the GPU, refined near the surface and coarse farther from the surface (Figure 1b, green). Because the octree cells do not need to follow the surface and the winding number tolerates defects on the surface, the octree can also be built for surfaces that a conventional tetrahedral mesher may reject: three of the 50 generated surfaces of Figure 2 and Supplementary § 9.3 intersect themselves, so the mesher failed to generate conventional tetrahedral volumetric meshes for them, whereas MechFoundry completed them. To sharpen the representation, the SDF is filtered to obtain a phase field on the octree, taking a value of one inside the body and zero outside, with a thin transition layer at the surface called the diffused zero level set. Supports and loads act through this transition layer, and the supports are imposed weakly on it by the diffuse Nitsche method [23]. The solver computes the solution of a nonlinear elastostatic problem utilizing a compressible neo-Hookean material and is written as differentiable GPU code in NVIDIA Warp [24] (Methods, “Diffuse Nitsche finite element analysis”). The diffuse Nitsche method is readily reusable for all types of standard constitutive and damage theories encountered in solid mechanics.
Figure 2. The AI agent operator poses and solves loading cases from a few words of description. Six of the 50 sessions autonomously run by Claude Code with Opus 5.5 (Supplementary § 9.3), one per row. AGENT marks the steps that the operator decides, and FEM SOLVER the diffuse Nitsche solve that the operator reviews. Generated shape: the simulated body on a floor grid with the cell size at the lower left, and its generation route at the lower right (Built (extrude): a profile extruded by the operator). Supports (teal), loads (orange, with arrows along the load) and the weight of the body (body load). Young’s modulus of each part, on a logarithmic scale, indicates the stiffness of the material. Parts with different colors also have different Poisson’s ratios and densities. Deformed shape: the displacement magnitude ∣u∣, magnified by the factor at the upper right, with the undeformed outline in gray. Left column: input tokens with their cached share, output tokens and wall-clock time of the session, split into the operator (Agent), the workflow steps, the solver and the runner overhead. Runner overhead includes process starting, GPU selection, output rendering and other steps that cannot be classified into the other three categories.
Design. Because the solver is differentiable, an approximate gradient of a design objective with respect to the signed distance field can be obtained from one additional linear solve by the adjoint method, and moving the surface along this gradient enables shape optimization (Methods, “Sensitivity analysis” and “Shape optimization”). The gradient vanishes away from the surface, so a second design variable mirroring the phase field lets topological features emerge, enabling topology optimization (Methods, “Topology optimization”). Both of these optimization procedures are easily interchangeable by following the computational graph backward to a different endpoint. By default, the surface and the octree are extracted again at every iteration, and the support and load regions are restored on each new surface, so they stay in place while the shape changes. The optimization examples in this work use one material and are loaded by tractions and body forces only, without prescribed non-zero displacements.
Operation of the workflow. The steps run in a given order and wait at six approval gates, stages at which the workflow waits for the user, such as the boundary regions and the material. There, the proposals of the AI subagents (DeepSeek-V4.1-Flash [28] by default) take effect only after the user accepts or edits them. A person answers the gates in a web interface (Supplementary Section S7), or, alternatively, an AI agent operator, a coding agent (Claude Code with Opus 5.5 in Figure 2, or others), answers them through a command line interface in place of the person (Methods, “Operation by a coding agent”). Working from an operator skill, a set of generic instructions, reference material and scripts that frame its role as that of an engineer, the operator first writes a case brief stating how the real object is used, where it is held, what loads it experiences and how large each load is. From the brief, a script computes estimates of the peak stress and deflection, treating the loaded member as a cantilever. The operator then looks at each rendered picture of the shape, the segmented or selected regions, and the solution, before approving each step, compares the solve with the estimates and closes with a verdict on whether the case it ran is the one its instruction describes (Supplementary Fig. S19). The pre-trained models are used as released, and no model is trained or fine-tuned in this work.
We evaluate MechFoundry in three settings: agent-operated simulations of 50 objects, each from a few words of description (Figure 2, Supplementary Fig. S1 and Supplementary § 9.3), variants of one object that differ in shape, per-part material properties, or supports and loads (Figure 3), and finally shape and topology optimization of generated shapes under the loads they carry (Figure 4).
Figure 3. The AI agent operator generates varied simulations of one object. Each row varies one input over nine sessions by Sonnet 5.5 and shows the instruction and the mean cost of a session (left), the input set by the operator (AGENT, middle) and the deformed shape (FEM SOLVER, right). Shapes: nine robot arms from one instruction, differing in the generation seed and labeled at the bottom with the generation route that the operator chose. Materials: nine material assignments for the parts of a hamburger, written in one request (upper left text block and cost bars) and each written assignment applied and solved (lower left text block and cost bars). Supports and loads: nine load cases for a claw hammer, written in one request (upper left) and each run realizes one of the load cases (lower left), with the cost bars as for the hamburger. Colors, deformed shapes, and cost bars as in Figure 2.
Figure 4. Gradient-based optimization moves material to where generated objects carry their loads. a, One iteration for a table loaded on its top (orange) and held at its four feet (teal). Forward (black arrows in the first row): the signed distance field s, the phase field φ, the diffuse Nitsche solve for the displacement u and the objective J. Backward (magenta arrows): automatic differentiation and the adjoint method give the sensitivity DJ/Ds, which updates s. Optionally (dashed), the interior sensitivity updates a hidden phase field φˉ, which opens new topological features. Sensitivity magnitudes are on a logarithmic scale. The black line is the surface s=0. b, Shape optimization (left, 101 iterations, 4.0 min) and topology optimization (right, 91 iterations, 3.9 min) of the table toward half of its initial volume while minimizing compliance, with the near half translucent to reveal the profile. Iteration 43 of topology optimization is shown in a. c, Refinement of 17 generated bodies from the agent-operated sessions under their own supports and loads (left of each pair), with growth of the volume penalized. Right of each pair: the signed distance of the refined surface from the generated one, from −3hmin (blue: material removed) to 3hmin (red: material added), with hmin the finest octree cell size. SE/SE0: strain energy relative to the initial generated body, where lower is stiffer for the same load. Times are on one NVIDIA RTX A6000 GPU.
From an object’s name to a solved loading case in minutes
We first demonstrate that the AI agent operator can take an object from its lexical description to a meaningful loading case and its solution. We chose 50 everyday and engineering objects (Supplementary Fig. S1) in 10 categories, five per category: household items, furniture, toys, food, animals, vehicle parts, machines and tools, medical and anatomy items, buildings, and landmarks. Figure 2 shows six of the 50 sessions, and Supplementary § 9.3 shows all of them. The operator, Claude Code with Opus 5.5, received only a brief lexical description of each object, such as “a park bench” (full prompt in Supplementary Section S2). Before any computation started, within the checks of its operator skill, the operator planned how the object is used, where it is held, what loads it and how large each load is, its real size, and its materials.
After planning, the operator chose the route that produced each shape (Figure 2, second column). Four of the six shapes came from an SDXL drawing passed to TripoSG or Hunyuan3D-2.1, one came from TripoSG directly, and the operator built the leaf spring as an extruded profile. The 3D surfaces undergo segmentation, which allows the operator to easily pose loading cases according to how each object is used (Figure 2, third column). For instance, the electric toothbrush is held static at the grip and loaded on the brush head, and the park bench is loaded on the seat and the backrest and restrained at its four feet. The loading values are translated from realistic conditions, for example a weight or a force that a person applies, and each body carries its self-weight. The operator then assigns material properties (Figure 2, fourth column) that can be different for different parts of an object. For example, in the case of the hammer, steel properties are applied to the head while wood properties are applied to the handle. This is followed by a GPU-accelerated finite element solver that produces deformation solutions (Figure 2, last column).
Each of the six sessions shown in Figure 2 took 4.4–8.6 min of wall-clock time and 1.4–3.1 million input tokens, of which 94–96% were reused from earlier steps at a lower price (cached), and 18–34 thousand output tokens (Figure 2, first column). Most of the time was spent on operator reasoning and writing, and the workflow steps and the solver took the rest. All 50 sessions took 5 h 23 min, 6.5 min per object on average, and cost a total of US$65.29 at API price for the operator’s model calls (Supplementary Table S3), excluding the AI subagent calls that normally cost less than US$0.02 per object (Supplementary Section S1.8).
We gave the same 50 instructions to the lower-cost Sonnet 5.5 and Haiku 5.5 models of the same model family (Supplementary § 9.4). Sonnet 5.5 cost less than half as much as Opus 5.5 (US$26.22 against US$65.29) and took less time (3 h 56 min against 5 h 23 min), whereas Haiku 5.5 cost US$7.44 and took 5 h 39 min, but did not complete 4 sessions. Two panels of language-model reviewers, one running three Claude Fable 5.1 agents, from the same model family as the operators, and the other one running three GPT-6-Astra agents, graded the geometry, the supports and loads, and the materials of each session. The two panels agreed slightly to fairly (Cohen’s kappa 0.19–0.25). Both panels graded the geometry, supports and loads, and materials as high in 15, 26 and 18 objects respectively from 50 Sonnet 5.5 sessions, 15, 24 and 19 objects from Opus 5.5 sessions, and 10, 20 and 15 objects from Haiku 5.5 sessions. Of the 12 materials that both graded low, 10 were in objects with soft parts (Supplementary § 9.5). Opus 5.5 received the fewest low grades for geometry, whereas for the materials and the supports and loads, Sonnet 5.5 and Opus 5.5 were rated similarly, although Sonnet 5.5 cost much less.
Because the octree does not follow the surface, the diffuse Nitsche solution can differ from a conventional finite element analysis on a mesh that follows the surface. We therefore solved each of the 50 sessions again with conventional finite elements on three linear tetrahedral meshes that follow the surface and are discretized differently (Supplementary § 9.6). Tetrahedra were used because a mesh that follows a generated surface is far easier to autonomously build from tetrahedra than from hexahedra [22]. Linear tetrahedra, however, are known to be stiffer than trilinear hexahedra in bending and to lock more readily [22], so part of the discrepancy can come from a different choice of element type. Three surfaces intersect themselves and were rejected by the tetrahedral mesher, leaving 47 objects to be compared. The comparison used double precision, a tighter Newton tolerance, one averaged material per object, and supports and loads posed as the diffuse Nitsche method poses them. At the default finest octree level of 7 (Methods, “Adaptive octree extraction”), the median displacement discrepancy between the two solutions, measured as the relative L2 norm after removal of a rigid-body motion, was 4.6–6.6% against three tetrahedral meshes. One octree level finer, the discrepancy fell to 2.7–3.0%. Thus, for a typical object, the two methods predict displacement fields that differ by a few percent. Their displacement gradients differ more: in the H1 norm, which additionally measures the gradient, the median discrepancy was 16–19% at level 7 and 8.1–8.4% at level 8. The diffuse Nitsche solutions were slightly stiffer, with a median ratio of their compliance to the linear tetrahedral one of 0.91 at level 7 and 0.96 at level 8. At level 8, preparing the octree, the boundary conditions and the solver took a median of 2.2 s, against 16–44 s for preparing the tetrahedral meshes. The solves took a median of 7.6 s for the diffuse Nitsche method and 7.9–21 s on the tetrahedral meshes. Regarding the larger discrepancies, for 14 of the 47 objects at octree level 7 and for 10 at level 8, mostly objects with thin walls, narrow gaps or small supports near the resolution of the octree, the L2 discrepancy exceeded 10% against at least one tetrahedral mesh.
Varying shape, materials, supports and loads
Comparing design options early and optimizing from several starting points or with adaptive sampling both need many variants of one object that differ in shape, materials, supports and loads. So do the training datasets of learned surrogates that can speed up both [29, 30]. With the AI agent operator, the same workflow can produce such variations without a person (Figure 3). This autonomy can be achieved either by repeating a session with a different generation random seed or by asking the operator to write many cases and then running each. The prompt for varying shapes is in Supplementary Section S2, and the other prompts are in the released code. All variations are run with Sonnet 5.5.
Shapes. We gave nine operator sessions the same instruction, “a small six-axis industrial robot arm, bolted to the floor at its base and holding a 5 kg tool at its wrist flange with the arm stretched out”, with a different generation random seed for each (Figure 3, top). The operator chose the generation route of each independently, and consequently the nine robot arms differ in their proportions, joints and bases. In each, the operator placed the support on the base and the same load at the wrist, as the instruction states, and the solved deflections differ among the arms. A session took 3 min 33 s and 1.1 million input tokens (94% cached) on average.
Materials. For a hamburger, for example, one request asked the operator to write nine material assignments, with each segmented part of the object free to take any material, so that the cases vary as widely as possible (Figure 3, middle). The assigned Young’s moduli are shown on a scale from 100 kPa to 100 GPa. Writing the nine assignments took 45 s, and applying each assignment to the finished simulation and solving it took 1 min 40 s on average. Under the same supports and loads, the nine burgers deform in different patterns, depending on which layers are soft.
Supports and loads. For the claw hammer, a request likewise asked for nine load cases, with the supports and loads chosen freely (Figure 3, bottom). The nine cases hold the hammer at different parts and load it at different places and in different directions. Writing the nine cases took 30 s, and each run took 1 min 55 s on average.
In summary, the variations use one description to produce simulations with different geometry, material maps, boundary regions and full-field displacements. Each further variation costs one more session, which is cheaper than a fresh session starting from a minimal description.
Shape and topology optimization
MechFoundry can then improve a design against the loads it carries. A generated shape resembles the object it names, but nothing in its generation ensures that it carries those loads well. It can, however, serve as a realistic starting point for optimization, whose result depends on the design it starts from. Because the diffuse Nitsche solver is differentiable, the shape can be changed to optimize for its load case while keeping the support and load regions in place (Figure 4a). Each iteration solves the deformation, evaluates the objective, i.e., the total strain energy under a penalty on volume above a target (Methods, “Shape optimization”), and computes its sensitivity with respect to the signed distance field by the adjoint method. A gradient descent step moves the signed distance field, after which the surface and the octree are extracted again and the support and load regions are restored (Methods, “Sensitivity analysis” and “Shape optimization”). For topology optimization, the sensitivity with respect to a hidden phase field also allows for the emergence of new topological features inside the solid (Methods, “Topology optimization”).
We first optimized a rough initial design of a table under a volume penalty targeting half of its initial volume, with fixed supports at its four feet and a distributed load on its top surface (Figure 4b). Shape optimization carved the underside into four legs under the top in 101 iterations and 4.0 min. For topology optimization, with the hidden phase field enabled from iteration 35, the first cavity-like feature opened inside the solid at iteration 43 and reached the surface by iteration 80, leaving the underside with a more complex topology after 91 iterations and 3.9 min (Supplementary Figs. S13 and S17). Because half of the material was removed, the total strain energy, a measure of energy stored in the material due to deformation, ended at 1.62 times its initial value in both runs, at a volume fraction of approximately 0.5, and opening cavities gave a different topology at a similar stiffness (Supplementary Figs. S14 and S18).
We then applied shape optimization to bodies from the 50 agent-operated sessions to improve each generated design under the loads that its session posed, and show 17 of them in Figure 4c, each under the supports and loads of its session. The design objective is now the total strain energy under a penalty on volume above the initial volume, aiming at a stiffer structure under load control by redistributing the volume. Bodies with a different material per part used one material instead, i.e., the volume-weighted mean of their parts (Supplementary Section S1.6); concurrent multi-material optimization is possible [31] but beyond the scope of this work. In these optimization cases, each run stopped after 40 updates or before the surface moved more than 1.5hmin (99th percentile) or 3hmin (anywhere) from the generated one, where hmin is the size of the finest octree cell, so that the object stays recognizably the same (Supplementary Section S1.6). With growth of the volume penalized, the refinement reinforced the load-carrying members (e.g., the lower legs of the elephant, the rhinoceros and the horse, the shaft of the femur and the legs of the school chair), and removed material from regions that carry little load. Under a fixed load, which is the case for all examples shown, a lower strain energy means a stiffer body. The strain energy at the last accepted shape fell to 0.38–0.99 times its initial value, below 0.5 for 7 of the 17 bodies, for example the claw hammer (0.38), the school chair (0.42) and the femur (0.46), whereas the dental crown changed little (0.99).
Discussion
MechFoundry lets an AI agent operator decide and act at the steps that precede an engineering analysis, from how an object is used, held and loaded to what material it is made of, and then turn a few words of description into a nonlinear simulation of a deformable object, with every approval gate of the workflow answered by the operator. Generated shapes are simulated on GPUs by the diffuse Nitsche method on an adaptive octree of their signed distance field, a grid that need not conform to the surface, and AI subagents can place supports, loads and materials through the segmented parts of each shape. In our tests, the operator took each of the 50 everyday and engineering objects from its name to a solved loading case in minutes (Supplementary Fig. S1), and the same workflow produced variations of shape, materials, and supports and loads from one description. For a typical object, the displacements differed from those of body-fitted finite elements by a few percent. Gradient-based optimization made generated shapes stiffer under their loads.
The conventional finite element analysis steps that take an expert hours to days for a real-world object, from modeling and meshing to placing supports and loads, ran without a human in the loop. The procedure can be repeated across objects, shapes, materials and loads at the cost of one session each, about 6.5 min and US$1.3 of operator model calls per object with Opus 5.5, or less than half that cost with Sonnet 5.5, which received similar grades for the supports, loads, and materials. Engineers could therefore analyze a design while it is still being decided, and analyze free-form objects that have no CAD model at all.
The current workflow has limits. The solver is static, with dead loads and without contact, so it describes how an object carries its loads, whereas motion and contact with other bodies are not yet modeled. Solutions from the diffuse treatment of the surface converge at about first order with mesh refinement, strains (displacement gradients) are less accurate than displacements, and features near the octree resolution, such as thin walls and small supports, show larger discrepancies from body-fitted solutions. We did not evaluate the simulations with human experts or with a more rigorous protocol for language-model evaluation. Either would need a separate study that first defines what
makes a finite element simulation of an everyday object sound, from its loading case and materials to its numerical settings.
Contact with friction and fluid–structure interaction would let the workflow pose loading cases in which objects touch, are grasped or are surrounded by fluid, which robot environments need, and dynamic analysis would extend static responses to incorporate inertial effects. A session takes minutes, so optimization can start from many generated candidates of one object and explore designs from multiple starting points. Further steps include incorporation of material models such as plasticity and viscoelasticity, as well as neural representations of constitutive laws [32, 33], which can help in rapid identification of unknown materials. An additional direction is the enforcement of manufacturability constraints on the designed objects. Beyond engineering design, the same simulations could serve as data. Learned surrogates of mechanical response [29, 34] need training sets that vary shapes, loads and materials [35], whereas existing simulation datasets vary them only within predefined parametrizations [30, 36, 37]. Virtual environments for training robots [38] need deformable objects with known mechanical response [39], digital twins need model building that scales [40], and world models [41], which still violate basic physical laws [42], could learn physical responses from such data. Therefore, running the workflow over large lists of objects, and training surrogates and world models on the resulting simulations, is the next, broader objective of this effort.
Methods
MechFoundry takes a text prompt, a scribble, a single image or an uploaded surface to a mechanically analyzed and, on request, optimized solid object. The surface is scaled to physical size and segmented, boundary regions corresponding to parts are selected on the segments, and the deformation is solved on an adaptive octree by the diffuse Nitsche method, without a body-fitted volumetric mesh. AI subagents, requests to a multimodal language model, propose inputs at approval gates, stages at which the workflow waits for the user, and an AI agent operator can answer the gates in place of a person. The pre-trained components are used as released, and no deep learning model needs to be trained or fine-tuned in this work. The computation runs on one NVIDIA RTX A6000 GPU and an AMD Ryzen Threadripper 3970X CPU, implemented in NVIDIA Warp [24] and PyTorch [43], and results use the default configuration given in the Supplementary Information, apart from a few settings in the optimization examples. Further details are in the Supplementary Methods.
Implicit geometry
Signed distance representation. The body is carried by a scalar field s(X), negative inside and positive outside, whose zero level set is the surface. When ∣s∣ equals the distance to the surface, s is a signed distance field and satisfies the eikonal condition ∣∇s∣=1, which the diffuse Nitsche method [23] assumes.
3D shape synthesis by TripoSG and alternatives. By default, the shape comes from TripoSG [11], whose rectified-flow transformer [44] samples a latent code conditioned on an image, or on a scribble or text through its scribble model. Its decoder maps the code to a truncated signed distance field, which saturates away from the surface and only approximates a distance near it. Therefore, it serves only to extract the surface. Alternatively, Text2CAD [13] and CAD-Coder [14] turn a text prompt into a CAD solid, Hunyuan3D-2.1 [12] turns an image into a colored surface, and Stable Diffusion XL [25] can draw the input image from text.
Adaptive octree extraction. An adaptively refined octree, a grid of cubic cells subdivided only where needed, is built in the manner of multiresolution isosurface extraction [45], by subdividing the cells near the surface, keeping neighboring cells within one level of each other [46, 47] and querying the field at the new nodes only. For TripoSG, a first extraction queries the truncated signed distance field and is followed by marching cubes [48] to extract a surface. Every surface is then scaled uniformly to an approved physical length and becomes the source surface. A second extraction, on the exact signed distance to the source surface, with its sign from the generalized winding number [27], builds the octree mesh for the analysis, with finest cell width hmin=0.015Lmax at the default octree level 7, where Lmax is the longest side of the bounding box of the scaled source surface. The nodes of a fine cell that are not nodes of a neighboring coarse cell are hanging nodes [47], whose values are averaged from the coarse cell’s nodes.
Signed distance reinitialization. The discretized signed distance field cannot represent fine details (sharp edges, thin walls, notches, etc.) and, interpolated trilinearly, no longer satisfies the eikonal condition. Therefore, we extract a reconstructed surface from it by marching cubes and re-evaluate the exact signed distance to that surface at every node. Thus, the solution is that of the reconstructed surface, on which sharp edges are rounded at the scale of hmin, thinner features are not represented faithfully, and members a few hmin thick are not precisely resolved in bending.
Boundary-region identification
In finite element frameworks, a boundary region is conventionally located by interactive selection or by a geometric test. Neither is viable on a non-conforming octree mesh for AI subagents that work from images and text. Therefore, we find the region on an explicit surface in three steps. First, the source surface is segmented, by default into five segments by clustering [49] the per-facet features of the pre-trained part-feature network PartField [26]. A surface from a text-to-CAD model keeps its CAD faces as segments. Second, a selector program, written and visually checked by an AI subagent, builds each region as a set of facets from 25 primitive selectors, for example by position, normal direction, segment or flood fill, combined by Boolean operations. Third, a quadrature point of the octree mesh belongs to the region when its distance to the nearest selected facet is below 0.75hmin. The marked points form the indicator MDi of the i-th Dirichlet (support) region, MNi of the i-th Neumann (load) region, or Mi for either. A support prescribes one scalar displacement value, on all three components or on chosen ones, and a load prescribes a constant traction. A body force b may also be added. All loads are dead loads, which do not follow the deformation, and the analysis is static.
Diffuse Nitsche finite element analysis
Phase field and diffused zero level set. Because the octree cells do not conform to the surface, we follow the diffuse-domain approach [50] and the diffuse Nitsche method [23] and replace the body Ω by a phase field, taking a value of unity in the interior and zero in the exterior, φ=21(1−tanh(s/ε)) with ε=21hmin in the transition layer near the boundary. Its thin transition layer is the diffused zero level set. Elements whose nodal values all satisfy φ<10−3 are removed, leaving the analysis (trimmed) mesh K, and its elements with a node at ∣s∣<3.45ε, where 10−3<φ<1−10−3, form the diffuse boundary band B. Integrals over the body Ω and over its surface in region i, ∂Ωi, become volume integrals over the octree,
with the material weight w(φ)=(1−φ0)φ+φ0, φ0=10−4.
Weak form. The solid is a compressible neo-Hookean material [51] with strain energy density W(F) defined in Supplementary Methods, deformation gradient F=I+∇u and first Piola–Kirchhoff stress P. Dirichlet conditions are imposed weakly by a symmetric Nitsche method [52]. The trilinear displacement u satisfies R(u,v)=0 for an arbitrary test displacement v in the same space, with
where A[H]=(∂P/∂F):H is the material tangent, χ(X) is one where φ>φ0 and zero elsewhere, uˉi and tˉi are the prescribed displacement and traction, and β(X) is the penalty. The bracket holds the consistency term (the boundary traction on the Dirichlet region), the symmetry term (its transpose, which makes the tangent symmetric) and the penalty term.
Load correction and penalty stabilization. Because MNi also reaches the diffused zero level set of the adjacent, unloaded face, we replace the weight ∣∇φ∣ of the traction term by the positive part of −∇φ⋅nfi, with nfi the region’s mean normal, and rescale each traction once so that the region’s total force equals the traction times its projected area.
The penalty term must dominate the consistency and symmetry terms. Following the stability argument of Ref. [23], derived there for the scalar Poisson problem, the penalty factor β of each band element is 5 times the largest eigenvalue of a generalized eigenvalue problem [53] that bounds its normal-traction energy by its strain energy, with a floor. Computed with the small-strain elasticity tensor for efficiency, the solution of β only estimates the bound that coercivity needs.
Newton solution and linear solver. All elements carry a 2×2×2 Gauss rule. Newton’s method is applied in a single load step, without line search in our results, until the residual norm falls to 10−2 of its initial value by default or below an absolute floor. The tangent omits the second derivative of P in the symmetry term, so the iteration is quasi-Newton. The linear systems are solved in either single precision or double precision by conjugate gradients with an algebraic-multigrid preconditioner (NVIDIA AmgX [54], through JAX-AMG [55]). Because ε is tied to hmin, the modeling error of the diffuse-domain approximation is refined together with the discretization error. In a preliminary comparison on one problem, the displacement error converges at roughly first order, against roughly second order for body-fitted finite elements (Supplementary Methods).
Sensitivity analysis
Optimization minimizes an objective J(U,m) subject to R(U,m)=0, where U and m are the nodal values of the displacement u and of the signed distance field s, and R is the residual vector, R(u,v)=VTR in Eq. (2) with V the nodal values of v. Finite differences would cost one nonlinear solve per design variable, prohibitive for a nodal design space. Therefore, the derivative is obtained by the adjoint state method [3], at the cost of one extra linear solve with the same symmetric tangent for the adjoint state λ,
DmDJ=∂m∂J+λT∂m∂R,(∂U∂R)Tλ=−(∂U∂J)T.(3)
Reverse-mode automatic differentiation over a chain-rule recording tape gives the explicit derivatives, and a custom node on the tape solves for λ with the same preconditioned conjugate-gradient iteration and stopping rule as each Newton step. Outside the boundary band B, the slope dφ/ds=−2φ(1−φ)/ε nearly vanishes, so the chain from s to φ passes almost no gradient back. Thus, we keep it off the tape there to save time, and s carries no stiffness sensitivity in the interior. The result is approximate, because the forward state is converged only to the Newton tolerance, the tangent is quasi-Newton, and quantities rebuilt off the tape, such as the penalty, contribute no sensitivity. A central-difference test agrees within 1% at nodes farther than ε from the surface and within 15% closer to it, and the sensitivity is used as an inexact search direction.
Shape optimization
As in level-set structural optimization [4, 3], the design variable for shape optimization is s. We seek a stiff design whose volume does not exceed a target fraction of the initial volume. Therefore, we minimize the normalized strain energy under a one-sided volume penalty,
References
[1]A. Jacobson, L. Kavan, O. Sorkine-Hornung, Robust inside-outside segmentation using generalized winding numbers, ACM Transactions on Graphics (TOG) 32 (4) (2013) 1–12.DOI
[2]Y. Li, Z.-X. Zou, Z. Liu, D. Wang, Y. Liang, Z. Yu, X. Liu, Y.-C. Guo, D. Liang, W. Ouyang, et al., Triposg: High-fidelity 3d shape synthesis using large-scale rectified flow models, IEEE Transactions on Pattern Analysis and Machine Intelligence (2025).arxiv.org/abs/2502.06608
[3]X. Liu, C. Gong, Q. Liu, Flow straight and fast: Learning to generate and transfer data with rectified flow, arXiv preprint arXiv:2209.03003 (2022).arxiv.org/abs/2209.03003
[4]M. S. Khan, S. Sinha, T. U. Sheikh, D. Stricker, S. A. Ali, M. Z. Afzal, Text2cad: Generating sequential cad designs from beginner-to-expert level text prompts, Advances in Neural Information Processing Systems 37 (2024) 7552–7579.arxiv.org/abs/2409.17106
[5]J. Devlin, M.-W. Chang, K. Lee, K. Toutanova, Bert: Pre-training of deep bidirectional transformers for language understanding, in: Proceedings of the 2019 conference of the North American chapter of the association for computational linguistics: human language technologies, volume 1 (long and short papers), 2019, pp. 4171–4186.arxiv.org/abs/1810.04805
[6]Y. Guan, X. Wang, X. Xing, J. Zhang, D. Xu, Q. Yu, Cad-coder: Text-to-cad generation with chain-of-thought and geometric reward, Advances in Neural Information Processing Systems 38 (2026) 59765–59789.arxiv.org/abs/2505.19713
[7]T. H. Team, Hunyuan3d 2.1: From images to high-fidelity 3d assets with production-ready pbr material (2025). arXiv:2506.15442.arxiv.org/abs/2506.15442
[8]Z. Lai, Y. Zhao, Z. Zhao, H. Liu, F. Wang, H. Shi, X. Yang, Q. Lin, J. Huang, Y. Liu, J. Jiang, C. Guo, X. Yue, Unleashing vesect diffusion model for fast shape generation (2025). arXiv:2503.16302. URL https://arxiv.org/abs/2503.16302
[9]D. Podell, Z. English, K. Lacey, A. Blattmann, T. Dockhorn, J. Müller, J. Penna, R. Rombach, Sdxl: Improving latent diffusion models for high-resolution image synthesis, in: International Conference on Learning Representations, Vol. 2024, 2024, pp. 1862–1874.
[11]L. Zhang, A. Rao, M. Agrawala, Adding conditional control to text-to-image diffusion models, in: 2023 IEEE/CVF International Conference on Computer Vision (ICCV), IEEE, 2023, pp. 3813–3824.arxiv.org/abs/2302.05543
[12]L. Mescheder, M. Oechsle, M. Niemeyer, S. Nowozin, A. Geiger, Occupancy networks: Learning 3d reconstruction in function space, in: 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), IEEE, 2019, pp. 4455–4465.arxiv.org/abs/1812.03828
[13]H. Sundar, R. S. Sampath, G. Biros, Bottom-up construction and 2: 1 balance refinement of linear octrees in parallel, SIAM Journal on Scientific Computing 30 (5) (2008) 2675–2708.DOI
[14]C. Burstedde, L. C. Wilcox, O. Ghattas, p4est: Scalable algorithms for parallel adaptive mesh refinement on forests of octrees, SIAM Journal on Scientific Computing 33 (3) (2011) 1103–1133.
[15]W. E. Lorensen, H. E. Cline, Marching cubes: A high resolution 3d surface construction algorithm, in: Proceedings of the 14th Annual Conference on Computer Graphics and Interactive Techniques, SIGGRAPH ’87, Association for Computing Machinery, New York, NY, USA, 1987, p. 163–169. doi:10.1145/37401.37422. URL https://doi.org/10.1145/37401.37422
[16]M. Liu, M. A. Uy, D. Xiang, H. Su, S. Fidler, N. Sharp, J. Gao, Partfield: Learning 3d feature fields for part segmentation and beyond, in: 2025 IEEE/CVF International Conference on Computer Vision (ICCV), IEEE, 2025, pp. 9704–9715.arxiv.org/abs/2504.11451
[17]J. H. Ward Jr, Hierarchical grouping to optimize an objective function, Journal of the American statistical association 58 (301) (1963) 236–244.DOI
[18]L. Shapira, A. Shamir, D. Cohen-Or, Consistent mesh partitioning and skeletonisation using the shape diameter function, The Visual Computer 24 (4) (2008) 249–259.DOI
[19]P. Alliez, A. Fabri, Cgal: the computational geometry algorithms library (2016).DOI
[20]Y. Boykov, O. Veksler, R. Zabih, Fast approximate energy minimization via graph cuts, IEEE Transactions on pattern analysis and machine intelligence 23 (11) (2001) 1222–1239.
[21]X. Li, J. Lowengrub, A. Rätz, A. Voigt, Solving pdes in complex geometries: a diffuse domain approach, Communications in mathematical sciences 7 (1) (2009) 81.pubmed.ncbi.nlm.nih.gov/21603084
[22]L. H. Nguyen, S. K. Stoter, M. Ruess, M. A. Sanchez Uribe, D. Schillinger, The diffuse nitsche method: (Dirichlet constraints on phase-field boundaries, International Journal for Numerical Methods in Engineering 113 (4) (2018) 601–633.
[23]J. Bonet, R. D. Wood, Nonlinear continuum mechanics for finite element analysis, Cambridge university press, 2008.DOI
[24]R. Dagli, D. Xiang, V. Modi, C. Loop, C. F. Tsang, A. H. Chen, A. Hu, G. State, D. I. Levin, M. Shugrina, Vomp: Predicting volumetric mechanical property fields, arXiv preprint arXiv:2510.22975 (2025).arxiv.org/abs/2510.22975
[25]A. Xu, B. Li, B. Lin, B. Xue, B. Xian, B. Xu, B. Wu, B. Zhang, B. Deng, C. Yu, et al., Deepseek-v4. 1-flash: Pushing the limits of kv cache compression, arXiv preprint arXiv:2609.19969 (2026).arxiv.org/abs/2609.19969
[26]J. Nitsche, Über ein variationsprinzip zur lösung von dirichlet-problemen bei verwendung von teilräumen, die keinen randbedingungen unterworfen sind, in: Abhandlungen aus dem mathematischen Seminar der Universität Hamburg, Vol. 36, Springer, 1971, pp. 9–15.DOI
[27]A. Embar, J. Dolbow, I. Harari, Imposing dirichlet boundary conditions with nitsche’s method and spline-based finite elements, International journal for numerical methods in engineering 83 (7) (2010) 877–898.
[28]J. Parvizian, A. Düster, E. Rank, Finite cell method: h-and p-extension for embedded domain problems in solid mechanics, Computational Mechanics 41 (1) (2007) 121–133.DOI
[29]M. Naumov, M. Arsaev, P. Castonguay, J. Cohen, J. Demouth, J. Eaton, S. Layton, N. Markovskiy, I. Reguly, N. Sakharnykh, et al., Amgx: A library for gpu accelerated algebraic multigrid and preconditioned iterative methods, SIAM Journal on Scientific Computing 37 (5) (2015) S602–S626.DOI
[30]Y. Liu, X. Fan, J.-X. Wang, Jax-amgx: A gpu-accelerated differentiable sparse linear solver library for jax, arXiv preprint arXiv:2606.09001 (2026).DOI
[31]G. Allaire, F. Jouve, A.-M. Toader, Structural optimization using sensitivity analysis and a level-set method, Journal of computational physics 194 (1) (2004) 363–393.DOI
[32]M. Y. Wang, X. Wang, D. Guo, A level set method for structural topology optimization, Computer methods in applied mechanics and engineering 192 (1-2) (2003) 227–246.DOI
[33]M. P. Bendsøe, Optimal shape design as a material distribution problem, Structural optimization 1 (4) (1989) 193–202.DOI
[34]H. Fuchs, Z. M. Kedem, S. P. Uselton, Optimal surface reconstruction from planar contours, Communications of the ACM 20 (10) (1977) 693–702.
[35]G. Taubin, A signal processing approach to fair surface design, in: Proceedings of the 22nd annual conference on Computer graphics and interactive techniques, 1995, pp. 351–358.
[36]X.-L. Luo, S. Yang, J. Tan, R. F. Shepherd, N. Cohen, N. Bouklas, Towards end-to-end optimization in multi-material 3d printing, arXiv preprint arXiv:2607.13174 (2026).arxiv.org/abs/2607.13174
[37]Q. Xia, T. Shi, L. Xia, Stable hole nucleation in level set based topology optimization by using the material removal scheme of beso, Computer Methods in Applied Mechanics and Engineering 343 (2019) 438–452.DOI
[38]J. Wang, Z. Duan, Agent ai with langgraph: A modular framework for enhancing machine translation using large language models, arXiv preprint arXiv:2412.03801 (2024).arxiv.org/abs/2412.03801
[39]A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, et al., Pytorch: An imperative style, high-performance deep learning library, Advances in neural information processing systems 32 (2019).arxiv.org/abs/1912.01703
[40]M. Macklin, Warp: A high-performance python framework for gpu simulation and graphics, https://github.com/nvidia/warp, NVIDIA GPU Technology Conference (GTC) (2022).
[41]J. Gu, X. Jiang, Z. Shi, H. Tan, X. Zhai, C. Xu, W. Li, Y. Shen, S. Ma, H. Liu, et al., A survey on llm-as-a-judge, The Innovation 7 (6) (2026).
[42]T. Schneider, Y. H. Wu, X. Gao, J. Dumas, D. Zorin, D. Panazzo, A large-scale comparison of tetrahedral and hexahedral elements for solving elliptic pdes with the finite element method, ACM Transactions on Graphics (TOG) 41 (3) (2022) 1–14.DOI