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 in switch_tetrahedron? #10

Closed
jiangzhongshi opened this issue Dec 14, 2021 · 1 comment
Closed

Bug in switch_tetrahedron? #10

jiangzhongshi opened this issue Dec 14, 2021 · 1 comment

Comments

@jiangzhongshi
Copy link
Collaborator

jiangzhongshi commented Dec 14, 2021

The following test would fail. Switching tet changes the edge it points to.

TEST_CASE("switch_face_tet", "[test_tuple]")
{
    TetMesh m;
    m.init(5, {{{0, 1, 2, 3}}, {{0, 1, 4, 2}}, {{0, 1, 3, 4}}});
    auto e = m.tuple_from_edge(0, 3);

    spdlog::critical("edge {} {} {} {}", e.tid(), e.fid(m), e.eid(m), e.vid());
    e = e.switch_face(m);
    spdlog::critical("edge {} ({}) {} {}", e.tid(), e.fid(m), e.eid(m), e.vid());
    auto edge0 = e.eid(m);
    e = e.switch_tetrahedron(m).value();
    spdlog::critical("edge ({}) {} {} {}", e.tid(), e.fid(m), e.eid(m), e.vid());
    auto edge1 = e.eid(m);
    REQUIRE(edge0 == edge1);
}

The output is as follows, note that the last line changes the id of the edge from 3 to 0.

[2021-12-14 17:36:24.441] [critical] edge 0 1 3 0
[2021-12-14 17:36:24.442] [critical] edge 0 (2) 3 0
[2021-12-14 17:36:24.442] [critical] edge (2) 2 0 0
@Yixin-Hu
Copy link
Collaborator

fixed here: #13

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