.397395619494580:eb91f111a0a5c785d9d2026cd67e3333_69e6210c180bcf8a442e5ffe.69e623c7180bcf8a442e6003.69e623c6966af563bdeec98d:Trae CN.T(2026/4/20 21:01:59)#113
Conversation
实现风场效果功能,允许在特定区域内施加风力。新增add_wind_field方法,通过指定区域边界和风力向量来创建风场效果,并在网格后处理阶段应用风力影响。
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit e333388. Configure here.
| if inside: | ||
| grid_v[I] += dt * ti.Vector(force) | ||
|
|
||
| self.grid_postprocess.append(apply_wind) |
There was a problem hiding this comment.
Wind postprocessor overrides bounding box boundary conditions
Medium Severity
The wind postprocessor is appended to grid_postprocess after the bounding box (which is always the first element, added in __init__). During each substep, the bounding box runs first and zeroes out boundary-violating velocities, but then apply_wind adds velocity back, potentially in the outward direction. Unlike existing colliders which only reduce or project velocity, wind adds velocity, so it can override the bounding box constraint and allow particles to escape the simulation domain.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit e333388. Configure here.


实现风场效果功能,允许在特定区域内施加风力。新增add_wind_field方法,通过指定区域边界和风力向量来创建风场效果,并在网格后处理阶段应用风力影响。
Note
Medium Risk
Adds a new grid postprocess kernel that modifies grid velocities inside a user-defined region, which can change simulation behavior and performance if bounds/forces are misconfigured.
Overview
Adds support for a region-bounded wind field in
MPMSolverviaadd_wind_field(lower_bound, upper_bound, force), implemented as a Taichi kernel appended togrid_postprocessto apply an acceleration togrid_vwithin the specified bounds.Updates the
demo_3d.pyexample to enable the new wind field so reviewers can see the effect in a 3D scene.Reviewed by Cursor Bugbot for commit e333388. Bugbot is set up for automated code reviews on this repo. Configure here.