-
Notifications
You must be signed in to change notification settings - Fork 234
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
edges intersect numpy alg_1 #4144
edges intersect numpy alg_1 #4144
Conversation
Hm. Just a thought. Suppose we have a super-fast algorithm of finding intersections in 2D. Then, for 3D case, we can 1) project everything onto a plane — any one, XOY for example; 2) check for intersections on that plane; 3) then in 3D, check for intersections only for those pairs of edges which are intersecting in the projection. |
How new implementation handle such coner cases as overlapping two edges when point of one edges lays on the edges of another and overlapping of two collinear edges? |
That could, there would be more corner cases to check..... if two segments lay on a perpendicular plane to the projected plane the may look that they overlap but they could be intersecting... The complicated part of this algorithms are the corner cases so I'm not sure it would be so simple to implement. This could be interesting if someone finds the peace to implement it. I thinks the best solution would be a numba implementation (numba is pip-installable) or a gpu one... in a perfect world |
It does not handle them... :( at this point the remove doubles toggle is needed to remove the double point that it is created on the only-touching corner case... the overlapping edges are ignored. |
Another option could be to ignore the only-touching case, that would not produce double points... Maybe a extra toggle to let the user chose could be added... |
…ges_intersect_numpy_alg1
Replacement of the mathutils algorithm (called Alg_1) in the 2D mode of the Intersect edges node by a Numpy Implementation.
As a general rule is faster than the Sweep Line Algorithm and more stable than the Blender_cdt method (but can also crash in some heavy corner cases) Benchmarks at the documentation
Image of the test for docs
Preflight checklist
Put an x letter in each brackets when you're done this item: