(geom_model, material: str, compliance: float)
| 215 | |
| 216 | |
| 217 | def addMaterialAndCompliance(geom_model, material: str, compliance: float): |
| 218 | for gobj in geom_model.geometryObjects: |
| 219 | if material == "ice": |
| 220 | gobj.physicsMaterial.materialType = pin.PhysicsMaterialType.ICE |
| 221 | elif material == "plastic": |
| 222 | gobj.physicsMaterial.materialType = pin.PhysicsMaterialType.PLASTIC |
| 223 | elif material == "wood": |
| 224 | gobj.physicsMaterial.materialType = pin.PhysicsMaterialType.WOOD |
| 225 | elif material == "metal": |
| 226 | gobj.physicsMaterial.materialType = pin.PhysicsMaterialType.METAL |
| 227 | elif material == "concrete": |
| 228 | gobj.physicsMaterial.materialType = pin.PhysicsMaterialType.CONCRETE |
| 229 | else: |
| 230 | raise Exception("Material unknown.") |
| 231 | |
| 232 | # Compliance |
| 233 | gobj.physicsMaterial.compliance = compliance |
| 234 | |
| 235 | |
| 236 | def printSimulationPerfStats(step_timings: np.ndarray): |
no outgoing calls
no test coverage detected