From f4a9b24d6f87a1e92028f7082d9d7694dec2cd49 Mon Sep 17 00:00:00 2001 From: Paul Baksic Date: Tue, 16 Jun 2026 17:03:28 +0200 Subject: [PATCH 1/3] Use CCD for example scene --- examples/Demos/fallingSOFA.scn | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/Demos/fallingSOFA.scn b/examples/Demos/fallingSOFA.scn index d0a35dd5fa6..776962d885f 100644 --- a/examples/Demos/fallingSOFA.scn +++ b/examples/Demos/fallingSOFA.scn @@ -47,9 +47,8 @@ - + The contact distance increases the contact distance between object, enforcing a 'skinning' behavior --> + @@ -95,7 +94,7 @@ - + - + From f558a143094e81e2a863b6be88ef22d91e2353a4 Mon Sep 17 00:00:00 2001 From: bakpaul Date: Fri, 19 Jun 2026 11:10:12 +0200 Subject: [PATCH 2/3] Remove warning and update comments --- examples/Demos/fallingSOFA.scn | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/Demos/fallingSOFA.scn b/examples/Demos/fallingSOFA.scn index 776962d885f..ff1b84569d3 100644 --- a/examples/Demos/fallingSOFA.scn +++ b/examples/Demos/fallingSOFA.scn @@ -47,8 +47,10 @@ - + Alarm distance and contact distance are key parameters: alarm distance is the distance at which the collision + detection is being performed. The contact distance increases the final distance between object, enforcing a 'skinning' behavior. + Here, because we are using CCD collision detection, the alarm distance can be set to 0--> + @@ -92,7 +94,7 @@ - From f01745f6484500327d7a2afa0c47b00afc015ea2 Mon Sep 17 00:00:00 2001 From: bakpaul Date: Fri, 19 Jun 2026 11:24:54 +0200 Subject: [PATCH 3/3] Apply changes to simple-API based example --- examples/SimpleAPI/fallingSOFA.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/SimpleAPI/fallingSOFA.cpp b/examples/SimpleAPI/fallingSOFA.cpp index 24ed0ef3b42..93d7cc7d367 100644 --- a/examples/SimpleAPI/fallingSOFA.cpp +++ b/examples/SimpleAPI/fallingSOFA.cpp @@ -57,9 +57,11 @@ sofa::simulation::Node::SPtr createScene(const sofa::simpleapi::Simulation::SPtr sofa::simpleapi::createObject(root, "CollisionResponse",{{"name","ContactManager"}, {"response","FrictionContactConstraint"}, {"responseParams","mu=0.3"}}); - sofa::simpleapi::createObject(root, "NewProximityIntersection",{{"name","Intersection"}, - {"alarmDistance","0.02"}, - {"contactDistance","0.002"}}); + sofa::simpleapi::createObject(root, "CCDTightInclusionIntersection",{{"name","CCDTightInclusionIntersection"}, + {"continuousCollisionType","FreeMotion"}, + {"maxIterations","100"}, + {"alarmDistance","0.0"}, + {"contactDistance","0.00001"}}); //Simulated Topology creation node const sofa::simulation::Node::SPtr BeamDomainFromGridTopology = sofa::simpleapi::createChild(root,"BeamDomainFromGridTopology"); @@ -83,7 +85,7 @@ sofa::simulation::Node::SPtr createScene(const sofa::simpleapi::Simulation::SPtr sofa::simpleapi::createObject(FEMechanicalModel_Surface, "TriangleSetTopologyModifier", {{"name","Modifier"}}); sofa::simpleapi::createObject(FEMechanicalModel_Surface, "Tetra2TriangleTopologicalMapping", {{"input","@../Container"}, {"output","@Container"}, {"flipNormals","false"}}); sofa::simpleapi::createObject(FEMechanicalModel_Surface, "MechanicalObject", {{"name","dofs"},{"rest_position","@../mstate.rest_position"}}); - sofa::simpleapi::createObject(FEMechanicalModel_Surface, "TriangleCollisionModel", {{"name","Collision"},{"proximity","0.001"}, {"color","0.94117647058824 0.93725490196078 0.89411764705882"}} ); + sofa::simpleapi::createObject(FEMechanicalModel_Surface, "PointCollisionModel", {{"name","Collision"}, {"color","0.94117647058824 0.93725490196078 0.89411764705882"}} ); sofa::simpleapi::createObject(FEMechanicalModel_Surface, "IdentityMapping", {{"name","SurfaceMapping"}}); const std::vector visuFiles{"mesh/SofaScene/LogoVisu.obj", "mesh/SofaScene/SVisu.obj", "mesh/SofaScene/O.obj", "mesh/SofaScene/FVisu.obj", "mesh/SofaScene/AVisu.obj"}; @@ -105,7 +107,7 @@ sofa::simulation::Node::SPtr createScene(const sofa::simpleapi::Simulation::SPtr {"position","0.2 0 -0.5 0.2 0.1 -0.5 0.3 0.1 -0.5 0.3 0 -0.5 0.2 0 -0.6 0.2 0.1 -0.6 0.3 0.1 -0.6 0.3 0 -0.6"}, {"triangles","0 2 1 0 3 2 0 1 5 0 5 4 0 4 7 0 7 3 1 2 6 1 6 5 3 7 6 3 6 2 4 5 6 4 6 7"}} ); sofa::simpleapi::createObject(Floor, "MechanicalObject", {{"template","Vec3"}}); - sofa::simpleapi::createObject(Floor, "TriangleCollisionModel", {{"name","FloorCM"}, {"proximity","0.001"}, {"moving","0"}, {"simulated","0"}} ); + sofa::simpleapi::createObject(Floor, "TriangleCollisionModel", {{"name","FloorCM"}, {"contactDistance","0.00001"}, {"moving","0"}, {"simulated","0"}} ); return root; }