Skip to content

Commit dd6e851

Browse files
authored
Update pythreejs.py
fixing the error that arise when using uneven width and height.
1 parent 150ff1c commit dd6e851

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pythreejs/pythreejs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def _update_surface(self):
7878
x = np.linspace(-self.width/2, self.width/2, nx)
7979
y = np.linspace(-self.height/2, self.height/2, ny)
8080
xx, yy = np.meshgrid(x, y)
81-
z = np.array(self.z).reshape((nx, ny))
81+
z = np.array(self.z).reshape(xx.shape)
8282

8383
positions = np.dstack((xx, yy, z)).reshape(nx * ny, 3).astype(np.float32)
8484

0 commit comments

Comments
 (0)