Skip to content

Commit 5a25cb3

Browse files
committed
test
1 parent e3efac2 commit 5a25cb3

437 files changed

Lines changed: 1580008 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
def createScene(rootNode):
2+
3+
4+
rootNode.addObject('RequiredPlugin', name="Shell")
5+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.Constraint.Projective') # Needed to use components [FixedProjectiveConstraint]
6+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.Engine.Select') # Needed to use components [BoxROI]
7+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.IO.Mesh') # Needed to use components [MeshOBJLoader]
8+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.LinearSolver.Direct') # Needed to use components [SparseLDLSolver]
9+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.Mapping.Linear') # Needed to use components [IdentityMapping]
10+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.Mass') # Needed to use components [UniformMass]
11+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.ODESolver.Backward') # Needed to use components [EulerImplicitSolver]
12+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.StateContainer') # Needed to use components [MechanicalObject]
13+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.Topology.Container.Constant') # Needed to use components [MeshTopology]
14+
rootNode.addObject('RequiredPlugin', name='Sofa.GL.Component.Rendering3D') # Needed to use components [OglModel]
15+
rootNode.addObject('RequiredPlugin', name='Sofa.GUI.Component') # Needed to use components [AttachBodyButtonSetting]
16+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.AnimationLoop') # Needed to use components [FreeMotionAnimationLoop]
17+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.Constraint.Lagrangian.Correction') # Needed to use components [GenericConstraintCorrection]
18+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.Constraint.Lagrangian.Solver') # Needed to use components [GenericConstraintSolver]
19+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.Engine.Generate') # Needed to use components [NormalsFromPoints]
20+
rootNode.gravity = [0, -98.1, 0]
21+
rootNode.addObject('AttachBodyButtonSetting', stiffness=0.1)
22+
rootNode.addObject('FreeMotionAnimationLoop')
23+
rootNode.addObject('GenericConstraintSolver', maxIterations=1e3, tolerance=1e-3)
24+
25+
square = rootNode.addChild('Square')
26+
square.addObject('EulerImplicitSolver')
27+
square.addObject('SparseLDLSolver')
28+
square.addObject('GenericConstraintCorrection')
29+
square.addObject('MeshOBJLoader', filename='mesh/square1.obj')
30+
square.addObject('MeshTopology', src=square.MeshOBJLoader.getLinkPath())
31+
square.addObject('MechanicalObject', name="Object", template='Rigid3')
32+
square.addObject('NormalsFromPoints', name='NormalsFrom', position='@Object.position' )
33+
square.addObject('UniformMass', totalMass=0.005)
34+
square.addObject('BoxROI', box=[0, 0.9, -0.1, 1, 1, 0.1], drawBoxes=True)
35+
square.addObject('FixedProjectiveConstraint', indices=square.BoxROI.indices.getLinkPath())
36+
square.addObject('BezierTriangularBendingFEMForceField', youngModulus=1.7e3,
37+
poissonRatio=0.3, thickness=0.01, normals="@NormalsFrom.normals")
38+
39+
visu = square.addChild('Visu')
40+
visu.addObject('OglModel', src=square.MeshTopology.getLinkPath())
41+
visu.addObject('IdentityMapping')
42+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
def createScene(rootNode):
2+
3+
rootNode.addObject('RequiredPlugin', name="Shell")
4+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.Constraint.Projective') # Needed to use components [FixedProjectiveConstraint]
5+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.Engine.Select') # Needed to use components [BoxROI]
6+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.IO.Mesh') # Needed to use components [MeshOBJLoader]
7+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.LinearSolver.Direct') # Needed to use components [SparseLDLSolver]
8+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.Mapping.Linear') # Needed to use components [IdentityMapping]
9+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.Mass') # Needed to use components [UniformMass]
10+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.ODESolver.Backward') # Needed to use components [EulerImplicitSolver]
11+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.StateContainer') # Needed to use components [MechanicalObject]
12+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.Topology.Container.Constant') # Needed to use components [MeshTopology]
13+
rootNode.addObject('RequiredPlugin', name='Sofa.GL.Component.Rendering3D') # Needed to use components [OglModel]
14+
rootNode.addObject('RequiredPlugin', name='Sofa.GUI.Component') # Needed to use components [AttachBodyButtonSetting]
15+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.AnimationLoop') # Needed to use components [FreeMotionAnimationLoop]
16+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.Constraint.Lagrangian.Correction') # Needed to use components [GenericConstraintCorrection]
17+
rootNode.addObject('RequiredPlugin', name='Sofa.Component.Constraint.Lagrangian.Solver') # Needed to use components [GenericConstraintSolver]
18+
rootNode.gravity = [0, -98.1, 0]
19+
rootNode.addObject('AttachBodyButtonSetting', stiffness=0.1)
20+
rootNode.addObject('FreeMotionAnimationLoop')
21+
rootNode.addObject('GenericConstraintSolver', maxIterations=1e3, tolerance=1e-3)
22+
23+
square = rootNode.addChild('Square')
24+
square.addObject('EulerImplicitSolver')
25+
square.addObject('SparseLDLSolver')
26+
square.addObject('GenericConstraintCorrection')
27+
square.addObject('MeshOBJLoader', filename='mesh/square1.obj')
28+
square.addObject('MeshTopology', src=square.MeshOBJLoader.getLinkPath())
29+
square.addObject('MechanicalObject')
30+
square.addObject('UniformMass', totalMass=0.005)
31+
square.addObject('BoxROI', box=[0, 0.9, -0.1, 1, 1, 0.1], drawBoxes=True)
32+
square.addObject('FixedProjectiveConstraint', indices=square.BoxROI.indices.getLinkPath())
33+
square.addObject('CstFEMForceField', youngModulus=1.7e3,
34+
poissonRatio=0.3, thickness=0.01)
35+
36+
visu = square.addChild('Visu')
37+
visu.addObject('OglModel', src=square.MeshTopology.getLinkPath())
38+
visu.addObject('IdentityMapping')
39+

0 commit comments

Comments
 (0)