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.
abdullah
Posts: 3268
Joined: Sun May 04, 2014 3:16 pm

Re: Solver/CGS architecture changes: Request for comment

Postby abdullah » Fri Nov 28, 2014 10:42 am

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
Posts: 7484
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Solver/CGS architecture changes: Request for comment

Postby DeepSOIC » Fri Nov 28, 2014 11:55 am

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
Posts: 7484
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Solver/CGS architecture changes: Request for comment

Postby DeepSOIC » Fri Nov 28, 2014 9:10 pm

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
Posts: 7484
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Solver/CGS architecture changes: Request for comment

Postby DeepSOIC » Sat Nov 29, 2014 6:40 pm

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

Postby DevJohan » Sat Nov 29, 2014 7:13 pm

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

Re: Solver/CGS architecture changes: Request for comment

Postby abdullah » Sat Nov 29, 2014 8:36 pm

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
Posts: 7484
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Solver/CGS architecture changes: Request for comment

Postby DeepSOIC » Sat Dec 06, 2014 8:12 pm

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
Posts: 7484
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Solver/CGS architecture changes: Request for comment

Postby DeepSOIC » Thu Dec 18, 2014 8:12 pm

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
Posts: 7484
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Solver/CGS architecture changes: Request for comment

Postby DeepSOIC » Thu Dec 18, 2014 10:56 pm

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
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Solver/CGS architecture changes: Request for comment

Postby shoogen » Fri Dec 19, 2014 11:21 am

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.