Cutting a cloth under stress #3161
-
I was seeing the |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 8 replies
-
Hi @sin3point14 welcome on the SOFA forum! Do you want to do something like this: <?xml version="1.0"?>
<Node name="root" dt="0.05" showBoundingTree="0" gravity="0 -0 0">
<RequiredPlugin name="Sofa.Component.Collision.Detection.Algorithm"/> <!-- Needed to use components [BVHNarrowPhase BruteForceBroadPhase DefaultPipeline] -->
<RequiredPlugin name="Sofa.Component.Collision.Detection.Intersection"/> <!-- Needed to use components [MinProximityIntersection] -->
<RequiredPlugin name="Sofa.Component.Collision.Geometry"/> <!-- Needed to use components [TriangleCollisionModel] -->
<RequiredPlugin name="Sofa.Component.Collision.Response.Contact"/> <!-- Needed to use components [DefaultContactManager] -->
<RequiredPlugin name="Sofa.Component.Constraint.Projective"/> <!-- Needed to use components [FixedConstraint] -->
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
<RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [CGLinearSolver] -->
<RequiredPlugin name="Sofa.Component.Mapping.Linear"/> <!-- Needed to use components [IdentityMapping] -->
<RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [DiagonalMass] -->
<RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
<RequiredPlugin name="Sofa.Component.SolidMechanics.FEM.Elastic"/> <!-- Needed to use components [TriangularFEMForceField] -->
<RequiredPlugin name="Sofa.Component.SolidMechanics.Spring"/> <!-- Needed to use components [TriangularBendingSprings] -->
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [TriangleSetGeometryAlgorithms TriangleSetTopologyContainer TriangleSetTopologyModifier] -->
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
<VisualStyle displayFlags="showVisual showBehaviorModels" />
<DefaultPipeline verbose="0" />
<BruteForceBroadPhase/>
<BVHNarrowPhase/>
<DefaultContactManager response="PenalityContactForceField" />
<MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" />
<Node name="SquareGravity">
<EulerImplicitSolver name="cg_odesolver" printLog="false" rayleighStiffness="0.1" rayleighMass="0.1" />
<CGLinearSolver iterations="25" name="linear solver" tolerance="1.0e-9" threshold="1.0e-9" />
<MeshOBJLoader name="meshLoader" filename="mesh/square_2594_triangles.obj" scale="10" createSubelements="true" />
<TriangleSetTopologyContainer name="Container" src="@meshLoader"/>
<TriangleSetTopologyModifier name="Modifier" />
<TriangleSetGeometryAlgorithms name="GeomAlgo" template="Vec3d" />
<MechanicalObject name="Mo"/>
<DiagonalMass massDensity="0.08" />
<FixedConstraint indices="617 618 57 1301 1302 49" />
<TriangularFEMForceField name="FEM" youngModulus="60" poissonRatio="0.3" method="large" />
<TriangularBendingSprings name="FEM-Bend" stiffness="300" damping="1.0" />
<TriangleCollisionModel />
<ConstantForceField indices="621" force="-800 -800 0" showArrowSize="0.1"/>
<ConstantForceField indices="1360" force="800 -800 0" showArrowSize="0.1"/>
<Node >
<OglModel name="Visual" texcoords="@../meshLoader.texcoords" texturename="textures/colorMap.png" />
<IdentityMapping input="@.." output="@Visual" />
</Node>
</Node>
</Node>
``` |
Beta Was this translation helpful? Give feedback.
-
Hi @sin3point14 A first important point is that the so-called "rest shape" of an object is the reference shape (the positions) of this object when it is undergoing NO force. This rest state is not supposed to change during the simulation. To create the tension you are looking for, you can avoid applying forces as I did, but you can instead impose a motion of some vertices (e.g. border vertices). You can for instance take a look at the LinearMovementConstraint. Regarding the need to use both
Finally, the issue with video recording (VideoRecorderFFMPEG) looks strange : do you have indeed a video exported at the given path Hugo |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for your explanations! I am trying to integrate this with a geomagic touch haptic device. The cloth is deforming as expected but I can't feel any force feedback. Can you please check the scenes, I can't really figure out the issue as I am basing this of work someone else had done earlier and I'm pretty new to sofa
For the ffmpeg issue, I don't have access to that system right now, but afair there was no video file generated there. |
Beta Was this translation helpful? Give feedback.
-
For the stress-based incision, I've calculated the triangle of maximum principal stress and want to insert a cut in the direction perpendicular to the principal stress. However, since the cloth is wobbling in 3 dimensions, how can I calculate 2 points:
Also, I'm using @hugtalbot @epernod any advice? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
The idea is to compute all your position switching from the 3D world coordinates to the local frame of your triangles.
I.e:
In fact the pipeline I just described is used in the Tearing plugin which looks like what you want to do: https://github.com/InfinyTech3D/Tearing
It is implemented somewhere here: https://github.com/InfinyTech3D/Tearing/blob/eba7b4f25cfec15b3d733be2511886b0799dda36/src/Tearing/TearingAlgorithms.inl#L54
Let…