Questions about collision model #4998
-
|
Hi, I'm trying to land a plate to a fractured orbital floor. I tried to disable the tetrahedron model for the orbital floor and fix it first. However, the collision behaved a bit strange. The plate did penetrate the orbit entirely, but a close look showed that the collision model appeared to be activated at certain regions, and those regions were actually deformed (though they still penetrated the orbit model). Here are how I set up the plate and orbit model plateNode = root.addChild("plate")
# Creating the falling plateNode object
plateNode.addObject('EulerImplicitSolver', name='odesolver')
plateNode.addObject('CGLinearSolver', name='Solver', iterations=25, tolerance=1e-05, threshold=1e-05)
#tetrahedron topology
plateNode.addObject('TetrahedronSetTopologyContainer', name='topo', src=meshLoaderCoarse.getLinkPath())
plateNode.addObject('TetrahedronSetGeometryAlgorithms', template='Vec3d', name='GeomAlgo')
plateNode.addObject('MechanicalObject', template='Vec3d', name='MechanicalModel', showObject=True)
plateNode.addObject('TetrahedronFEMForceField', name='FEM', youngModulus=10000, poissonRatio=0.4, method='large')
plateNode.addObject('UncoupledConstraintCorrection', defaultCompliance=1e-9) #need for gravity filed #LinearSolverConstraint
plateNode.addObject('MeshMatrixMass', massDensity=10, topology='@topo')
collision = plateNode.addChild('Collision')
collision.addObject('MeshTopology', src=meshLoaderFine.getLinkPath())
collision.addObject('MechanicalObject', name='CollisionMO')
collision.addObject('TriangleCollisionModel', name='CollisionModel', contactStiffness='100')
collision.addObject('BarycentricMapping', name='CollisionMapping', input='@../MechanicalModel', output='@CollisionMO')
# Fine visual model for plate with tetrahedron
fineVisualModel = plateNode.addChild('FineVisualModel')
fineVisualModel.addObject('OglModel', name='VisualModel', src=meshLoaderFine.getLinkPath())
fineVisualModel.addObject('BarycentricMapping', name='Mapping', input='@../MechanicalModel', output='@VisualModel')Here is how I set up the orbit model without tetrahedron: # Creating the orbit object
orbitNode = root.addChild("Orbit")
orbitNode.addObject('MechanicalObject', name="mstate", template="Rigid3", showObject=True, translation2=[850, -150.0, 250], rotation2=[0, 0, -90])
orbitNode.addObject('UniformMass', name="mass", vertexMass=[totalMass, volume, inertiaMatrix[:]])
#### Collision subnode for the orbit
orbitCollis = orbitNode.addChild('collision_orbit')
orbitCollis.addObject('MeshTopology', src=orbitLoaderFine.getLinkPath())
orbitCollis.addObject('MechanicalObject', name='CollisionMO')
orbitCollis.addObject('TriangleCollisionModel', moving=False, simulated=False)
orbitCollis.addObject('LineCollisionModel', moving=False, simulated=False)
orbitCollis.addObject('PointCollisionModel', moving=False, simulated=False)
orbitCollis.addObject('RigidMapping')
# Fine visual model for plate with tetrahedron
orbitVisu = orbitNode.addChild('FineVisualModel')
orbitVisu.addObject('OglModel', name='VisualModel', src=orbitLoaderFine.getLinkPath())
orbitVisu.addObject('RigidMapping')The full script orbit_with_plate_tetrahedron.py and testing models are here: https://drive.google.com/drive/folders/1I6t7hrlMDNoies4Azd0gR5-LQjyJW0t5?usp=sharing The only way I could make the collision work so that the plate did not penetrate the orbit is to disable the tetrahedron in both the plate and orbit. Can anyone give me some suggestions? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
The collision detection somehow worked after adding |
Beta Was this translation helpful? Give feedback.


The collision detection somehow worked after adding
'LineCollisionModel'andPointCollisionModelto the collision model of the plateNode in addition to only usingTriangleCollisionModel! I also usedLinearSolverConstraintCorrectionandSparseLDLSolver. I also had to set up the Youngs Modulus super high for the plate as 1.05e11.