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

Strange behavior with edge order in face's wire #1295

Open
geiseri opened this issue Mar 26, 2023 · 3 comments
Open

Strange behavior with edge order in face's wire #1295

geiseri opened this issue Mar 26, 2023 · 3 comments
Labels
question Further information is requested

Comments

@geiseri
Copy link

geiseri commented Mar 26, 2023

I have a few issues in this file but first I need to clarify the order of Edges returned in a wire.

I am using a face in this test case to grab its outer wire so that I can use it in a future operation to create a sweep. The sweep has its own issues, but one big one comes from the fact it looks like the order of edges in the wire on line 20 seems to "shuffle" around. After 4 consecutive rounds running cq-server to build an STL I see the following output on line 25.

Run 1

edge 0 is [Vertex: (-10.0, -16.75, 2.629867970565564e-16), Vertex: (10.0, -16.75, 2.629867970565564e-16)]
edge 1 is [Vertex: (10.0, -16.75, 2.629867970565564e-16), Vertex: (11.75, -15.000000000000002, 2.629867970565564e-16)]
edge 2 is [Vertex: (11.75, 15.0, 2.629867970565564e-16), Vertex: (11.75, -15.000000000000002, 2.629867970565564e-16)]
edge 3 is [Vertex: (11.75, 15.0, 2.629867970565564e-16), Vertex: (10.0, 16.75, 2.629867970565564e-16)]
edge 4 is [Vertex: (-10.0, 16.75, 2.629867970565564e-16), Vertex: (10.0, 16.75, 2.629867970565564e-16)]
edge 5 is [Vertex: (-10.0, 16.75, 2.629867970565564e-16), Vertex: (-11.75, 15.000000000000002, 2.629867970565564e-16)]
edge 6 is [Vertex: (-11.75, 15.000000000000002, 2.629867970565564e-16), Vertex: (-11.75, -15.000000000000002, 2.629867970565564e-16)]
edge 7 is [Vertex: (-11.75, -15.000000000000002, 2.629867970565564e-16), Vertex: (-10.0, -16.75, 2.629867970565564e-16)]

Run 2

edge 0 is [Vertex: (11.75, 15.0, 8.76622656855189e-17), Vertex: (11.75, -15.000000000000002, 8.76622656855189e-17)]
edge 1 is [Vertex: (10.0, -16.75, 8.76622656855189e-17), Vertex: (11.75, -15.000000000000002, 8.76622656855189e-17)]
edge 2 is [Vertex: (-10.0, -16.75, 8.76622656855189e-17), Vertex: (10.0, -16.75, 8.76622656855189e-17)]
edge 3 is [Vertex: (-11.75, -15.000000000000002, 8.76622656855189e-17), Vertex: (-10.0, -16.75, 8.76622656855189e-17)]
edge 4 is [Vertex: (-11.75, 15.0, 8.76622656855189e-17), Vertex: (-11.75, -15.000000000000002, 8.76622656855189e-17)]
edge 5 is [Vertex: (-10.0, 16.75, 8.76622656855189e-17), Vertex: (-11.75, 15.0, 8.76622656855189e-17)]
edge 6 is [Vertex: (-10.0, 16.75, 8.76622656855189e-17), Vertex: (10.0, 16.75, 8.76622656855189e-17)]
edge 7 is [Vertex: (11.75, 15.0, 8.76622656855189e-17), Vertex: (10.0, 16.75, 8.76622656855189e-17)]

Run 3

edge 0 is [Vertex: (-10.0, 16.75, -3.5064906274207524e-16), Vertex: (10.0, 16.75, -3.5064906274207524e-16)]
edge 1 is [Vertex: (11.75, 15.000000000000002, -3.5064906274207524e-16), Vertex: (10.0, 16.75, -3.5064906274207524e-16)]
edge 2 is [Vertex: (11.75, 15.000000000000002, -3.5064906274207524e-16), Vertex: (11.75, -15.000000000000002, -3.5064906274207524e-16)]
edge 3 is [Vertex: (10.0, -16.75, -3.5064906274207524e-16), Vertex: (11.75, -15.000000000000002, -3.5064906274207524e-16)]
edge 4 is [Vertex: (-10.0, -16.75, -3.5064906274207524e-16), Vertex: (10.0, -16.75, -3.5064906274207524e-16)]
edge 5 is [Vertex: (-11.75, -15.000000000000002, -3.5064906274207524e-16), Vertex: (-10.0, -16.75, -3.5064906274207524e-16)]
edge 6 is [Vertex: (-11.75, 15.0, -3.5064906274207524e-16), Vertex: (-11.75, -15.000000000000002, -3.5064906274207524e-16)]
edge 7 is [Vertex: (-10.0, 16.75, -3.5064906274207524e-16), Vertex: (-11.75, 15.0, -3.5064906274207524e-16)]

Run 4

edge 0 is [Vertex: (11.75, 15.0, 7.012981254841505e-16), Vertex: (11.75, -15.000000000000002, 7.012981254841505e-16)]
edge 1 is [Vertex: (10.0, -16.75, 7.012981254841505e-16), Vertex: (11.75, -15.000000000000002, 7.012981254841505e-16)]
edge 2 is [Vertex: (-10.0, -16.75, 7.012981254841505e-16), Vertex: (10.0, -16.75, 7.012981254841505e-16)]
edge 3 is [Vertex: (-11.75, -15.000000000000002, 7.012981254841505e-16), Vertex: (-10.0, -16.75, 7.012981254841505e-16)]
edge 4 is [Vertex: (-11.75, 15.0, 7.012981254841505e-16), Vertex: (-11.75, -15.000000000000002, 7.012981254841505e-16)]
edge 5 is [Vertex: (-10.0, 16.75, 7.012981254841505e-16), Vertex: (-11.75, 15.0, 7.012981254841505e-16)]
edge 6 is [Vertex: (-10.0, 16.75, 7.012981254841505e-16), Vertex: (10.0, 16.75, 7.012981254841505e-16)]
edge 7 is [Vertex: (11.75, 15.0, 7.012981254841505e-16), Vertex: (10.0, 16.75, 7.012981254841505e-16)]

It looks like it comes back directly from the order of wires returned by the outerWire result on the face. It looks like this comes directly from here. Is this a bug? Is there maybe a better way to do this?

@adam-urbanczyk
Copy link
Member

Iterators in OCCT (and thus in cq) are not ordered.

@geiseri
Copy link
Author

geiseri commented Mar 27, 2023

Is there a way to provide a "start" and "end" vertex and have it sorted from there? I am not sure how you would sort them though. Where this trips me is when I intend to sweep along a wire, sometimes it seems to trip up.

@adam-urbanczyk adam-urbanczyk added the question Further information is requested label Mar 27, 2023
@adam-urbanczyk
Copy link
Member

CQ does not provide such functionality. You could sort them yourself, but I don't see why you'd need to specify order when sweeping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants