SofaAPAPI-Unity3D [Plugin v1.1] // [Plugin v2.0]

Release date: 2020-08-13

Both releases have the same enhancements and fixes based on v1.0, but they are based on different version of SOFA physics engine:

– SofaAPAPI-Unity3D Plugin v1.1 is based on a custom version of the SOFA Release v19.12 with some fixes in Geomagic plugin (included in v20.06).
– SofaAPAPI-Unity3D Plugin v2.0 is based on SOFA Release v20.06.

Enhancements

Fixes

  • Core enhancements:
    • Add: Methods to compute UV texture mapping for SOFA visual models.
    • Add: Several Materials and shaders for double side materials and highlighted rendering.
    • Add: Support for non 3D mesh: 1D, 2D and Rigids.
    • Add: Mechanism to propagate key events from Unity to SOFA.
    • Add: Methods to get SOFA simulation FPS.
    • Add: Liver interaction scene with HD mesh resolution.
    • Improve: License checking mechanism.

  • Plugins Enhancements:
    • [Geomagic] Multiple tools simulation is now supported.
    • [Beam Adapter] plugin is now supported.
    • [Electrophysiology] and Heat reaction-diffussion simulation are now supported.
  • Major bug fix:
    • Fix: Several issues in the factory while creating Simulation Node or Primitives objects.
    • Fix: Factory was not registering new components when new SOFA plugins were loaded.
    • Fix: Scene build and export.
    • Fix: SOFA Sphere collision models mapped on Unity object.
    • [Geomagic] Fix: initialisation of the tools at start.

  • Other bug Fix:
    • Fix: Beam UV mapping computation.
    • Fix: basic primitive object creation (Cube, Sphere, Cylidner and plan) as rigid or deformable objects.
    • Fix: LiverInteraction demo scene.

Know bugs

Limitations

  • [Multi-threading] asset has been disabled.
  • ParticlesModel max number of particles can’t be increased during simulation.
  • SofaVR_API and VR SofaPlayer curved interfaced have been disabled.
  • Texture interpolation has been temporary disabled.
  • Mesh interaction in Unity3D is only working on triangulation.
  • It is not possible to create components directly in Unity3D hierarchy interface and then change its type.
    Only a few set of components are handled. See graph edition
  • It is only possible to set Data value, not to link them between components inside Unity3D.
  • Quad and Hexahedron topology are not yet supported.
  • Building Unity App will copy all SofaUnity scenes and resources. Not only the targeted one.

SofaAPAPI-Unity3D Plugin v1.0

Release date: 2020-04-16
SofaAPAPI-Unity3D Plugin v1.0 is based on SOFA Release v19.12.

Enhancements

Fixes

  • Major enhancements:
    • SofaAPAPI-Unity3D API has been fully rewritten. It is now recreating the SOFA simulation graph at the component level in Unity3D instead of a higher Object level. 10 different categories of component have been isolated and specialized. All the other components are created using a generic interface. SOFA DAG Node hierarchy is also recreated in Unity scene hierarchy. See scene parsing.
    • SOFA component Data are now serialized in Unity3D. Allowing a cleaner save and reload of projects. See Object creation
    • Creation of SofaPrimitiveObject or SofaObject are fully parsed and converted into SofaDAGNode and SofaComponents
    • Multi-model representation of 3D object can be reproduced like in SOFA gui implementation. Info here
  • Other Enhancements:
    • Add: Mechanism to manually add new plugin dll directly from the interface.
    • Add: [SOFA SPH] fluid simulation using specific SofaUnity components.
    • Add: [SOFA Beam] simulation using specific SofaUnity components.
    • Add: Point and Edge topology support.
    • Add: Possibility to apply a Transform in SOFA 3D space directly inside a SofaDAGNode inspector.
  • Major bug fix:
    • Fix: Multiple GameObjects are are now fully serialized avoiding tricky behavior between editor and player.
    • Fix: Reloading of Simulation Graph (reloading scene or recreating root node).
    • Fix: Gravity and timestep from SOFA scene file is now correctly used.
    • Fix: Sofa.ini file is updated automatically with correct paths at install.


  • Other bug Fix:
    • Fix: Possible wrong refinement when creating sphere collision on top of Unity3D object.
    • Fix: SofaRayCaster parameters like ray length or stiffness is now correctly updated on SOFA side.
    • Fix: SOFA logs handling.

Know bugs

Limitations

  • [Multi-threading] asset has been disabled.
  • ParticlesModel max number of particles can’t be increased during simulation.
  • SofaVR_API and VR SofaPlayer curved interfaced have been disabled.
  • Texture interpolation has been temporary disabled.
  • SceneInfo and SofaObjectInfo scripts have been disabled.
  • The interaction with the mesh in the Unity 3D view is not working perfectly.
  • It is not possible to create components directly in Unity3D hierarchy interface and then change its type.
    Only a few set of components are handled. See graph edition
  • It is only possible to set Data value, not to link them between components inside Unity3D.
  • Quad and Hexahedron topology are not yet supported.
  • Building Unity App will copy all SofaUnity scenes and resources. Not only the targeted one.

Sofa-Unity Plugin v0.4

Last release update date: 2019-09-13

Enhancements

Fixes

2019-09-13: Release update v0.4.3

  • Major enhancements:
  • Other Enhancements:
    • Add: SceneInfo scripts to log simulation information: fps, number of vertices and triangles per model.
    • Update: Improve SOFA plugin messsage loading logs.
    • Update: Correct all SOFA scene files to not produce warnings at start.
  • Bug Fix:
    • Fix: Bad button interaction in the ObjectController prefab.
    • Fix: Remove some false SOFA error logs.

2019-06-12: Release update v0.4.2

  • Enhancements:
    • Update: Regenerate sofa.ini file at load for the current pc. Avoid problem of resource path.
    • Add: Option to run SOFA simulation asynchronously from Unity animation loop.
    • Update: Several Unity metarials and prefabs.
  • Bug Fix:
    • Fix: Problem of mesh display when camera is too close.
    • Fix: Update several SOFA logs parsing.
    • Fix: Tetrahedron FEM mesh display.
    • Fix: Unload SOFA scene before closing Unity animation to avoid possible bad memory access.

2018-12-05: Release SofaUnity v0.4

  • Major enhancements:
    • Update: Whole code to be compatible with SOFA v18.12.
    • Add: Option in SofaContext to catch SOFA logs at simulation time.
  • Improve LiverInteraction demo:
    • Update: ThirdPersonCamera.cs for better mouse trackball displacement.
    • Update: Objectcontroller.cs to offer more movement for several tools using keyboard keys.
    • Add: 3D environment around the liver with mirror and logo walls.
    • Release: Executable demo which can be downloaded here.
  • Major bug fix:
    • Fix: bad ray casting direction inside Sofa from Unity.
    • Fix: clean the main asset from other assets (Geomagic, organs, VR) to avoid missing files and dependencies in the final package.
    • Fix: clean the loadPlugin method to only add the needed one by default, fixing some scene behavior.
  • Other bug Fix:
    • Fix: Geomagic tool init and reinit (when multiple initialisation occurred) and also tool release.

2019-02-12: Release update v0.4.1

  • Major enhancements:
    • Add: Support for several SOFA types for parameter exchange: Vec3, vector, vector, vector, Mat3 and string
    • Add: Security breakdown: if high velocity is detected. It is possible to use callback to unactive Unity components.
    • Add: Handling of sofa.ini file inside Unity to set Sofa resources and examples path. This fix the caduceus absolute path issue.
    • Add: New script to copy SofaUnity resources when building App with Unity.
    • Create SofaUnity additional assets regarding (see Assets Available):
      • Geomagic Haptic tool controller: Track tool position from Sofa simulation and tool buttons activation.
      • Organ models: 3D organs models, with textures and correspongin collision models as well as an example scene.
      • XRay rendering: Render X-Ray image of 3D organs from SOFA simulation.
      • VR Surgical Room: Collection of 3D models of surgical tools and devices. With textures and controller scripts.
      • VR Interaction tools: collection of script to be able to use the VR controller (Oculus or Vive) to interact with the 3D view and SOFA simulation.
  • Other enhancements:
    • Add: Bool to activate or freeze the simulation in sofaContext.
    • Add: Dictionnary to translate the error code return by SofAdvancePhysicsAPI.dll and update all the logs.
    • Add: Method: sofaLog() to automatically format info in the logs. Can be display using bool log parameter.
    • Add: New script to reverse all normals of a mesh at start.
    • Add: Method and counter to track unity life cycle.
    • Add: Option in SSphereCollision to be able to use a unique sphere position.
    • Change: SofaBaseMesh is now using Sofa componoent topology revision to detect changes.
    • Move: all object hiearchy creation into a specific class created as soon as one SObject is created.
  • Experimental Work on Multi-threading support:
    • Change: There are now 2 SofaContext update method, either sync or async updateImpl. Set to sync for the moment as async is experimental.
    • Change: Use the new sofaAdvancePhysicsAPI signature to pass the number of thread to be created at construction inside Sofa.
    • Change: SObject and SRayCaster register themself inside the hiearchy to be able to run Async update.
  • Major bug fix:
    • Fix: bad ray casting direction inside Sofa from Unity.
    • Fix: clean the main asset from other assets (Geomagic, organs, VR) to avoid missing files and dependencies in the final package.
    • Fix: clean the loadPlugin method to only add the needed one by default, fixing some scene behavior.
  • Other bug Fix:
    • Fix: Geomagic tool init and reinit (when multiple initialisation occurred) and also tool release.

Know bugs

Limitations

  • Will be updated by feedbacks.
  • Not possible to interact with mesh in the Unity 3D view.
  • Need to manullay set the Sofa plugin required. Doesn’t parse the requiredplugin attribute.
  • Building Unity App copy all SofaUnity resources and not only the one used.
  • Only some FEM can be control inside Unity Editor.

Sofa-Unity Plugin v0.3

Release date: 2018-03-12

Enhancements

Fixes

    • Add Sphere Collision script that map sphere collision model on a Unity Mesh filter.
    • Add SComponentObject that is linked to a SofaComponentListener. It allows to listen to all Sofa Data of the target component.
    • Add a 2DTexture Raw component that allows to display a texture from raw data coming from Sofa.
    • Add new demo scenes: Christmas and tissue_fall.

 

  • Improve the communication of Data of basic type: Bool, float, int, vector3, vector3, vector, vector and string.
  • Improve the update rate: Only call simulation step every dt, like a fix update based on the dt. Update all component at the same rate.
  • Improve the copy of mesh positions by using sparse vector with only vertices that have changed.
  • Improve the cutting with ray. Delete now a zone instead of only one tetra.
  • Disable the mesh rendering of Deformable or Rigid mesh by default. Only update the component if rendering is activated.
  • Major bug on the sofa object hierarchy creation.
  • Major bug on memory leak. The sofa plugin was not well released when ending the simulation.
  • Error Data listening that were not present in sofa objects.
  • Bug of scale between unity and sofa that was messing up the ray casting for example.

Know bugs

Limitations

  • Parameters set in the components GUI are replaced by sofa scene file value after runtime.
  • Cylinder shape has holes.
  • Changing Grid resolution doesn’t work.
  • Display of Tetrahedron FEM slow down the application.
  • All Sofa scene loaded by SofaContext needs to have relative paths to the meshes.
  • Not possible to interact with mesh in the Unity 3D view.
  • Only some FEM can be control inside Unity Editor.

Sofa-Unity Plugin v0.2

Release date: 2017-11-14

Enhancements

Fixes

  • Add: Support of topology changes.
  • Add: VR support and demo of SOFA in VR.
  • Upgrade: All materials with right normal maps.
  • Add: Ray casting methods to interact with Sofa 3D models. Possible interactions: element resections, vertex grasping and fix constraint.
  • Add: Springs support in Unity Editor.
  • Major bug of performance: Reduce by 4 the simulation cost in Unity.
  • Bug of bad texture coordinate computation.
  • Material of all the demo scenes.
  • Bug of FEM parameters not found.
  • Constrain value ranges for FEM and springs parameters.

Know bugs

Limitations

  • Cylinder shape has holes.
  • Changing Grid resolution doesn’t work.
  • Display of Tetrahedron FEM slow down the application.
  • All Sofa scene loaded by SofaContext needs to have relative paths to the meshes.
  • Not possible to interact with mesh in the Unity 3D view.
  • Only some FEM can be control inside Unity Editor.

Sofa-Unity Plugin v0.1

Release date: 2017-08-03

Enhancements

Fixes

  • No logs as it is the first version
  • No logs as it is the first version

Know bugs

Limitations

  • Cylinder shape has holes.
  • Changing Grid resolution doesn’t work.
  • Display of Tetrahedron FEM slow down the application.
  • All Sofa scene loaded by SofaContext needs to have relative paths to meshes.
  • Not possible to interact with mesh in the Unity 3D view.
  • Only TriangularFEM and TetrahedronFEM forcefield bindings are handled.