Skip to content

Commit

Permalink
fix #68 by updating docstring in marching cubes (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgsellan authored Oct 19, 2023
1 parent 5ff5cc2 commit e89dc53
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/gpytoolbox/marching_squares.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

def marching_squares(S,GV,nx,ny):
"""
Marching squares algorithm for extracting isocontours from a scalar field.
Marching squares algorithm for extracting isocontours from a scalar field. Output is given as a list of (unordered) vertices and edge indices into the vertex list.
Parameters
----------
Expand Down Expand Up @@ -45,7 +45,11 @@ def marching_squares(S,GV,nx,ny):
# Plot
plt.figure()
plt.imshow(S.reshape((nx,ny),order='F'),extent=[-1,1,-1,1])
plt.plot(V[:,0],V[:,1],'k')
for i in range(E.shape[0]):
plt.plot([V[E[i,0],0],V[E[i,1],0]],
[V[E[i,0],1],V[E[i,1],1]],
'k-')
plt.show()
plt.axis('equal')
plt.show()
```
Expand Down

0 comments on commit e89dc53

Please sign in to comment.