-
Notifications
You must be signed in to change notification settings - Fork 71
Intermittent error in fillet() operation. #4797
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
Comments
I'm seeing this reproduceably. I have three small kcl files in the directory. When I open the zoo app, it seems to auto-select the first file sorted alphabetically, which is this "extended_front_tube_elbow.kcl" file. In this case, it opens and doesn't have a problem with the fillet operation. But if I then switch to the second file in the list, and then back to the "extended_..." file, I get the fillet error. Just in case it makes a difference, I'm attaching the other file I switched to. |
@franknoirot iirc the last time this was happening reliably it meant the models were executing twice on load and over one another, could this be another race? or instance where models execute twice thru different code paths |
@jtran Could this have been fixed by the non-deterministic execution behaviour you fixed recently? |
I don't think so. The non-determinism only affected chamfer. And only since its keyword args conversion, Feb 21. |
I don't know if this helps, but I notice that when this error occurs, eliminating certain edges from the fillet call makes the error go away. So my guess is that it's an error in associating the tagged edge to the vertex that is supposed to be filleted. It gives the gut feel of some kind of off-by-one error, perhaps due to an uninitialized variable or something. Another reason I think this is that after removing the “offending” edges from the fillet, some of the remaining fillets are now in the wrong places. In other words, some of the edges where I didn't want a fillet received a fillet, and vice versa. |
I am converting the original KCL code to the latest version of our KCL language. I am at the first
These adjacent edges will fail we do not have the ability to fillet edges that are next to one another right now. I cannot continue to debug this since the original KCL code has fillet logic we do not support. I do not know how to recreate the original fillet issue with this code. Update: hmm I see this is actually correct but the fillets are failing. Going to try and debug. This code should actually be every other edge instead of adjacent edges
|
Hi Kevin, I have been keeping the code up on my side with the latest KCL changes. Right now, the behavior is still very weird, even though I'm not seeing a (reproducible) error at the moment, it's still putting fillets on different edges when I first load the model, versus when I switch to another model and back again. In addition, there's a hole I've defined in upper block that is performed with a negative extrusion, and if I comment out the last fillet in the list, the hole moves to the side for some reason. Perhaps the plane is redefined somehow. Here's the current code I'm using: holeFudge = 0.4 upperBlockTransHole = { r = (yBarD + holeFudge) / 2 } blockSz = max(upperBlock.h, lowerBlock.h) slot = { l = 10, h = 1 } sketch001 = startSketchOn(XZ) extrude001 = extrude(sketch001, length = blockSz) |> fillet( sketch002 = startSketchOn(extrude001, seg01) Here's what it looks like when it's correct: Here's what it looks like when it's first loaded: Here's what it looks like when I switch to the "switch_protector.kcl" model, and then switch back again, then comment out getNextAdjacentEdge(edge7); All quite weird. By the way, in case it matters, I've updated switch_protector.kcl as well: holeFudgeD = 0.4 totalH = 12.5 sketch001 = startSketchOn(XZ) |
2025-03-28.10-21-52.mp4I appreciate the response and the updated KCL code that is useful. I am unable to fillet any single edge. We have a fillet ticket that keeps track of many fillet issues. I am going to put this ticket into that bucket of issues. I am confused how your modeling application and produce the fillet edges but when I run the same @franknoirot Can you try this out with yeroca's latest code? Update: I went down a massive fillet rabbit hole. Turns out the project units were determining the default tolerance on the fillets. All of mine failed due to the tolerance being too big Context
|
I still think its executing over itself its the only reason in my mind could be wrong why its non-deterministic otherwise we'd see fillet code fail randomly in the rust ci, which does happen when real fillet bugs in engine occur |
like let me run this code over and over again w raw rust no js and i bet its fine |
it would be VERY VERY good to get to the bottom of these before v1, also just wasteful compute if we are executing over ourselves |
@jessfraz, the CLI script proves it's a state problem. But it doesn't prove much else. Let me explain. First, I reproduced the problem locally. It's 100% deterministic. I can trigger it every time.
Curiously, I noticed that to reproduce the problem I do indeed need I commented out the final Then I tried to simplify main file in I decided to take a different approach and compare the WebSocket messages in the successful run with the failing run. The WebSocket messages are the ultimate authority on which side the problem is on. See Comparing them was significantly easier thanks to the recent change to deterministic UUIDs, so thanks for that! Engine response maps still come back in random order, and the fillet edge UUID that eventually fails is different, but it maps to the same thing. As far as I can tell, from the So I'm throwing this sucker back in engine's court! Files that I used are attached. |
Basically, for a proper CLI proof, I'd want it to see:
|
Update on this here. Any thoughts on why calling |
if But it's probably revealing a bug that should be fixed because I don't think we want |
I rebased it here, and as far as I can tell, this is still failing. |
Updated code to v1.0.1:
|
@yeroca, thank you for your patience here. This has been a particularly tricky bug to figure out, but we haven't given up. We think we've narrowed this down to revolve(). It can be in the same file or even in another file that you switch between. It causes next and previous adjacent edges to flip. So your fillet is actually incorrectly trying to fillet the edge on the opposite side of the intended face. I believe a workaround is to avoid 360 degree revolve(). Up to 359.9 degrees may work. |
Thanks for the note! Interestingly the only other two other files in this project both had revolve in them, so switching to either of those files caused the error to occur when I switched back again. Adding Both the fact that this occurs only a full rotate (which is the default), and that there is cross interaction between files is interesting, but the latter problem seems the most worrisome to me. |
I can't explain this. Sometimes when I load the model whose code is contained in this issue, I get a BadRequest error "Fillet failed". Usually if I exit the zoo modelling app then restart it, the problem goes away. However, switching to another kcl file and back again doesn't fix it.
Core Dump
coredump-c8536b8d-1f66-448e-a5cc-bf1ff207d033.json
Reference ID: c8536b8d-1f66-448e-a5cc-bf1ff207d033
KCL Code
The text was updated successfully, but these errors were encountered: