Skip to content

Instantly share code, notes, and snippets.

@dwyerk
Created April 12, 2014 23:20
Show Gist options
  • Star 52 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save dwyerk/10561690 to your computer and use it in GitHub Desktop.
Save dwyerk/10561690 to your computer and use it in GitHub Desktop.
concave hulls using shapely and scipy
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hhopson-primrose
Copy link

FYI for anyone running this notebook today (unless Descartes receives an update), you need to patch Descartes as described in this stackoverflow answer or the plot_polygon won't work https://stackoverflow.com/questions/75287534/indexerror-descartes-polygonpatch-wtih-shapely

@corsair20141
Copy link

I get the error "AttributeError: 'Delaunay' object has no attribute 'vertices'"

Is the .vertices method deprecated for Delaunay?

@dwyerk
Copy link
Author

dwyerk commented Nov 27, 2023

Yeah looks like it scipy/scipy@99cc995

Switch to tri.simplices

@corsair20141
Copy link

Yeah looks like it scipy/scipy@99cc995

Switch to tri.simplices

That fixed it. Thanks!

@corsair20141
Copy link

corsair20141 commented Nov 28, 2023

I am trying to get this to work for two offset sine waves. However, the best I can get is the second image. After that, increasing the alpha parameter creates a segmented geometry. Perhaps my ordering of points isn't in the proper format for this function?

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment