Skip to content

Commit e3efac2

Browse files
Lucas-TJLucas Burel
andauthored
[Example] Move Shell.Adaptivity's scenes to extension folder (SofaDefrost#16)
* transfert ShellAdaptivity's scenes to his dedicated folder * Transfert Shell.Adaptivity's scenes * Delete examples/xml/cutting2.scn * Delete examples/xml/Test2DAdapter.scn * Delete examples/xml/cutting.scn --------- Co-authored-by: Lucas Burel <lucas.burel@inria.fr>
1 parent 2b03750 commit e3efac2

File tree

3 files changed

+297
-0
lines changed

3 files changed

+297
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0"?>
2+
<Node name="Root">
3+
<VisualStyle displayFlags="showWireframe showBehavior" />
4+
<AdaptiveCuttingSetting button="Left" />
5+
6+
<CollisionPipeline verbose="0" />
7+
<BruteForceDetection name="N2" />
8+
<CollisionResponse response="default" />
9+
<MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" />
10+
<CollisionGroup />
11+
12+
<Node>
13+
<MeshObjLoader name="mesh" filename="../mesh/plane2048-noise.obj"/>
14+
<TriangleSetTopologyContainer name="points" src="@mesh" />
15+
16+
<!-- Used for mouse tracking
17+
TODO: need to pass MO to the adapter for so that the distances are computed properly
18+
<Node name="original">
19+
<TriangleSetTopologyContainer name="points" src="@../mesh" />
20+
<MechanicalObject template="Vec3d" name="MO_orig" rest_position="@mesh.position" />
21+
<Triangle />
22+
<Node name="Render">
23+
<OglModel name="Visual" color="gray"/>
24+
<IdentityMapping input="@.." output="@Visual"/>
25+
</Node>
26+
</Node>
27+
-->
28+
29+
<TriangleSetTopologyModifier />
30+
<TriangleSetTopologyAlgorithms />
31+
<TriangleSetGeometryAlgorithms />
32+
33+
<!--
34+
-->
35+
<Test2DAdapter template="Vec3d" name="adapter" sigma="1e-5" />
36+
<MechanicalObject template="Vec3d" name="MO" rest_position="@mesh.position" />
37+
38+
<Triangle />
39+
<!--
40+
-->
41+
42+
<Node name="Data">
43+
<DataDisplay cellData="@../adapter.functionals" colorNaN="1 0 1 1" />
44+
<ColorMap colorScheme="Green" />
45+
<IdentityMapping input="@.." output="@."/>
46+
</Node>
47+
<!--
48+
-->
49+
50+
<Node name="Render">
51+
<OglModel name="Visual" color="black" depthTest="false" />
52+
<IdentityMapping input="@.." output="@Visual"/>
53+
</Node>
54+
55+
56+
57+
</Node>
58+
59+
</Node>
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<?xml version="1.0"?>
2+
<Node name="Root" gravity="0 0 0" >
3+
4+
<Node name="plugins">
5+
<RequiredPlugin name="Shell"/>
6+
<RequiredPlugin name="Sofa.Component.AnimationLoop"/> <!-- Needed to use components [FreeMotionAnimationLoop] -->
7+
<RequiredPlugin name="Sofa.Component.Collision.Detection.Algorithm"/> <!-- Needed to use components [BVHNarrowPhase,BruteForceBroadPhase,BruteForceDetection,CollisionPipeline] -->
8+
<RequiredPlugin name="Sofa.Component.Collision.Detection.Intersection"/> <!-- Needed to use components [MinProximityIntersection] -->
9+
<RequiredPlugin name="Sofa.Component.Collision.Response.Contact"/> <!-- Needed to use components [CollisionResponse] -->
10+
<RequiredPlugin name="Sofa.Component.Constraint.Lagrangian.Solver"/> <!-- Needed to use components [LCPConstraintSolver] -->
11+
<RequiredPlugin name="Sofa.Component.Constraint.Projective"/> <!-- Needed to use components [FixedProjectiveConstraint] -->
12+
<RequiredPlugin name="Sofa.Component.Engine.Transform"/> <!-- Needed to use components [TransformEngine] -->
13+
<RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [CGLinearSolver] -->
14+
<RequiredPlugin name="Sofa.Component.Mapping.Linear"/> <!-- Needed to use components [IdentityMapping] -->
15+
<RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [UniformMass] -->
16+
<RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
17+
<RequiredPlugin name="Sofa.GL.Component.Rendering2D"/> <!-- Needed to use components [OglColorMap] -->
18+
<RequiredPlugin name="Sofa.Component.SceneUtility"/> <!-- Needed to use components [InfoComponent] -->
19+
<RequiredPlugin name="Sofa.Component.SolidMechanics.FEM.Elastic"/> <!-- Needed to use components [TriangularFEMForceField] -->
20+
<RequiredPlugin name="Sofa.Component.SolidMechanics.Spring"/> <!-- Needed to use components [RestShapeSpringsForceField] -->
21+
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
22+
<RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [TriangleSetGeometryAlgorithms,TriangleSetTopologyContainer,TriangleSetTopologyModifier] -->
23+
<RequiredPlugin name="Sofa.Component.Collision.Geometry"/> <!-- Needed to use components [TriangleCollisionModel] -->
24+
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
25+
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [DataDisplay,OglModel] -->
26+
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
27+
</Node>
28+
29+
<DefaultAnimationLoop/>
30+
<!--FreeMotionAnimationLoop/--> <!-- Je ne sais pas pourquoi mais lorsque j'utilise FreeMotionAnimationLoop, l'animation ne fonction plus...
31+
Alors que je souhaite utiliser FreeMotionAnimationLoop pour que ça soit plus réaliste que DefaultAnimationLoop-->
32+
<!--LCPConstraintSolver tolerance="1e-3" maxIt="1000"/-->
33+
<VisualStyle displayFlags="showBehavior" />
34+
<!--<AdaptiveCuttingSetting button="Left" /-->
35+
36+
<CollisionPipeline verbose="0"/>
37+
<BruteForceBroadPhase name="N2" />
38+
<BVHNarrowPhase/>
39+
<MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" />
40+
<CollisionResponse name="Response" response="PenaltyContactForceField" />
41+
42+
<Node name="points">
43+
<MechanicalObject template="Vec3d" name="fixedPoints"
44+
position="-1.2 -1 0 -1.2 1 0"
45+
showObject="true" />
46+
<FixedProjectiveConstraint indices="0 1" />
47+
</Node>
48+
49+
<Node name="Mesh">
50+
51+
<EulerImplicitSolver rayleighMass="1" rayleighStiffness="1" />
52+
<CGLinearSolver iterations="100" tolerance="1e-15" threshold="1e-15"/>
53+
54+
<MeshOBJLoader name="mesh" filename="../../mesh/plane128.obj"/>
55+
<TriangleSetTopologyContainer name="topo" src="@mesh" />
56+
57+
<MechanicalObject template="Vec3d" name="MO" />
58+
<UniformMass totalMass="0.1" />
59+
60+
<AdaptiveCuttingController template="Vec3d" />
61+
<Test2DAdapter template="Vec3d" name="adapter" sigma="1e-5" />
62+
63+
<TriangleSetTopologyModifier />
64+
<!--<TriangleSetTopologyContainer />-->
65+
<TriangleSetGeometryAlgorithms />
66+
67+
<FixedProjectiveConstraint indices="0 1" />
68+
69+
<RestShapeSpringsForceField name="Springs" external_rest_shape="@../points/fixedPoints"
70+
points="2 3"
71+
external_points="1 0"
72+
stiffness="50000"
73+
angularStiffness="50000" />
74+
75+
76+
<TriangularFEMForceField name="FEM" youngModulus="5000" poissonRatio="0.3" method="large" />
77+
78+
<!--
79+
<Point />
80+
<Line />
81+
-->
82+
<TriangleCollisionModel />
83+
84+
<Node name="Render">
85+
<OglModel name="Visual" color="#90EE90"/>
86+
<IdentityMapping input="@.." output="@Visual"/>
87+
</Node>
88+
89+
<Node name="Render wire">
90+
<VisualStyle displayFlags="showWireframe" />
91+
<OglModel name="Visual" color="#BC8F8F" depthTest="false" />
92+
<IdentityMapping input="@.." output="@Visual"/>
93+
</Node>
94+
95+
96+
97+
<Node name="Rest state">
98+
<TriangleSetTopologyContainer name="topo" points="@../topo.points" edges="@../topo.edges" triangles="@../topo.triangles" />
99+
<TransformEngine name="transform" template="Vec3d" translation="2.5 0 0" input_position="@../MO.rest_position" />
100+
<MechanicalObject template="Vec3d" rest_position="@transform.output_position" position="@transform.output_position" />
101+
102+
<Node name="Data">
103+
<DataDisplay cellData="@../../adapter.functionals" />
104+
<OglColorMap colorScheme="Green" />
105+
<IdentityMapping input="@.." output="@."/>
106+
</Node>
107+
108+
<!--
109+
<Node name="Render wire">
110+
<VisualStyle displayFlags="showWireframe" />
111+
<OglModel name="Visual" color="white" depthTest="false" />
112+
<IdentityMapping input="@.." output="@Visual"/>
113+
</Node>
114+
-->
115+
</Node>
116+
<!--
117+
-->
118+
119+
120+
</Node>
121+
</Node>
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<?xml version="1.0"?>
2+
<Node name="Root" gravity="0 0 0" >
3+
<VisualStyle displayFlags="showVisual" />
4+
<AdaptiveCuttingSetting button="Left" />
5+
6+
<CollisionPipeline verbose="0" />
7+
<BruteForceDetection name="N2" />
8+
<CollisionResponse response="default" />
9+
<MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" />
10+
<CollisionGroup />
11+
12+
<Node name="points">
13+
<MechanicalObject template="Vec3d" name="fixedPoints"
14+
position="-1.2 -1 0 -1.2 1 0"
15+
showObject="true" />
16+
<FixedConstraint indices="0 1" />
17+
</Node>
18+
19+
<Node name="Base">
20+
<RegularGridTopology name="topo" template="Vec3d"
21+
min="-1 -1 0"
22+
max=" 1 1 0"
23+
n="10 10 1" />
24+
</Node>
25+
26+
<Node name="Fine">
27+
<RegularGridTopology name="topo" template="Vec3d"
28+
min="-1 -1 0"
29+
max=" 1 1 0"
30+
n="20 20 1" />
31+
</Node>
32+
33+
<Node>
34+
35+
<EulerImplicitSolver rayleighMass="1" rayleighStiffness="1" />
36+
<CGLinearSolver iterations="100" tolerance="1e-15" threshold="1e-15"/>
37+
38+
<TriangleSetTopologyModifier />
39+
<TriangleSetTopologyAlgorithms />
40+
<TriangleSetGeometryAlgorithms />
41+
42+
<!--
43+
<MeshObjLoader name="mesh" filename="../mesh/plane128.obj"/>
44+
<TriangleSetTopologyContainer name="topo" src="@mesh" />
45+
-->
46+
<TriangleSetTopologyContainer name="topo" />
47+
<Quad2TriangleTopologicalMapping input="@/Base/topo" output="@topo" />
48+
49+
<MechanicalObject template="Vec3d" name="MO" />
50+
<UniformMass mass="0.1" />
51+
52+
<Test2DAdapter template="Vec3d" name="adapter" sigma="1e-5"
53+
projectedPoints="@/Fine/topo.position" />
54+
<!-- />-->
55+
<AdaptiveCuttingController template="Vec3d" />
56+
57+
<!-- Match corners -->
58+
<BoxROI name="box1" box="0.99 -1.01 -0.01 1.01 -0.99 0.01" />
59+
<BoxROI name="box2" box="0.99 0.99 -0.01 1.01 1.01 0.01" />
60+
<BoxROI name="box3" box="-1.01 -1.01 -0.01 -0.99 -0.99 0.01" />
61+
<BoxROI name="box4" box="-1.01 0.99 -0.01 -0.99 1.01 0.01" />
62+
63+
<FixedConstraint indices="@box1.indices" />
64+
<FixedConstraint indices="@box2.indices" />
65+
66+
<RestShapeSpringsForceField name="Springs" external_rest_shape="../points/fixedPoints"
67+
points="@box3.indices"
68+
external_points="0"
69+
stiffness="50000"
70+
angularStiffness="50000" />
71+
<RestShapeSpringsForceField name="Springs" external_rest_shape="../points/fixedPoints"
72+
points="@box4.indices"
73+
external_points="1"
74+
stiffness="50000"
75+
angularStiffness="50000" />
76+
77+
78+
<TriangularFEMForceField name="FEM" youngModulus="5000" poissonRatio="0.3" method="large" />
79+
80+
<!--
81+
<Point />
82+
<Line />
83+
-->
84+
<Triangle />
85+
86+
<!--
87+
<Node name="Render">
88+
<OglModel name="Visual" color="#90EE90"/>
89+
<IdentityMapping input="@.." output="@Visual"/>
90+
</Node>
91+
-->
92+
93+
<Node name="Mapping">
94+
<RegularGridTopology src="@/Fine/topo" />
95+
<MechanicalObject name="MO" template="Vec3d" />
96+
<ExternalInterpolationMapping
97+
InterpolationIndices="@../adapter.interpolationIndices"
98+
InterpolationValues="@../adapter.interpolationValues" />
99+
<Node name="Render">
100+
<OglModel name="Visual" color="#BC0F0F" depthTest="false" />
101+
<IdentityMapping input="@.." output="@Visual"/>
102+
</Node>
103+
</Node>
104+
<!--
105+
-->
106+
107+
108+
109+
110+
<Node name="Render wire">
111+
<VisualStyle displayFlags="showWireframe" />
112+
<OglModel name="Visual" color="#BC8F8F" depthTest="false" />
113+
<IdentityMapping input="@.." output="@Visual"/>
114+
</Node>
115+
116+
</Node>
117+
</Node>

0 commit comments

Comments
 (0)