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

Add early fail for get_normal_newell when the provided polygon is too small (< 3) #177

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mdjong1
Copy link
Member

@mdjong1 mdjong1 commented Nov 21, 2023

Fixes #176

@mdjong1
Copy link
Member Author

mdjong1 commented Nov 21, 2023

Looks like the build failed trying to install/build cjvalpy 0.3.2. Maybe using latest cjvalpy would already resolve this?

#16 0.633 💥 maturin failed
#16 0.633   Caused by: The following metadata fields in `package.metadata.maturin` section of Cargo.toml are removed since maturin 0.14.0: classifier, requires-dist, requires-python, please set them in pyproject.toml as PEP 621 specifies.

@mdjong1
Copy link
Member Author

mdjong1 commented Nov 21, 2023

Updating cjvalpy in the Dockerfile to 0.4.1 seems to have worked, I hope you're alright with that change 👍

@mdjong1 mdjong1 force-pushed the fix-normal-calculation-for-invalid-polys branch from dee8daf to e17d88e Compare November 21, 2023 15:04
@mdjong1 mdjong1 force-pushed the fix-normal-calculation-for-invalid-polys branch from e17d88e to 234a7ad Compare November 21, 2023 15:05
@@ -39,6 +39,8 @@ def get_normal_newell(poly):
ne = i + 1
if (ne == len(poly)):
ne = 0
if len(poly[i]) < 3 or len(poly[ne]) < 3:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually not 100% sure with it being here and checking for poly elements. I had it outside before with if len(poly) < 3, but that also felt weird. lmk what would be best

@hugoledoux hugoledoux self-requested a review October 31, 2024 10:00
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

Successfully merging this pull request may close these issues.

IndexError out of range when converting to STL
1 participant