Expression Completer - Changes, Fixes
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Expression Completer - Changes, Fixes
Hi everyone, I'm new in this forum and in the developer's community for FreeCAD!
I'm a software engineer, C++, currently working in computer games for a loooong time. I've been trying to get into designing some parts for my hobby with FreeCAD again (3D Printing).
I noticed that the Expression Completer has some issues with the Formula (it wouldn't complete Constraints.Height, or have bugs with Completion), so I started to look into fixing that for myself (LOTS of dependent parts, sketches and tolerances that need references)
I did manage to get something that works OK, BUT it's not done yet (https://github.com/acpopescu/FreeCAD/tr ... ompletions). I also didn't want to rock the boat too much by changing everything there for now (looking at the splitPath function in the Expression completer)
Putting this out here so we can talk about it
Video with current state:
I'm a software engineer, C++, currently working in computer games for a loooong time. I've been trying to get into designing some parts for my hobby with FreeCAD again (3D Printing).
I noticed that the Expression Completer has some issues with the Formula (it wouldn't complete Constraints.Height, or have bugs with Completion), so I started to look into fixing that for myself (LOTS of dependent parts, sketches and tolerances that need references)
I did manage to get something that works OK, BUT it's not done yet (https://github.com/acpopescu/FreeCAD/tr ... ompletions). I also didn't want to rock the boat too much by changing everything there for now (looking at the splitPath function in the Expression completer)
Putting this out here so we can talk about it
Video with current state:
Re: Expression Completer - Changes, Fixes
Hi and welcome to the forum!
Good to see somebody working on this again. Are you aware of issue #3062.
Good to see somebody working on this again. Are you aware of issue #3062.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Expression Completer - Changes, Fixes
Hey, didn't know about that! - it has more features, and includes python completion too! Plus a bunch of other changes (parser changes, python completion as a baseline, unit changes).
It looks like it would fix more items and UI issues than what I did and possibly handle a bunch of edge cases I definitely don't know about.
That PR is pretty big though, on the other hand my changes are isolated to ExpressionCompleter.cpp (maybe the .h is in there as well?) and I wanted to keep them simple and doable in a couple of days, to help me with the constraints.
Also, I don't know the codebase, so I tried to keep the changes targeted and not intrusive.
Thanks for linking that PR issue!
It looks like it would fix more items and UI issues than what I did and possibly handle a bunch of edge cases I definitely don't know about.
That PR is pretty big though, on the other hand my changes are isolated to ExpressionCompleter.cpp (maybe the .h is in there as well?) and I wanted to keep them simple and doable in a couple of days, to help me with the constraints.
Also, I don't know the codebase, so I tried to keep the changes targeted and not intrusive.
Thanks for linking that PR issue!
Re: Expression Completer - Changes, Fixes
Looking over that PR - https://github.com/FreeCAD/FreeCAD/pull/3062 it looks like it needs some work to be integrated:
- update to latest changes
- fix the https://github.com/FreeCAD/FreeCAD/pull/7688
The main issue is that it seems to be waiting for the topo naming changes - are there any dependencies beside @realthunder owning both?
- update to latest changes
- fix the https://github.com/FreeCAD/FreeCAD/pull/7688
The main issue is that it seems to be waiting for the topo naming changes - are there any dependencies beside @realthunder owning both?
Re: Expression Completer - Changes, Fixes
I don't know. But it is a very, no an extremely good idea to keep pull requests small! So I'm looking forward to see completion inside constraints again.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Expression Completer - Changes, Fixes
I could push a PR with my changes until we get that larger one sorted out, and when that other one is ready to go it can overwrite them. It's a single changed file, ExpressionCompleter.cpp .
It depends if y'all want something in place before the big one comes in.
It depends if y'all want something in place before the big one comes in.
Re: Expression Completer - Changes, Fixes
Some idea to make expressions easy:
Wat a tool to click the reference (line, 3D edge, constraint,....)with the mouse to easy add existing references to expression.
Wat a tool to click the reference (line, 3D edge, constraint,....)with the mouse to easy add existing references to expression.
Re: Expression Completer - Changes, Fixes
Please do so. I am sure it is highly appreciated. This completion used to work, and it was even said to be a blocking error for the 0.19 release, when it suddenly vanished. Several users stayed for rather long with an outdated version, just to have this completion of constraint names.acpopescu wrote: ↑Sat Jan 21, 2023 11:04 pm I could push a PR with my changes until we get that larger one sorted out, and when that other one is ready to go it can overwrite them. It's a single changed file, ExpressionCompleter.cpp .
It depends if y'all want something in place before the big one comes in.
I am not to decide this, so other voices are highly appreciated.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Expression Completer - Changes, Fixes
Allright! - I've pushed https://github.com/FreeCAD/FreeCAD/pull/8228 with the fixes I did to the ExpressionCompleter.
@bleber - what did you have in mind: referencing Constraints inside the same Sketch, X-links to other sketches in the documents, or both?
@bleber - what did you have in mind: referencing Constraints inside the same Sketch, X-links to other sketches in the documents, or both?
Re: Expression Completer - Changes, Fixes
That's something different and should go to its own feature request in Open discussion forum. It's a nice idea, something between CarbonCopy and expressions, but it needs more user interface, because there can multiple dimensions be attached to the same geometric element.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.