33
44def createScene (rootNode ):
55
6- rootNode .addObject ('RequiredPlugin' , pluginName = 'BeamAdapter SofaMeshCollision SofaBoundaryCondition SofaConstraint SofaMiscCollision SofaDeformable SofaGeneralLinearSolver SofaImplicitOdeSolver' )
6+ rootNode .addObject ('RequiredPlugin' , name = "plug1" , pluginName = 'BeamAdapter Sofa.Component.Constraint.Projective Sofa.Component.LinearSolver.Direct Sofa.Component.ODESolver.Backward Sofa.Component.StateContainer Sofa.Component.Topology.Container.Constant Sofa.Component.Topology.Container.Grid Sofa.Component.Visual Sofa.Component.SolidMechanics.Spring Sofa.Component.Topology.Container.Dynamic' )
7+ rootNode .addObject ('RequiredPlugin' , name = "plug2" , pluginName = 'Sofa.Component.AnimationLoop Sofa.Component.Collision.Detection.Algorithm Sofa.Component.Collision.Detection.Intersection Sofa.Component.Collision.Geometry Sofa.Component.Collision.Response.Contact Sofa.Component.Constraint.Lagrangian.Correction Sofa.Component.Constraint.Lagrangian.Solver Sofa.Component.IO.Mesh' )
78 rootNode .addObject ('VisualStyle' , displayFlags = 'hideVisualModels hideBehaviorModels showCollisionModels hideMappings showInteractionForceFields' )
89
910 rootNode .addObject ('FreeMotionAnimationLoop' )
1011 rootNode .addObject ('DefaultVisualManagerLoop' )
1112
1213 rootNode .addObject ('LCPConstraintSolver' , mu = '0.1' , tolerance = '1e-10' , maxIt = '1000' , build_lcp = 'false' )
13- rootNode .addObject ('DefaultPipeline ' , draw = '0' , depth = '6' , verbose = '1' )
14+ rootNode .addObject ('CollisionPipeline ' , draw = '0' , depth = '6' , verbose = '1' )
1415 rootNode .addObject ('BruteForceBroadPhase' , name = 'N2' )
1516 rootNode .addObject ('BVHNarrowPhase' )
16- rootNode .addObject ('LocalMinDistance' , contactDistance = '1' , alarmDistance = '5 ' , name = 'localmindistance' , angleCone = '0.02 ' )
17- rootNode .addObject ('DefaultContactManager ' , name = 'Response' , response = 'FrictionContactConstraint' )
17+ rootNode .addObject ('LocalMinDistance' , contactDistance = '0. 1' , alarmDistance = '2 ' , name = 'localmindistance' , angleCone = '0.2 ' )
18+ rootNode .addObject ('CollisionResponse ' , name = 'Response' , response = 'FrictionContactConstraint' )
1819
1920 topoLines = rootNode .addChild ('EdgeTopology' )
20- topoLines .addObject ('WireRestShape' , name = 'BeamRestShape' ,
21- straightLength = 980.0 , length = 1000.0 ,
22- numEdges = 200 , youngModulus = 20000 ,
23- spireDiameter = 25 , numEdgesCollis = [50 ,10 ],
24- printLog = True , template = 'Rigid3d' , spireHeight = 0.0 ,
25- densityOfBeams = [30 ,5 ], youngModulusExtremity = 20000 )
21+ topoLines .addObject ('RodStraightSection' , name = 'StraightSection' ,
22+ length = 980.0 , radius = 1 ,
23+ nbEdgesCollis = 50 , nbEdgesVisu = 200 ,
24+ youngModulus = 20000 , massDensity = 0.1 , poissonRatio = 0.3 )
25+
26+ topoLines .addObject ('RodSpireSection' , name = 'SpireSection' ,
27+ length = 20.0 , radius = 1 ,
28+ nbEdgesCollis = 10 , nbEdgesVisu = 200 ,
29+ spireDiameter = 25 , spireHeight = 0 ,
30+ youngModulus = 20000 , massDensity = 0.1 , poissonRatio = 0.3 )
31+ topoLines .addObject ('WireRestShape' , name = 'BeamRestShape' , template = "Rigid3d" ,
32+ wireMaterials = "@StraightSection @SpireSection" )
33+
2634 topoLines .addObject ('EdgeSetTopologyContainer' , name = 'meshLines' )
2735 topoLines .addObject ('EdgeSetTopologyModifier' , name = 'Modifier' )
2836 topoLines .addObject ('EdgeSetGeometryAlgorithms' , name = 'GeomAlgo' , template = 'Rigid3d' )
2937 topoLines .addObject ('MechanicalObject' , name = 'dofTopo2' , template = 'Rigid3d' )
3038
3139
40+
3241 BeamMechanics = rootNode .addChild ('BeamModel' )
3342 BeamMechanics .addObject ('EulerImplicitSolver' , rayleighStiffness = 0.2 , rayleighMass = 0.1 )
3443 BeamMechanics .addObject ('BTDLinearSolver' , verification = False , subpartSolve = False , verbose = False )
@@ -45,7 +54,7 @@ def createScene(rootNode):
4554 rotationInstrument = [0 , 0 , 0 ], step = 5. , speed = 5. ,
4655 listening = True , controlledInstrument = 0 )
4756 BeamMechanics .addObject ('LinearSolverConstraintCorrection' , wire_optimization = 'true' , printLog = False )
48- BeamMechanics .addObject ('FixedConstraint ' , indices = 0 , name = 'FixedConstraint' )
57+ BeamMechanics .addObject ('FixedProjectiveConstraint ' , indices = 0 , name = 'FixedConstraint' )
4958 BeamMechanics .addObject ('RestShapeSpringsForceField' , points = '@DeployController.indexFirstNode' , angularStiffness = 1e8 , stiffness = 1e8 )
5059
5160
0 commit comments