-
Notifications
You must be signed in to change notification settings - Fork 299
/
AdvancedSolversMultipleGroupsSolver.scn
72 lines (70 loc) · 4.78 KB
/
AdvancedSolversMultipleGroupsSolver.scn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?xml version="1.0" ?>
<!-- See http://wiki.sofa-framework.org/wiki/TutorialCollisionMultipleGroups.scn -->
<Node name="root" dt="0.01" gravity="0 0 -9.81">
<!-- Basic Components to perform the collision detection -->
<RequiredPlugin name="Sofa.Component.Collision.Detection.Algorithm"/> <!-- Needed to use components [BVHNarrowPhase BruteForceBroadPhase CollisionPipeline] -->
<RequiredPlugin name="Sofa.Component.Collision.Detection.Intersection"/> <!-- Needed to use components [MinProximityIntersection] -->
<RequiredPlugin name="Sofa.Component.Collision.Geometry"/> <!-- Needed to use components [LineCollisionModel PointCollisionModel SphereCollisionModel TriangleCollisionModel] -->
<RequiredPlugin name="Sofa.Component.Collision.Response.Contact"/> <!-- Needed to use components [CollisionResponse] -->
<RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [CGLinearSolver] -->
<RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [UniformMass] -->
<RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
<RequiredPlugin name="Sofa.Component.SolidMechanics.Spring"/> <!-- Needed to use components [MeshSpringForceField] -->
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Constant"/> <!-- Needed to use components [MeshTopology] -->
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
<VisualStyle displayFlags="showForceFields showCollisionModels" />
<CollisionPipeline />
<BruteForceBroadPhase/>
<BVHNarrowPhase/>
<CollisionResponse />
<MinProximityIntersection alarmDistance="0.5" contactDistance="0.2" />
<DefaultAnimationLoop/>
<Node name="SolverNode">
<EulerImplicitSolver name="EulerImplicit" rayleighStiffness="0.1" rayleighMass="0.1" />
<CGLinearSolver name="CG Solver" iterations="25" tolerance="1e-5" threshold="1e-5"/>
<Node name="CubeSphere1">
<MechanicalObject name="Particles" template="Vec3" position="0 0 1 1 0 1 0 1 1 1 1 1 0 0 2 1 0 2 0 1 2 1 1 2" translation="-2 1 2" />
<MeshTopology name="Topology" hexas="0 4 6 2 1 5 7 3" />
<UniformMass name="Mass" totalMass="1" />
<MeshSpringForceField name="Springs" stiffness="100" damping="1" />
<!-- Collision Model -->
<SphereCollisionModel name="Spheres Cube1" radius="0.4" />
</Node>
<Node name="CubeSphere2">
<MechanicalObject name="Particles" template="Vec3" position="0 0 1 1 0 1 0 1 1 1 1 1 0 0 2 1 0 2 0 1 2 1 1 2" translation="0 0 6" />
<MeshTopology name="Topology" hexas="0 4 6 2 1 5 7 3" />
<UniformMass name="Mass" totalMass="1" />
<MeshSpringForceField name="Springs" stiffness="100" damping="1" />
<!-- Collision Model -->
<SphereCollisionModel name="Spheres Cube2" radius="0.4" />
</Node>
<Node name="CubeGeometry1">
<MechanicalObject name="Particles" template="Vec3" position="0 0 1 1 0 1 0 1 1 1 1 1 0 0 2 1 0 2 0 1 2 1 1 2" translation="0 1 2" />
<MeshTopology name="Topology" hexas="0 4 6 2 1 5 7 3" />
<UniformMass name="Mass" totalMass="1" />
<MeshSpringForceField name="Springs" stiffness="100" damping="1" />
<!-- Collision Models -->
<TriangleCollisionModel name="Triangles CubeGeometry1" />
<LineCollisionModel name="Lines CubeGeometry1" />
<PointCollisionModel name="Points CubeGeometry1" />
</Node>
<Node name="CubeGeometry2">
<MechanicalObject name="Particles" template="Vec3" position="0 0 1 1 0 1 0 1 1 1 1 1 0 0 2 1 0 2 0 1 2 1 1 2" translation="2 1 2" />
<MeshTopology name="Topology" hexas="0 4 6 2 1 5 7 3" />
<UniformMass name="Mass" totalMass="1" />
<MeshSpringForceField name="Springs" stiffness="100" damping="1" />
<!-- Collision Models -->
<TriangleCollisionModel name="Triangles CubeGeometry2" />
<LineCollisionModel name="Lines CubeGeometry2" />
<PointCollisionModel name="Points CubeGeometry2" />
</Node>
</Node>
<Node name="SaladBowl">
<MeshTopology name="Topology Salad Bowl" filename="mesh/SaladBowl.obj" />
<MechanicalObject name="Particles Salad Bowl" scale="10" />
<TriangleCollisionModel name="Triangles Salad Bowl" moving="0" simulated="0" />
<LineCollisionModel name="Lines Salad Bowl" moving="0" simulated="0" />
<PointCollisionModel name="Points Salad Bowl" moving="0" simulated="0" />
</Node>
</Node>