Skip to content

Instantly share code, notes, and snippets.

@dbuscombe-usgs
Last active December 20, 2015 06:19
Show Gist options
  • Save dbuscombe-usgs/6085385 to your computer and use it in GitHub Desktop.
Save dbuscombe-usgs/6085385 to your computer and use it in GitHub Desktop.
Using alpha shapes in python
hull_path = "./hull"
infile='C.txt'
with open(infile, 'w') as f:
np.savetxt(f, C.T, delimiter=' ', fmt="%0.7f %0.7f\n")
radius=1
indices = get_alpha_shape(infile,radius)
alpha=C.T[indices]
plot(C[0],C[1],'.'), plot(alpha[1:].T[0],alpha[1:].T[1],'r')
savefig("C_radius="+str(radius)+".png")
close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment