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

BUG: "Unexpected number of edges" occurs with triangles sharing an edge #215

Open
dhermes opened this issue May 2, 2020 · 1 comment
Open

Comments

@dhermes
Copy link
Owner

dhermes commented May 2, 2020

The exact representations of the (linear) triangles are:

import numpy as np

nodes1 = np.asfortranarray([
    [
        float.fromhex("-0x1.8000000000000p-1"),
        float.fromhex("-0x1.9555555555556p-1"),
        float.fromhex("-0x1.8000000000000p-1"),
    ],
    [
        float.fromhex("0x1.0000000000000p+0"),
        float.fromhex("0x1.eaaaaaaaaaaaap-1"),
        float.fromhex("0x1.eaaaaaaaaaaaap-1"),
    ],
])
nodes2 = np.asfortranarray([
    [
        float.fromhex("-0x1.924924924924ap-1"),
        float.fromhex("-0x1.a492492492493p-1"),
        float.fromhex("-0x1.924924924924ap-1"),
    ],
    [
        float.fromhex("0x1.edb6db6db6db7p-1"),
        float.fromhex("0x1.db6db6db6db6ep-1"),
        float.fromhex("0x1.db6db6db6db6ep-1"),
    ],
])

(I will clean this report up shortly at some point, currently in the middle of another task.)

@dhermes
Copy link
Owner Author

dhermes commented May 2, 2020

Three of the four detected intersections are corners and one of these is not exact:

>>> [[v for v in r] for r in edges1[0].intersect(edges2[0])]
[[0.8571428571428565, 1.0], [0.0, 0.16666666666666774]]
>>> [[v for v in r] for r in edges1[0].intersect(edges2[2])]                                                                                                                                                        
[[0.8571428571428579], [0.9999999999999969]]
>>> [[v for v in r] for r in edges1[1].intersect(edges2[2])]                                                                                                                                                        
[[0.1428571428571421], [0.8333333333333307]]

The error is 3.1086244689504383e-15, which is likely below some "round to 0 or 1" threshold.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant