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

Shape.edges() fails to return majority of edges #925

Open
MatthiasJ1 opened this issue Mar 3, 2025 · 6 comments
Open

Shape.edges() fails to return majority of edges #925

MatthiasJ1 opened this issue Mar 3, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@MatthiasJ1
Copy link
Contributor

s = GridLocations(10,10,5,5) * Rectangle(10,10)
s = Curve() + [f.wire() for f in s]

creates the following geometry:

Image
e = s.edges()

returns the following edges:

Image
@gumyr
Copy link
Owner

gumyr commented Mar 4, 2025

The problem here is with s = Curve() + [f.wire() for f in s] as this attempts to create a Wire given all of the inputs are Wires but that doesn't work as a single Wire can't be created from these objects. There needs to be more logic in this to ensure a Wire can actually be created, if not a Compound needs to be created which isn't easy given the structure of the code.

The quick fix is to do: s3 = Compound() + [f.wire() for f in s].

@MatthiasJ1
Copy link
Contributor Author

show(s) shows all of the expected edges though

@jdegenstein
Copy link
Collaborator

What is the output of show_topology?

@MatthiasJ1
Copy link
Contributor Author

show_topology gives all the edges. show has to be getting them from somewhere so I would assume they are there.

@snoyer
Copy link
Contributor

snoyer commented Mar 5, 2025

Most likely a BRepTools_WireExplorer vs TopoDS_Iterator question, see #864

@gumyr
Copy link
Owner

gumyr commented Mar 5, 2025

I should have clarified - show_topology does show the edges but we're kinda in a weird state where this isn't really a good Wire and other wire methods are going to have trouble. As a solution how about the __add__ method of Curve/Compound keeps the object as a Curve/Compound and never attempts to create a Wire? The goal of attempting to create a Wire was to make it easier to use the other "line like" methods but this example shows the danger in that.

@gumyr gumyr added the bug Something isn't working label Mar 6, 2025
@gumyr gumyr added this to the Not Gating Release 1.0.0 milestone Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants