Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation issue #44

Open
pjuangph opened this issue Aug 9, 2023 · 0 comments
Open

Documentation issue #44

pjuangph opened this issue Aug 9, 2023 · 0 comments

Comments

@pjuangph
Copy link

pjuangph commented Aug 9, 2023

  • Alpha Shape Toolbox version:
  • Python version: 3.11
  • Operating System: Windows 11

I followed the documentation example. https://github.com/bellockk/alphashape#readme
It seems there is a compatibility issue with PolygonPatch.

Here's what I ran. I expected a plot but got an error.

import os
import sys
import pandas as pd
import numpy as np
from descartes import PolygonPatch
import matplotlib.pyplot as plt
sys.path.insert(0, os.path.dirname(os.getcwd()))
import alphashape

points_2d = [(0., 0.), (0., 1.), (1., 1.), (1., 0.),
          (0.5, 0.25), (0.5, 0.75), (0.25, 0.5), (0.75, 0.5)]

alpha_shape = alphashape.alphashape(points_2d, 0.)
alpha_shape
fig, ax = plt.subplots()
ax.scatter(*zip(*points_2d))
ax.add_patch(PolygonPatch(alpha_shape, alpha=0.2))
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant