원클릭으로
collision
Enable contact detection using the correct contact material for NSC or SMC systems.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Enable contact detection using the correct contact material for NSC or SMC systems.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Entry point for FSI-coupled hybrid plans (plan_type=fsi_in_scene) — any scene combining SPH fluid (water tanks, dam-break, wave channels) with multi-body dynamics, optionally with a wheeled vehicle. Pick this over mbs_in_scene whenever the plan involves a fluid domain (scene_objects with domain_type starting "sph_") or an FSI body registration (scene_objects with fsi_registration set). Routes to fsi/sph (always), veh/wheeled_vehicle (when vehicle present), and enforces FSI-specific invariants distinct from generic mbs_in_scene rigid scenes.
Entry point for rigid-body hybrid plans (plan_type=mbs_in_scene) combining a robot or vehicle with scene assets — NO fluid coupling. Routes to the correct domain skills and defines only high-level invariants. Use core/fsi_in_scene instead when the plan involves SPH fluid or FSI body registration.
Entry point for pure multi-body simulation plans (plan_type=mbs). Routes the agent to the correct mechanics, system, and camera skills and defines only high-level invariants.
Entry point for static scene plans (plan_type=scene). Routes the agent to the correct scene, system, and camera skills and defines only high-level invariants.
Set up SPH-based Fluid-Structure Interaction (FSI): create ChFsiFluidSystemSPH and ChFsiSystemSPH, configure fluid and SPH parameters, seed fluid particles with hydrostatic initialization, add container BCE boundary markers, register floating rigid bodies, optionally couple with a wheeled vehicle, and advance with sysFSI.DoStepDynamics(dT).
Translate a `geometry_relations` entry from the plan into correct PyChrono coordinate code. Read this whenever the plan declares a relation_name you have not previously encoded, and especially BEFORE writing SetPos / camera placement for any body that participates in a multi-body geometric constraint. Each subsection below is one canonical pattern named exactly as it appears in `plan.geometry_relations[i].relation_name`.
| name | collision |
| description | Enable contact detection using the correct contact material for NSC or SMC systems. |
| compatibility | pychrono >= 8.0 |
| metadata | {"domain":"mbs"} |
Enable contact detection between bodies using the correct contact material for the system type (NSC or SMC), and attach collision shapes to bodies.
When bodies should interact physically through contacts (floors, walls, falling objects, mixers, etc.).
allowed_classes:
allowed_methods:
canonical_examples:
ChSystemNSC → use ChContactMaterialNSCChSystemSMC → use ChContactMaterialSMC
Mixing them causes silent errors or crashes.sys.SetCollisionSystemType(chrono.ChCollisionSystem.Type_BULLET)
This must be called once on the system before any bodies with collision are stepped.
friction = float # friction coefficient
restitution = float # restitution coefficient
mat = chrono.ChContactMaterialNSC()
mat.SetFriction(friction)
mat.SetRestitution(restitution)
# Sphere
sph_radius = float # sphere radius [m]
sph_density = float # sphere density [kg/m³]
sphere = chrono.ChBodyEasySphere(sph_radius, sph_density, True, True, mat)
sphere.SetPos(chrono.ChVector3d(x, y, z))
sys.Add(sphere)
# Box
box_sx = float # box width [m]
box_sy = float # box height [m]
box_sz = float # box depth [m]
box_density = float # box density [kg/m³]
box = chrono.ChBodyEasyBox(box_sx, box_sy, box_sz, box_density, True, True, mat) # visualize, collide
sys.Add(box)
# Cylinder
cyl_radius = float # cylinder radius [m]
cyl_height = float # cylinder height [m]
cyl_density = float # cylinder density [kg/m³]
cyl = chrono.ChBodyEasyCylinder(chrono.ChAxis_Y, cyl_radius, cyl_height, cyl_density, True, True, mat) # visualize, collide
sys.Add(cyl)
The two booleans in ChBodyEasy* constructors are visualize and collide,
not fixed. For immovable collision bodies such as ground, walls, platforms,
or supports, call body.SetFixed(True) explicitly before adding the body to the
system.
vis_mat = chrono.ChVisualMaterial()
vis_mat.SetKdTexture(chrono.GetChronoDataFile("textures/concrete.jpg"))
body.GetVisualShape(0).SetMaterial(0, vis_mat)
friction = float # friction coefficient
mat = chrono.ChContactMaterialSMC()
mat.SetFriction(friction)
# mat.SetYoungModulus(2e7) # optional
# mat.SetPoissonRatio(0.3) # optional
mass = float # body mass [kg]
radius = float # collision sphere radius [m]
body = chrono.ChBody()
body.SetMass(mass)
body.SetPos(chrono.ChVector3d(x, y, z))
# Add collision shape (SMC material embedded in shape)
shape = chrono.ChCollisionShapeSphere(mat, radius)
body.AddCollisionShape(shape)
body.EnableCollision(True)
# Add visual shape separately
sphere_vs = chrono.ChVisualShapeSphere(radius)
sphere_vs.SetTexture(chrono.GetChronoDataFile("textures/bluewhite.png"))
body.AddVisualShape(sphere_vs)
sys.AddBody(body)
chrono.ChCollisionShapeSphere(mat, radius)
chrono.ChCollisionShapeBox(mat, sx, sy, sz)
# Attach at offset: body.AddCollisionShape(shape, chrono.ChFramed(pos, rot))
| Scenario | Recommended |
|---|---|
| Rigid/hard impacts (balls, blocks) | NSC |
| Many simultaneous contacts (granular) | NSC |
| Soft/compliant contacts | SMC |
| Need continuous force (no impulsive) | SMC |