# SOFA（软件）

**SOFA**（Simulation Open-Framework Architecture，仿真开放框架架构）是一个开源的 C++ 框架，用于基于有限元方法（FEM）的交互式物理仿真，侧重医学仿真与机器人学。它主要面向研究群体，以促进新算法的诞生，但也可用作原型开发工具；自 2006 年起，它由一个国际社区持续开发。<sup>[1](https://github.com/sofa-framework/sofa)</sup><sup> • </sup><sup>[2](https://www.sofa-framework.org/)</sup>

| 关键事实 | 详情 |
|---|---|
| 全称 | Simulation Open-Framework Architecture（仿真开放框架架构）<sup>[1](https://github.com/sofa-framework/sofa)</sup> |
| 用途 | 基于有限元方法的交互式物理仿真，侧重医学仿真与机器人学<sup>[1](https://github.com/sofa-framework/sofa)</sup> |
| 许可 | 框架采用 LGPL 2.1 或更高版本；应用/项目与教程采用 GPL 2 或更高版本<sup>[1](https://github.com/sofa-framework/sofa)</sup> |
| 起源 | 版权 2006 年归 INRIA、USTL、UJF、CNRS、MGH 所有；自 2006 年起由国际社区开发<sup>[1](https://github.com/sofa-framework/sofa)</sup><sup> • </sup><sup>[2](https://www.sofa-framework.org/)</sup> |
| 治理 | SOFA 联盟（SOFA Consortium），由 Inria 于 2015 年 12 月创立，负责协调开发与维护<sup>[3](https://www.sofa-framework.org/about/story/)</sup> |
| 参考出版物 | F. Faure 等，《SOFA：用于交互式物理仿真的多模型框架》，Springer，2012<sup>[4](https://cir.nii.ac.jp/crid/1360862098469342976)</sup> |
| 近期版本 | 每年发布两次，从 v22.06.00 到 v26.06.00（2026 年 7 月）<sup>[5](https://github.com/sofa-framework/sofa/releases)</sup> |

## 架构

SOFA 将复杂的仿真器分解为独立设计的组件，并以场景图（scenegraph）数据结构加以组织；这一做法旨在让不同领域的专家协作开发同一个仿真器。<sup>[6](https://www.researchgate.net/publication/245022046_SOFA_A_Multi-Model_Framework_for_Interactive_Physical_Simulation)</sup> 场景是一个有向无环图，描述物理系统、其行为、其属性以及用于计算的数值工具。它从根节点（Node）开始，根节点的子节点通常各对应一个物理系统；对某个节点执行的操作会自动传播到其所有子节点。<sup>[7](https://sofa-framework.github.io/doc/using-sofa/terminology/)</sup>

**组件与数据。** 组件（Component）是实现特定物理模型或算法的 C++ 类，必须归属于某个节点。数据（Data）是组件的公开属性，在界面中对用户可见，例如质量组件中的总质量；不同组件的数据实例可通过链接（Link）相连，形成叠加在场景图之上的数据依赖图。<sup>[7](https://sofa-framework.github.io/doc/using-sofa/terminology/)</sup> 该框架区分以下几类：库（Library，定义框架机制的核心元素，不含组件）、模块（Module，包含通常的组件，可通过插件管理器加载）、项目（Project，以 SOFA 为依赖的可执行程序，如 runSofa 查看器）以及教程（Tutorial）。<sup>[7](https://sofa-framework.github.io/doc/using-sofa/terminology/)</sup>

**仿真循环。** 每个仿真都由一个动画循环（animation loop）支配，它推动仿真从一个时间步进入下一个时间步，并在每一步触发系统及其相关约束的求解；若未定义动画循环，则会自动创建一个 DefaultAnimationLoop。仿真的自由度存储在由 MechanicalObject 组件管理的状态向量中，该组件的模板参数指定所计算的物理类型，例如可变形体为每节点 3 个实数，或每节点一个刚体。动态仿真还需要一个积分格式（例如显式或隐式欧拉法，或龙格-库塔法）和一个线性求解器（迭代共轭梯度法或 LU 分解等直接法）。<sup>[8](https://sofa-framework.github.io/doc/simulation-principles/example-simple-body/)</sup> 除软体力学外，该框架还包含热力学与流体力学组件。<sup>[8](https://sofa-framework.github.io/doc/simulation-principles/example-simple-body/)</sup>

**碰撞处理。** 在所有 SOFA 仿真中，碰撞阶段与物理仿真分开执行，通常在各求解器被调用之前进行。碰撞流水线运行三个步骤：碰撞重置、碰撞检测与碰撞响应。检测分为粗检测阶段（broad phase）与精细检测阶段（narrow phase）：前者使用包围盒找出可能碰撞的配对，后者使用点、线、三角形、球体、立方体、圆柱体或有向包围盒等图元，以及距离网格和光线投射来测试实际接触。<sup>[9](https://sofa-framework.github.io/doc/simulation-principles/multi-model-representation/collision/)</sup>

## 历史与治理

该框架的版权声明将 2006 年的版权归于 INRIA、USTL、UJF、CNRS 和 MGH，项目自称自 2006 年起由国际社区开发。<sup>[1](https://github.com/sofa-framework/sofa)</sup><sup> • </sup><sup>[2](https://www.sofa-framework.org/)</sup> 首次提交整整十年后，Inria 于 2015 年 12 月创立了 SOFA 联盟，此后开发与维护一直由该联盟协调。<sup>[3](https://www.sofa-framework.org/about/story/)</sup> 主要参考出版物由 弗朗索瓦·福尔（François Faure）、克里斯蒂安·迪里耶（Christian Duriez）、埃尔韦·德兰热特（Hervé Delingette）等十一位研究者撰写，于 2012 年发表于 Springer 的《Soft Tissue Biomechanical Modeling for Computer Assisted Surgery》。<sup>[4](https://cir.nii.ac.jp/crid/1360862098469342976)</sup> 软体机器人学方面的配套引用是 E. Coevoet 等，“SoftRobot: Software toolkit for modeling, simulation, and control of soft robots，”《Advanced Robotics》，2017。<sup>[10](https://sofa-framework.github.io/doc/)</sup>

## 插件与扩展

核心之外的功能通过插件提供。SoftRobots 插件包含专用于软体机器人学的组件，包括线缆驱动与气动驱动的模型、为机器人末端执行器定义轨迹的工具，以及与微控制器板通信的工具；驱动与接触通过在可变形模型的边界条件上以[拉格朗日乘子](https://www.edgepedia.org/zh/lagrange-multipliers)定义约束来处理。<sup>[10](https://sofa-framework.github.io/doc/)</sup><sup> • </sup><sup>[11](https://softrobots.readthedocs.io/en/latest/)</sup> SofaCUDA 插件使用 NVIDIA CUDA 工具包将该架构扩展到基于 GPU 的计算。<sup>[12](https://www.sofa-framework.org/applications/plugins/cuda-gpu-computing/)</sup> 模型降阶（Model Order Reduction）是一种降低有限元仿真计算复杂度的技术，作为单独的插件提供。<sup>[13](https://sofa-framework.github.io/doc/using-sofa/performances/improve-performances/)</sup> Python 接口通过 SofaPython3 插件提供，近期版本要求 Python 3.12 以及 NumPy、SciPy 和 pybind11。<sup>[5](https://github.com/sofa-framework/sofa/releases)</sup>

## 应用

SOFA 历来侧重软组织力学，这使它成为外科手术仿真研究的支柱：一篇关于实时医学仿真的系统综述指出，仿真开放框架架构因其粘弹性物理建模能力，成为软组织外科手术仿真的支柱。<sup>[14](https://pmc.ncbi.nlm.nih.gov/articles/PMC13511724/)</sup> 一项基于 GPU 的腹腔镜肝切除术交互式仿真支持切除过程中的拓扑变化，就是用该框架实现的。<sup>[15](https://history.siggraph.org/wp-content/uploads/2022/07/2011-Realtime-Live-Courtecuisse_GPU-Based-Interactive-Simulation-of-Liver-Resection.pdf)</sup>

**软体机器人学。** Soft Robotics Toolkit 分发基于 SoftRobots 插件构建的示例，包括一个带驱动器控制的三指软体夹爪的完整仿真，以及一个线缆驱动的菱形机器人。<sup>[16](https://softroboticstoolkit.com/sofa/examples)</sup> 研究者还使用 SOFA 设计并训练了一个采用近端策略优化强化学习的行走三足软腿机器人。<sup>[17](https://arxiv.org/abs/2504.09242)</sup>

**外科手术强化学习。** LapGym 是一个为机器人辅助腹腔镜手术构建强化学习环境的框架，它提供 sofa_env——一套基于 SOFA 构建的 12 个环境，分为四条线：空间推理、[可变形物体操作](https://www.edgepedia.org/zh/deformable-object-manipulation)与抓取、解剖、以及缝线操作。<sup>[18](https://arxiv.org/abs/2302.09606)</sup> 相关工作将 SofaCuda 描述为一项积极的努力，旨在实现基于 GPU 的物理仿真，作为基于 CPU 的 SOFA 组件的直接替代，其动机是同策略强化学习对样本效率的要求。<sup>[19](https://jmlr.org/papers/volume24/23-0207/23-0207.pdf)</sup>

**衍生框架。** 由于基本仿真所需的组件众多，一些用户觉得 SOFA 难以驾驭，而且其可视化渲染能力有限，因此开发了 Filasofia 框架，以简化开发、提供现代可视化，并允许使用 SOFA 对象进行精细调整。<sup>[20](https://arxiv.org/abs/2311.14508)</sup> 一篇关于机器人应用仿真器的综述将 SOFA 列入最先进医学机器人研究中使用的仿真器之列，与 [CHAI3D](https://www.edgepedia.org/zh/chai-3d)、AMBF、CoppeliaSim 和 UnityFlexML 并列。<sup>[21](https://ora.ox.ac.uk/objects/uuid%3Ae64b1797-917d-4b75-8eae-a5a60af74246/files/sx346d596k)</sup> 在外科机器人学背景下，2020 年的一项综述将 SOFA 归类为需要大幅改造、或仅覆盖机器人手术开发所需部分功能的框架，并举例指出其缺少处理医学图像或与手术导航系统交互的模块。<sup>[22](https://www.sciencedirect.com/science/article/abs/pii/S0010482520301025)</sup>

## 社区与版本发布

该项目托管在 GitHub 上，采用 LGPL-2.1 许可，截至 2026 年中期约有 1.3 千颗星和 363 个复刻。<sup>[1](https://github.com/sofa-framework/sofa)</sup> 版本按每年两次的节奏发布，以年月命名，从 v22.06.00 到 v25.12.00，以及最新的 v26.06.00（2026 年 7 月 15 日发布）。<sup>[5](https://github.com/sofa-framework/sofa/releases)</sup> [文档](https://www.edgepedia.org/zh/documentation)涵盖入门、主要原理、构建仿真场景的用户文档以及贡献代码的开发者文档，并有 GitHub Discussions 论坛提供支持。<sup>[10](https://sofa-framework.github.io/doc/)</sup>

## References

1. [SOFA framework repository README, GitHub](https://github.com/sofa-framework/sofa)
2. [SOFA framework official website](https://www.sofa-framework.org/)
3. [Story of SOFA, sofa-framework.org](https://www.sofa-framework.org/about/story/)
4. [Faure et al. (2012), SOFA: A Multi-Model Framework for Interactive Physical Simulation, CiNii Research record](https://cir.nii.ac.jp/crid/1360862098469342976)
5. [Releases of sofa-framework/sofa, GitHub](https://github.com/sofa-framework/sofa/releases)
6. [SOFA: A Multi-Model Framework for Interactive Physical Simulation, ResearchGate chapter page](https://www.researchgate.net/publication/245022046_SOFA_A_Multi-Model_Framework_for_Interactive_Physical_Simulation)
7. [Terminology, SOFA Documentation](https://sofa-framework.github.io/doc/using-sofa/terminology/)
8. [Example-Simple Body, SOFA Documentation](https://sofa-framework.github.io/doc/simulation-principles/example-simple-body/)
9. [Collision, SOFA Documentation](https://sofa-framework.github.io/doc/simulation-principles/multi-model-representation/collision/)
10. [SOFA Documentation overview](https://sofa-framework.github.io/doc/)
11. [The SoftRobots plugin for SOFA, Read the Docs](https://softrobots.readthedocs.io/en/latest/)
12. [SOFA – CUDA GPU Computing, sofa-framework.org](https://www.sofa-framework.org/applications/plugins/cuda-gpu-computing/)
13. [Improve performances, SOFA Documentation](https://sofa-framework.github.io/doc/using-sofa/performances/improve-performances/)
14. [Applications of Reinforcement Learning for Autonomous Surgical Robotics: A Systematic Review, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC13511724/)
15. [GPU-Based Interactive Simulation of Liver Resection, SIGGRAPH history](https://history.siggraph.org/wp-content/uploads/2022/07/2011-Realtime-Live-Courtecuisse_GPU-Based-Interactive-Simulation-of-Liver-Resection.pdf)
16. [Examples & Features of the SoftRobots Plugin, Soft Robotics Toolkit](https://softroboticstoolkit.com/sofa/examples)
17. [Development of a PPO-Reinforcement Learned Walking Tripedal Soft-Legged Robot using SOFA, arXiv](https://arxiv.org/abs/2504.09242)
18. [LapGym: An Open Source Framework for Reinforcement Learning in Robot-Assisted Laparoscopic Surgery, arXiv](https://arxiv.org/abs/2302.09606)
19. [Scheikl et al., JMLR volume 24](https://jmlr.org/papers/volume24/23-0207/23-0207.pdf)
20. [Filasofia: A Framework for Streamlined Development of Real-Time Surgical Simulations, arXiv](https://arxiv.org/abs/2311.14508)
21. [A Review of Physics Simulators for Robotic Applications, Oxford Research Archive](https://ora.ox.ac.uk/objects/uuid%3Ae64b1797-917d-4b75-8eae-a5a60af74246/files/sx346d596k)
22. [Surgeon–robot interface development framework, Computers in Biology and Medicine](https://www.sciencedirect.com/science/article/abs/pii/S0010482520301025)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 工程与制造 › 机器人技术与自动化 › Robot software, AI, and methods › Simulation, physics engines, and digital twins

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/sofa-software

English original: https://www.edgepedia.org/sofa-software
