|
9 | 9 | This SOFA plugin (https://github.com/sofa-framework/sofa) provides a customized collision |
10 | 10 | pipeline, designed specifically for needle insertion simulations. |
11 | 11 |
|
12 | | -When used together with SOFA haptic device plugins, the system offers tactile feedback |
| 12 | +Coupled with SOFA haptic device plugins, the system offers tactile feedback |
13 | 13 | for puncture resistance, release and friction during insertion and retraction. |
14 | 14 |
|
15 | | -This plugin has also been integrated in Unity via the [`SOFAUnity`](https://github.com/InfinyTech3D/SofaUnity) |
| 15 | +Unity Engine integration is offered via the [`SOFAUnity`](https://github.com/InfinyTech3D/SofaUnity) |
16 | 16 | plugin by InfinyTech3D for an enhanced simulation experience. Contact us for more information! |
17 | 17 |
|
18 | 18 | ## Features |
19 | 19 |
|
20 | 20 | - Proximity detection between the needle and tissue mesh primitives |
21 | | -- Needle simulation phases: puncture, insertion, retraction |
22 | | -- Constraint-based needle simulation during the 3 phases |
| 21 | +- Needle insertion is simulated in phases: puncture, insertion, retraction |
| 22 | +- Needle-tissue coupling is done using Lagrangian constraints |
23 | 23 | - Support for haptic feedback such as resistance during puncture and friction during insertion |
24 | 24 | - Compatible with SOFA-Unity integration for real-time interactive applications |
25 | 25 |
|
26 | 26 | ## Installation and Setup |
27 | 27 |
|
28 | | -First review the official SOFA documentation for building and registering SOFA plugins |
| 28 | +This plugin can be installed by following the official SOFA documentation for building and registering SOFA plugins |
29 | 29 | https://sofa-framework.github.io/doc/plugins/build-a-plugin-from-sources/ |
30 | 30 |
|
| 31 | + |
31 | 32 | ### Build Steps |
32 | 33 |
|
33 | | -- Set up your `external_directories` directory (described in the SOFA documentation link above) |
34 | | -- Clone this repository into your `external_directories` directory: |
35 | | - - git clone https://github.com/InfinyTech3D/CollisionAlgorithm.git |
36 | | -- Register the path to your local `CollisionAlgorithm` repository in the CMakeLists.txt file located inside your `external_directories` directory |
37 | | -```sofa_add_subdirectory(plugin CollisionAlgorithm CollisionAlgorithm)``` |
38 | | -- Set `SOFA_EXTERNAL_DIRECTORIES` variable (preferably using CMake GUI) to point to your `external_directories` directory |
| 34 | +- Set up the `external_directories` directory |
| 35 | +- Clone into `external_directories`: |
| 36 | +``` |
| 37 | +git clone https://github.com/InfinyTech3D/CollisionAlgorithm.git |
| 38 | +``` |
| 39 | +- Register plugin path in the `external_directories` CMakeLists.txt. |
| 40 | +``` |
| 41 | +sofa_add_subdirectory(plugin CollisionAlgorithm CollisionAlgorithm) |
| 42 | +``` |
| 43 | +- Set the `SOFA_EXTERNAL_DIRECTORIES` variable pointing to `external_directories` |
39 | 44 | - Configure and generate the SOFA solution using CMake |
40 | 45 | - Compile SOFA solution (the plugin will be compiled as well) |
41 | 46 |
|
42 | 47 | > [!IMPORTANT] |
43 | | -> In order to use the plugin, make sure that you have also built the downstream |
| 48 | +> In order to use it, this plugin must be build alongside the downstream |
44 | 49 | [`ConstraintGeometry`](https://github.com/InfinyTech3D/ConstraintGeometry) plugin. |
45 | 50 |
|
46 | 51 | Supported SOFA version: v25.06 and above |
47 | 52 |
|
48 | 53 | ## Architecture |
49 | 54 |
|
50 | 55 | - doc: |
51 | | - - Documentation and screenshots of the examples |
| 56 | + - Code documentation |
52 | 57 | - scenes: |
53 | 58 | - Various simple demo scenes |
54 | 59 | - src/CollisionAlgorithm: |
55 | | - - source code of the insertion algorithm SOFA component and supporting collision pipeline classes |
| 60 | + - SOFA components implementing the insertion algorithm and the supporting collision pipeline |
56 | 61 | - regression: |
57 | | - - Files for automated regression testing in alignment with SOFA's testing framework |
| 62 | + - Reference files for automated non-regression tests based on SOFA's testing framework |
58 | 63 |
|
59 | | -## Usage |
| 64 | +## Get Started |
60 | 65 |
|
61 | | -- To use the plugin, include the `CollisionAlgorithm` plugin in your SOFA .xml scene file. |
| 66 | +- Include the `CollisionAlgorithm` plugin in a scene file. |
62 | 67 |
|
63 | | -``` <RequiredPlugin name=`CollisionAlgorithm`/> ``` |
64 | | -- Add the `CollisionLoop` component in the root node of your scene. |
| 68 | +``` <RequiredPlugin pluginName=`CollisionAlgorithm`/> ``` |
| 69 | +- Add the `CollisionLoop` component at the root node of your scene. |
65 | 70 |
|
66 | 71 | ``` |
67 | 72 | <FreeMotionAnimationLoop/> |
68 | 73 | <ProjectedGaussSeidelConstraintSolver tolerance='<your tolerance>' maxIt='<maximum solver iterations>' /> |
69 | | -<CollisionLoop/> |
| 74 | +**<CollisionLoop/>** |
70 | 75 |
|
71 | 76 | <CollisionPipeline/> |
72 | 77 | <BruteForceBroadPhase/> |
73 | 78 | <BVHNarrowPhase/> |
74 | 79 | <CollisionResponse name='response' response='FrictionContactConstraint'/> |
75 | 80 | <LocalMinDistance name='proximity' alarmDistance='0.2' contactDistance='0.08'/> |
76 | 81 | ``` |
77 | | -This component substitutes the default `CollisionPipeline` and manages the needle insertion algorithm. |
78 | | -However, the two components can co-exist, allowing users to mix the standard collision detection/constraint resolution pipelines of SOFA. |
| 82 | +This component manages the needle insertion algorithm. It can work simultaneously with the existing SOFA `CollisionPipeline` |
| 83 | +and can thus be added incrementally in existing SOFA scenes where contacts and collisions are modelled. |
79 | 84 |
|
80 | | -- Create a node to represent the needle and additional nodes for the needle tip and shaft geometries |
81 | | -Refer to the `scenes/NeedleInsertion.xml` example scene for guidance. |
| 85 | +- Create a node to represent the needle and additional nodes for the needle tip and shaft geometries. |
| 86 | +This step is more detailed, so refer to the examples in `scenes/NeedleInsertion.xml` for guidance. |
82 | 87 |
|
83 | 88 | - Add an `InsertionAlgorithm` component inside the needle node as shown below. |
84 | 89 | ``` |
|
0 commit comments