Skip to content

Commit 84dc09c

Browse files
committed
Merge branch 'particle-radius-update' into 'master'
Update Model.particle_max_radius from Model.particle_radius setter See merge request mmacklin/warp!390
2 parents 02536d0 + df5a4cc commit 84dc09c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

warp/sim/integrator_xpbd.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,6 @@ def solve_particle_particle_contacts(
246246
radius = particle_radius[i]
247247
w1 = particle_invmass[i]
248248

249-
f = wp.vec3()
250-
251249
# particle contact
252250
query = wp.hash_grid_query(grid, x, radius + max_radius + k_cohesion)
253251
index = int(0)

warp/sim/model.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,12 +810,12 @@ def soft_contact_distance(self, value):
810810
DeprecationWarning,
811811
stacklevel=2,
812812
)
813-
813+
814814
@property
815815
def particle_radius(self):
816816
"""Array of per-particle radii"""
817817
return self._particle_radius
818-
818+
819819
@particle_radius.setter
820820
def particle_radius(self, value):
821821
if isinstance(value, float):
@@ -828,8 +828,13 @@ def particle_radius(self, value):
828828
stacklevel=2,
829829
)
830830
self._particle_radius.fill_(value)
831+
self.particle_max_radius = value
831832
else:
832833
self._particle_radius = value
834+
# TODO implement max radius update to be compatible with graph capture
835+
device = wp.get_device(self.device)
836+
if not device.is_capturing:
837+
self.particle_max_radius = self._particle_radius.numpy().max()
833838

834839

835840
class ModelBuilder:

0 commit comments

Comments
 (0)