Solver/CGS architecture changes: Request for comment

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Solver/CGS architecture changes: Request for comment

Post by abdullah »

DeepSOIC wrote: My suggestion to solve it for tangency and perpendicularity is to not save the lockdown to the file, but recalculate all lockdowns upon file load. This may be a bit tricky with angle-via-point constraint (messing with datum values... may be not great in some circumstances).
Maybe I did not understand the problem as a whole. Locking, afaiu, means avoiding the tangency to flip from internal to external. This I think is a wanted feature. I have seen the real pro users complaining about this. Flipping is something they hate, because it does not do a sketch robust.

This "locking", IMO, should, in the future, be accesible to the user, that should be able to select between internal or external (or any other option you provide). This can preferably be done by using the "datum" to store it, because there is a datum edition functionality in place (which may need some extension for the case geoid3!=GeoUndef).

It is unavoidable that if we make mistakes, problems may arise in the future. We have to try not to make mistakes (starting by me not making mistakes :) ), and if we did, try to provide the user with a way to fix it, e.g. specific code to handle sketches created with that tool, e.g. deploying a function to ignore the stored datum.

Look at it on the bright side, there aren't thousand users out there using AngleViaPoint yet, and by chance I implemented some functionality that you tried to use and realized about it, so you can fix it before deploying it... ;)
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Solver/CGS architecture changes: Request for comment

Post by DeepSOIC »

Yeah. I've fixed it already, and even shared a new build (but it looks like people who may want it will not look into developers corner for it).
abdullah wrote:e.g. specific code to handle sketches created with that tool, e.g. deploying a function to ignore the stored datum.
Sounds like a reasonable solution. Make that only when such a situation with 1000 users actually happens.

I think the easiest way to fight the problem is to provide an option in the settings to turn locking off and ignore existing locking ... and a button to erase/recalculate all locking. But it may be a good idea to not waste time now...
abdullah wrote:Look at it on the bright side, there aren't thousand users out there using AngleViaPoint yet, and by chance I implemented some functionality that you tried to use and realized about it, so you can fix it before deploying it...
Yeah! Big thanks for this! I wouldn't have found the problem otherwise (although I did get some hints, e.g. I programmed the icons to be inside of the shape, and they ended up outside instead. But I just... "whatever, it's just an icon").
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Solver/CGS architecture changes: Request for comment

Post by DeepSOIC »

Exposed the ability to switch tangency/perpendicularity on or off for all constraints in a sketch.
Here: git commit c84095048ccd276da883629e429d3bc35a5fe651

EDIT: To use, type this into python console (True = lock, False = unlock):

Code: Select all

App.ActiveDocument.Sketch001.changeConstraintsLocking(True)
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Solver/CGS architecture changes: Request for comment

Post by DeepSOIC »

I think I'm done (again :D )
What next?
User avatar
DevJohan
Posts: 41
Joined: Sun Jul 13, 2014 2:36 pm
Location: Stockholm, Sweden

Re: Solver/CGS architecture changes: Request for comment

Post by DevJohan »

When will I ever have time to catch up?! ;)
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Solver/CGS architecture changes: Request for comment

Post by abdullah »

I will do some testing when I have some time. I will also squash all the related commits, to be able to see how is the "total change" now. Nice! :)
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Solver/CGS architecture changes: Request for comment

Post by DeepSOIC »

Hi again! Isn't it too much silence there recently? I want to make a new development on top of all this stuff...
The thing is - arc length constraints. I want to be able to fix the length of an arc or make it equal to a length of something else. Note that there's absolutely no way to do it now - deriving arc length by geometric construction is next to impossible.
I want to implement a ratio constraint, not just equality. All this will benefit from the architecture changes I've made.

Is this all stuff in a pull request? If not, why not? Should I make the pull request?
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Solver/CGS architecture changes: Request for comment

Post by DeepSOIC »

Renaming...
PlaneGCS. (not Flat, because native-English-speaking Jim doesn't like it. Not Sketch or Sketcher because I wanted to emphasize it is on a plane).
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Solver/CGS architecture changes: Request for comment

Post by DeepSOIC »

Looks like I have problem with renaming. The problem is git. It does not seem to have detected the renames/moves, but it has treated the changes as deleting the old files and creating new files. I'm not sure it will rebase correctly.
EDIT: see git commit f775acdc6df0769c87ab1a8442babd45afdb79a7
EDIT2: now that's strange. When viewed on github's website, all renames are detected, except one...
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Solver/CGS architecture changes: Request for comment

Post by shoogen »

DeepSOIC wrote:Looks like I have problem with renaming.[...]
EDIT2: now that's strange. When viewed on github's website, all renames are detected, except one...
The renames are not explicitly stored in the repo. The detection function run when trying to generate a diff. Different implemenations might generate slightly different diffs.
Post Reply