Sketcher: Angle constraint name not shown

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Olav
Posts: 211
Joined: Sun Nov 27, 2016 7:58 pm
Location: Netherlands

Sketcher: Angle constraint name not shown

Post by Olav »

Hello. I'm very glad with the new setting "Show dimensional constraint name" for the Sketcher WB. However it appears not to work with angle constraints.

In the picture below the name of the angle reference constraint should be (boringly) "angle" but it is not shown.

Any advice? Or should this be considered a bug?

Selectie_059.png
Selectie_059.png (19.18 KiB) Viewed 2506 times

Code: Select all

OS: Ubuntu 18.04.6 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.
Build type: Release
Branch: unknown
Hash: 8fceac17628778bd0b2ba4c60bafd6494348ac08
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.5.2
Locale: Dutch/Netherlands (nl_NL)
User avatar
Shalmeneser
Veteran
Posts: 9443
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Sketcher: Angle constraint name not shown

Post by Shalmeneser »

Something forgotten during PR.
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Sketcher: Angle constraint name not shown

Post by chrisb »

Confirmed. Please create a tracker entry.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
drmacro
Veteran
Posts: 8806
Joined: Sun Mar 02, 2014 4:35 pm

Re: Sketcher: Angle constraint name not shown

Post by drmacro »

is angle perhaps a reserved word?

(not a pc, can't check...) :?:
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Olav
Posts: 211
Joined: Sun Nov 27, 2016 7:58 pm
Location: Netherlands

Re: Sketcher: Angle constraint name not shown

Post by Olav »

chrisb wrote: Fri Oct 15, 2021 10:03 pm Confirmed. Please create a tracker entry.
Thank you. Can you please do it? I'm not really familiar with the bug tracker or its proper procedures.
Olav
Posts: 211
Joined: Sun Nov 27, 2016 7:58 pm
Location: Netherlands

Re: Sketcher: Angle constraint name not shown

Post by Olav »

drmacro wrote: Fri Oct 15, 2021 10:52 pm is angle perhaps a reserved word?

(not a pc, can't check...) :?:
Tried with different names, same result.
User avatar
doia
Posts: 251
Joined: Sat May 29, 2021 5:47 am
Location: Düsseldorf

Re: Sketcher: Angle constraint name not shown

Post by doia »

No, I found the error.
On redraw of constraints the angle constrain doesn‘t use the getPresentationString() method, as linear or radial/diameter constraint do. Instead it calls getPresentationValue() directly.
See https://github.com/FreeCAD/FreeCAD/blo ... .cpp#L5769 vs. https://github.com/FreeCAD/FreeCAD/blo ... .cpp#L5465.
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Sketcher: Angle constraint name not shown

Post by chrisb »

doia wrote: Fri Oct 15, 2021 11:19 pm I found the error.
Great! Can you create a pull request? Then I don't have to create a ticket :mrgreen: .
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
doia
Posts: 251
Joined: Sat May 29, 2021 5:47 am
Location: Düsseldorf

Re: Sketcher: Angle constraint name not shown

Post by doia »

Unfortunately only in 14 days. Vacation time just started 8-), I will not have any dev equipment with me. Please create a ticket and anyone who can do a quick patch might go ahead.

Steps for a fix IMV are :idea: :
- make angle dimensions use getPresentationString() to render
- in getPresentationString() make an exception for angle dimensions so these don't accidentally use metric/imperial units
- check for any other overlooked dimension string :roll:
- in the long run check if getPresentationString() and getPresentationValue() are not actually the same functionality and can be summarized into a unified function -> are these called anywhere else than in ViewProviderSketch.cpp?
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Sketcher: Angle constraint name not shown

Post by chrisb »

issue #4766. Thanks doia for the detailed proposal.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply