Skip to content

Conversation

@th-skam
Copy link
Collaborator

@th-skam th-skam commented Jul 30, 2025

Main changes

1. Renamed DetectionOutput variables

Detection output variables have been renamed to better reflect their intended purpose:

  • collisionOutput: needle-surface proximity pair during the puncture
  • insertionOutput: needle-volume proximity pairs during the insertion phase

2. Renamed links to BaseGeometry objects.

Previous naming convention gives emphasis on the directionality of the detection. l_from and l_dest (or l_fromVol / l_destVol) imply how proximity pairs were computed (from -> destination geometries). The user shouldn't be concerned with this.

The InsertionAlgorithm is tailored for needle insertion. In the scene, the user must specify the BaseGeometry specializations that correspond to the nodes of the:

  • Needle Tip: detects proximities during puncture AND insertion
  • Needle Shaft: used to couple proximities detected within the volume
  • Surface: of the object to be punctured
  • Volume: of the object within which the needle is inserted

The new names reflect these roles and signify that the links are formed between the algorithm and BaseGeometry components.

3. Renamed Operations functions and proximity objects

Following the same logic, all the function pointers instantiated from the Operations namespace have been renamed to clearly indicate:

  • The type of operation
  • The geometry it is applied to
  • The type of proximity returned (tip, shaft, surface, volume)

Minor changes

  • Renamed threshold variables related to:
    • Puncture force (punctureThreshold)
    • The tip advancing inside the volume (tipDistThreshold)
  • Removed commented-out variables and overused sofa:: namespace qualifiers
  • Simplified verbose template syntax with typedef for re-used multi-argument types
  • Renamed variables for the draw function, made points transparent and drawing is disabled by default
  • Grouped variable definitions by type and functionality
  • Simplified pointer validity checks
  • Code formatting using .clang-format shipped with main SOFA

th-skam added 16 commits July 30, 2025 13:39
[scene] Changed scenes accordingly

    * Signify that the link is directed at a Geometry object
    * For the needle, the name signifies whether the Geometry refers to the tip or the shaft
    * For the punctured volume, the name signifies whether the Geometry will be used for:
        1. the puncture and, thus, only the surface is of interest or
        2. the insertion and, thus, the volume is now of interest
    * The user should not care whether puncture/insertion happens "from" the
      needle to the "destination" surface/volume. The user should be concerned
      with appropriately defining the tip and shaft geometry as well as the
      geometries of the punctured volumes and surfaces.
@th-skam th-skam self-assigned this Jul 30, 2025
@th-skam th-skam mentioned this pull request Jul 30, 2025
6 tasks
Not really needed
@epernod epernod merged commit 68a00b9 into master Aug 4, 2025
@epernod epernod deleted the algo-cleanup branch August 4, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants