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

Divison by zero #29

Closed
maikwoehl opened this issue May 9, 2020 · 3 comments
Closed

Divison by zero #29

maikwoehl opened this issue May 9, 2020 · 3 comments

Comments

@maikwoehl
Copy link

Hello,

I have just experienced an issue with the following line:

fac = edge_lengths[l_b[2].edge.index][0] / edge_lengths[l_a[1].edge.index][0]

When two vertices are on the same coordinates due to extruding and accidentally not moving, there will be a division-by-zero error.

Maybe displaying a report message about that possible mistake would be good.

if EXTEND_MODE == 'LENGTH_AVERAGE':
    try:
        fac = edge_lengths[l_b[2].edge.index][0] / edge_lengths[l_a[1].edge.index][0]
    except ZeroDivisonError:
        operator.report({'ERROR'}, "Two vertices have same coordinates! Aborting...")
        # Abort action...
elif EXTEND_MODE == 'LENGTH':

I hope that helps you.

Best regards and stay healthy,

Maik Wöhl

@Radivarig
Copy link
Owner

Radivarig commented May 9, 2020 via email

@maikwoehl
Copy link
Author

maikwoehl commented May 9, 2020

Issues #23 and #25 are ment

@Radivarig
Copy link
Owner

No dedup needed, fixed in commit#bb0090d0

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

2 participants