-
Notifications
You must be signed in to change notification settings - Fork 391
Update assembledEdges in shapes.py #237
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
Conversation
BRepBuilderAPI_MakeWire::Add(const TopTools_ListOfShape & L) offers the option to accept a list of shapes directly as argument: "Adds the edges of <L> to the current wire. The edges are not to be consecutive. But they are to be all connected geometrically or topologically. If some of them are not connected the Status give DisconnectedWire but the "Maker" is Done() and you can get the partial result. (ie connected to the first edgeof the list <L>)" Following this I modified the assembledEdges in shapes.py to be able to provide a list of unordered edges to BRepBuilderAPI_MakeWire. This way, when the list of edges is generated by another function, there is not need to make them consecutive.
Update assembledEdges in shapes.py
Codecov Report
@@ Coverage Diff @@
## master #237 +/- ##
==========================================
+ Coverage 94.86% 94.91% +0.04%
==========================================
Files 18 18
Lines 4190 4226 +36
==========================================
+ Hits 3975 4011 +36
Misses 215 215
Continue to review full report at Codecov.
|
|
@bragostin @adam-urbanczyk What would you guys think about printing a warning when the status is DisconnectedWire? Is it practical to do that?
Users often have trouble when they're using a set of points and a joint isn't connected or the wire isn't closed. It would be nice to have some indication that they need to look at their points again unless they meant for things to be disconnected. |
|
I'm not saying it needs to happen in this PR, but looking ahead, implementing warnings like that would be nice for users. |
1 similar comment
|
I'm not saying it needs to happen in this PR, but looking ahead, implementing warnings like that would be nice for users. |
|
@jmwright @adam-urbanczyk would a simple |
|
@bragostin That sounds good to me. It's just something to keep the user from having to guess what's going on if things don't work as expected. |
|
@bragostin looks good but I'd propose to use |
|
@jmwright @adam-urbanczyk I am just discovering the module if not wire_builder.IsDone():
w1 = 'BRepBuilderAPI_MakeWire::IsDone(): returns the construction status. BRepBuilderAPI_WireDone if the wire is built, or another value of the BRepBuilderAPI_WireError enumeration indicating why the construction failed = '+ str(wire_builder.IsDone())
w2 = 'BRepBuilderAPI_MakeWire::Error(): returns true if this algorithm contains a valid wire. IsDone returns false if: there are no edges in the wire, or the last edge which you tried to add was not connectable = ' + str(wire_builder.Error())
warnings.warn(w1)
warnings.warn(w2)be ok? |
|
@bragostin I think that looks fine. |
|
I am not familiar with using github yet and I am obviously doing something wrong here, any idea what it is? |
|
What do you mean @bragostin ? |
|
Well, 2 checks were not successful: |
|
Yes, indeed: codecov is complaining about test coverage decrease. If you feel like you could add a test that triggers the newly implemented warning. |
|
@adam-urbanczyk I just did add a test that triggers the warning and the 4 checks are ok now. |
|
I have improved the test |
|
@adam-urbanczyk Do you want me to go ahead and merge this? |
|
Sorry I did a mess, I forgot to create a new branch for |
|
@bragostin The reason you're getting a conflict is because runtest.py was deleted recently as part of the upgrade to pytest. #236 |
|
@jmwright In the test_cadquery.py file I have added a |
|
Thanks. Sorry you didn't get a heads-up about the test changes. Changes have been happening quickly and it's hard to keep track. |
|
@bragostin I think it looks good. Just take a look a the single comment I had. |
|
@bragostin It looks like you addressed the comment from @adam-urbanczyk . Do you feel this PR is ready to merge? I looked it over again and I can't think of anything else that we're missing. |
|
@jmwright I have been using this new |
|
@bragostin Thanks for all your work on this. Looks like it's time to merge it. When I get a chance I'll take a look at some of the other edge assembly related issues here in GitHub to see if this fixes them. |
|
Thanks for the contribution @bragostin ! |
BRepBuilderAPI_MakeWire::Add(const TopTools_ListOfShape & L)offers the option to accept a list of shapes directly as argument:Adds the edges of <L> to the current wire. The edges are not to be consecutive. But they are to be all connected geometrically or topologically. If some of them are not connected the Status give DisconnectedWire but the "Maker" is Done() and you can get the partial result. (ie connected to the first edgeof the list <L>)Following this I modified the
assembledEdgesinshapes.pyto be able to provide a list of unordered edges toBRepBuilderAPI_MakeWire. This way, when the list of edges is generated by another function, there is not need to make them consecutive.