[Merged] Refactoring ViewProviderSketch

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!
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Refactoring ViewProviderSketch

Post by openBrain »

abdullah wrote: Thu Nov 11, 2021 1:53 pm The task to refactor ViewProviderSketch::draw() has become quite a daunting effort. Mainly because it has ended up in becoming a major refactor of about every single aspect of ViewProviderSketch where coin is involved. This is at least 70% of the original weight (and it was heavy).
As a part of the effort, may you have a look at issue #4779 ? I can confirm this bug. The main symptom seems to be that diameter label isn't correctly centered/aligned with the line while radius is correct. Thx
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Refactoring ViewProviderSketch

Post by abdullah »

openBrain wrote: Tue Nov 16, 2021 5:51 pm
abdullah wrote: Thu Nov 11, 2021 1:53 pm The task to refactor ViewProviderSketch::draw() has become quite a daunting effort. Mainly because it has ended up in becoming a major refactor of about every single aspect of ViewProviderSketch where coin is involved. This is at least 70% of the original weight (and it was heavy).
As a part of the effort, may you have a look at issue #4779 ? I can confirm this bug. The main symptom seems to be that diameter label isn't correctly centered/aligned with the line while radius is correct. Thx
What do I need to do to reproduce it. I create a circle. I put a diameter constraint on it. I do not see the text misaligned or cut. Do I need to do anything special?
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Refactoring ViewProviderSketch

Post by openBrain »

abdullah wrote: Tue Nov 16, 2021 6:57 pm What do I need to do to reproduce it. I create a circle. I put a diameter constraint on it. I do not see the text misaligned or cut. Do I need to do anything special?
:? Here I have nothing special to do. It just reproduces just by adding a diameter constraint to any arc/circle.
If you can't reproduce, I'll try to push a bit the analysis.
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: Refactoring ViewProviderSketch

Post by -alex- »

JFYI no any issue here about diameter constraint:

OS: Debian GNU/Linux 10 (buster) (LXDE/LXDE-pi)
Word size of FreeCAD: 64-bit
Version: 0.20.26326 (Git)
Build type: Unknown
Branch: master
Hash: 2cc570757144422a189b9881e650c3878ec58b13
Python version: 3.7.3
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/France (fr_FR)
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: Refactoring ViewProviderSketch

Post by -alex- »

abdullah wrote: Tue Oct 19, 2021 6:17 pm This is an announcement that I am initiating a substantial refactoring of ViewProviderSketch.
Many thanks for that!


Disclaimer: I'm not a developper.
Just 1 question: could this ongoing refactoring allows or ease the export of sketcher's constraint dimensions toward Techdraw views?
I mean about this issue #4181 and this topic or this one
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Refactoring ViewProviderSketch

Post by abdullah »

openBrain wrote: Tue Nov 16, 2021 7:19 pm
abdullah wrote: Tue Nov 16, 2021 6:57 pm What do I need to do to reproduce it. I create a circle. I put a diameter constraint on it. I do not see the text misaligned or cut. Do I need to do anything special?
:? Here I have nothing special to do. It just reproduces just by adding a diameter constraint to any arc/circle.
If you can't reproduce, I'll try to push a bit the analysis.
I cannot reproduce it. Which FC version do you have installed, where you can reproduce it?
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Refactoring ViewProviderSketch

Post by openBrain »

abdullah wrote: Wed Nov 17, 2021 1:15 pm I cannot reproduce it. Which FC version do you have installed, where you can reproduce it?
I can reproduce it on all versions I have, basically latest PPA daily and latest PPA stable. ;)
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Refactoring ViewProviderSketch

Post by abdullah »

-alex- wrote: Tue Nov 16, 2021 9:58 pm Just 1 question: could this ongoing refactoring allows or ease the export of sketcher's constraint dimensions toward Techdraw views?
I mean about this issue #4181 and this topic or this one
Not really. A refactoring does not add any new functionality. The changes are not oriented to change the Sketcher data information, but just separating the Coin drawing/node creation/update (management) from other visualisation functions in the ViewProvider, and removing dependencies so that ViewProvider is substantially agnostic of the actual coin implementation used. The ultimate goal to arrive to a good base to implement geometry layers (but implementing this is a separate step, not the goal of the refactoring).
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Refactoring ViewProviderSketch

Post by abdullah »

openBrain wrote: Wed Nov 17, 2021 1:21 pm
abdullah wrote: Wed Nov 17, 2021 1:15 pm I cannot reproduce it. Which FC version do you have installed, where you can reproduce it?
I can reproduce it on all versions I have, basically latest PPA daily and latest PPA stable. ;)
I cannot reproduce in the previous version I had (PPA from 1108). I have just upgraded to the latest PPA:
Peek 17-11-2021 14-33.gif
Peek 17-11-2021 14-33.gif (116.78 KiB) Viewed 2518 times

OS: Ubuntu 20.04.3 LTS (MATE/mate)
Word size of FreeCAD: 64-bit
Version: 0.20.
Build type: Release
Branch: unknown
Hash: a26fb4db1adfb387e3c872037ab640722a0b8f0f
Python version: 3.8.10
Qt version: 5.12.8
Coin version: 4.0.0
OCC version: 7.5.2
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: Refactoring ViewProviderSketch

Post by -alex- »

abdullah wrote: Wed Nov 17, 2021 1:30 pm Not really. A refactoring...
Thanks for informations.
so that ViewProvider is substantially agnostic of the actual coin implementation used.

So it could ease to workaround Coin3D at this stage (sketcher) by using Vlukan?
Post Reply