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

Easily divided by zero in 45 degrees GDS patterns #4

Open
arided02 opened this issue Apr 9, 2022 · 0 comments
Open

Easily divided by zero in 45 degrees GDS patterns #4

arided02 opened this issue Apr 9, 2022 · 0 comments

Comments

@arided02
Copy link

arided02 commented Apr 9, 2022

Line 153 to 156:
length_ij = np.linalg.norm(normal_ij, axis=1)
length_ik = np.linalg.norm(normal_ik, axis=1)
normal_ij /= np.stack((length_ij, length_ij), axis=1)
normal_ik /= np.stack((length_ik, length_ik), axis=1)
The length_ij and length_ik are easily be zero in offgrid alogn the 45 degrees hypotenuse. Request to add 0.000000001 prevent divided by zero.
length_ij = np.linalg.norm(normal_ij, axis=1)+0.00000001
length_ik = np.linalg.norm(normal_ik, axis=1)+0.00000001
normal_ij /= np.stack((length_ij, length_ij), axis=1)
normal_ik /= np.stack((length_ik, length_ik), axis=1)
To do so, I can easily to translate irregular patterns.

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