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

Intersecting half-edges cause panic #2124

Open
hannobraun opened this issue Dec 6, 2023 · 0 comments
Open

Intersecting half-edges cause panic #2124

hannobraun opened this issue Dec 6, 2023 · 0 comments
Labels
topic: core Issues relating to core geometry, operations, algorithms type: bug Something isn't working

Comments

@hannobraun
Copy link
Owner

When creating a cycle with intersecting half-edges, I get this error when I'm trying to display a model:

thread 'main' panicked at crates/fj-core/src/objects/kinds/cycle.rs:80:9:
internal error: entered unreachable code: Encountered invalid cycle: Cycle {
    half_edges: ObjectSet {
        inner: [
            HalfEdge @ 0x7f53f7c7a010 => HalfEdge {
                path: Line(
                    Line {
                        origin: [
                            1.5,
                            -1.0,
                        ],
                        direction: [
                            -3.0,
                            0.0,
                        ],
                    },
                ),
                boundary: CurveBoundary {
                    inner: [
                        [
                            0.0,
                        ],
                        [
                            1.0,
                        ],
                    ],
                },
                curve: Curve @ 0x5648a2ec2e90 => Curve,
                start_vertex: Vertex @ 0x5648a2ec71e0 => Vertex,
            },
            HalfEdge @ 0x7f53f7c7a098 => HalfEdge {
                path: Line(
                    Line {
                        origin: [
                            -1.5,
                            -1.0,
                        ],
                        direction: [
                            3.0,
                            2.0,
                        ],
                    },
                ),
                boundary: CurveBoundary {
                    inner: [
                        [
                            0.0,
                        ],
                        [
                            1.0,
                        ],
                    ],
                },
                curve: Curve @ 0x5648a2ec2e91 => Curve,
                start_vertex: Vertex @ 0x5648a2ec71e1 => Vertex,
            },
            HalfEdge @ 0x7f53f7c7a120 => HalfEdge {
                path: Line(
                    Line {
                        origin: [
                            1.5,
                            1.0,
                        ],
                        direction: [
                            -3.0,
                            0.0,
                        ],
                    },
                ),
                boundary: CurveBoundary {
                    inner: [
                        [
                            0.0,
                        ],
                        [
                            1.0,
                        ],
                    ],
                },
                curve: Curve @ 0x5648a2ec2e92 => Curve,
                start_vertex: Vertex @ 0x5648a2ec71e2 => Vertex,
            },
            HalfEdge @ 0x7f53f7c7a1a8 => HalfEdge {
                path: Line(
                    Line {
                        origin: [
                            -1.5,
                            1.0,
                        ],
                        direction: [
                            3.0,
                            -2.0,
                        ],
                    },
                ),
                boundary: CurveBoundary {
                    inner: [
                        [
                            0.0,
                        ],
                        [
                            1.0,
                        ],
                    ],
                },
                curve: Curve @ 0x5648a2ec2e93 => Curve,
                start_vertex: Vertex @ 0x5648a2ec71e3 => Vertex,
            },
        ],
    },
}
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This is easy to reproduce, by switching the positions of two of those lines in the cuboid model.

The error originates in Cycle::winding, and I have some suspicions that this method is buggy in more ways than that (pending investigation). It probably doesn't make much sense to fix this until the new geometry representation is here (or, alternatively, if we realize that it won't be here for some time).

@hannobraun hannobraun added type: bug Something isn't working topic: core Issues relating to core geometry, operations, algorithms labels Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: core Issues relating to core geometry, operations, algorithms type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant