When attempting to simulate a system where a node has a line or plane constraints the line_mask or plane_mask shape is set up incorrect.
When simulating a mesh a multiplication error arises between multiplication of mask *= line_mask.
the issue is in the following code snippet from ParticleSystem.py
for p in self.__particles:
if p.constraint_type == "plane":
for i in range(3):
line_mask.append(True)
if p.constraint_type == "plane":
for i in range(3):
line_mask.append(True)
constraint = p._Particle__constraint[0]
if constraint[0] == 1:
plane_mask.append(False)
plane_mask.append(True)
plane_mask.append(True)
elif constraint[1] == 1:
plane_mask.append(True)
plane_mask.append(False)
plane_mask.append(True)
elif constraint[2] == 1:
plane_mask.append(True)
plane_mask.append(True)
plane_mask.append(False)
else:
for i in range(3):
plane_mask.append(True)
for i in range(3):
plane_mask.append(True)
elif p.constraint_type == "line":
for i in range(3):
plane_mask.append(True)
elif p.constraint_type == "line":
for i in range(3):
plane_mask.append(True)
constraint = p._Particle__constraint[0]
if constraint[0] == 1:
line_mask.append(True)
line_mask.append(False)
line_mask.append(False)
elif constraint[1] == 1:
line_mask.append(False)
line_mask.append(True)
line_mask.append(False)
elif constraint[2] == 1:
line_mask.append(False)
line_mask.append(False)
line_mask.append(True)
else:
for i in range(3):
line_mask.append(True)
for i in range(3):
line_mask.append(True)
else:
for i in range(3):
plane_mask.append(True)
line_mask.append(True)
mask = np.outer(point_mask, [True, True, True]).flatten()
mask *= plane_mask
mask *= line_mask
on further investigation it seems that the following piece of code is run twice instead of once
for a line
elif p.constraint_type == "line":
for i in range(3):
plane_mask.append(True)
for a plane
if p.constraint_type == "plane":
for i in range(3):
line_mask.append(True)
removing this part of the code fixes the issue.
When attempting to simulate a system where a node has a line or plane constraints the line_mask or plane_mask shape is set up incorrect.
When simulating a mesh a multiplication error arises between multiplication of mask *= line_mask.
the issue is in the following code snippet from ParticleSystem.py
on further investigation it seems that the following piece of code is run twice instead of once
for a line
for a plane
removing this part of the code fixes the issue.