Draft Wire & Draft Polyline

Discussions about the wiki documentation of FreeCAD and its translation.
david69
Posts: 142
Joined: Wed Jan 01, 2014 7:48 pm

Draft Wire & Draft Polyline

Postby david69 » Sun Dec 01, 2019 10:45 am

both pages are showing information that IMO don't match with the current load:

https://www.freecadweb.org/wiki/Draft_Wire
shortcuts wiki W I --> but nowhere I read these shortcuts.

https://www.freecadweb.org/wiki/Draft_Polyline
menu location in wiki: draft --> wire but we read in Freecad draft --> polyline
shortcuts: W I --> P L

is there any reason to call the page "draft wire" although it is describing polyline. why not to rename that page "draft polyline"? and thus, we do not need to keep the actual page "wiki polyline".

OS: Ubuntu 18.04.3 LTS (LXDE/Lubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/France (fr_FR)
vocx
Posts: 1915
Joined: Thu Oct 18, 2018 9:18 pm

Re: Draft Wire & Draft Polyline

Postby vocx » Sun Dec 01, 2019 11:31 pm

david69 wrote:
Sun Dec 01, 2019 10:45 am
...
is there any reason to call the page "draft wire" although it is describing polyline. why not to rename that page "draft polyline"? and thus, we do not need to keep the actual page "wiki polyline".
...
The page is called Draft_Wire because internally, in the source code, the command is called "Draft_Wire". The name "Polyline" only appears in the menu text.

https://github.com/FreeCAD/FreeCAD/blob ... #L537-L547

Code: Select all

class Wire(Line):
    """a FreeCAD command for creating a wire"""
    def __init__(self):
        Line.__init__(self,wiremode=True)
    def GetResources(self):
        return {'Pixmap'  : 'Draft_Wire',
                'Accel' : "P, L",
                'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_Wire", "Polyline"),
                'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_Wire", "Creates a multiple-points line (polyline). CTRL to snap, SHIFT to constrain")}
This user "Maker" decided to arbitrarily create this "Draft_Polyline" page, in order to make the names "consistent" with the Sketcher Workbench. However, this is bad. We cannot just rename the pages arbitrarily. They are named in a certain way for a reason. Renaming the pages breaks the help system if the source code is not changed as well.
david69
Posts: 142
Joined: Wed Jan 01, 2014 7:48 pm

Re: Draft Wire & Draft Polyline

Postby david69 » Mon Dec 02, 2019 12:45 pm

that was my guess: the code is internally using "wire".

so, if somebody wants to know more about the function "polyline", he goes on the wiki page "draft polyline" and there, he needs to go to the "draft wire" page to understand it. am i right?

my suggestion was: a single page for polyline and inside that page, to have an explanation about the code using "wire". I also understand your point of view.

what about the shortcuts?
vocx
Posts: 1915
Joined: Thu Oct 18, 2018 9:18 pm

Re: Draft Wire & Draft Polyline

Postby vocx » Tue Dec 03, 2019 12:44 am

david69 wrote:
Mon Dec 02, 2019 12:45 pm
that was my guess: the code is internally using "wire".

so, if somebody wants to know more about the function "polyline", he goes on the wiki page "draft polyline" and there, he needs to go to the "draft wire" page to understand it. am i right?
No, this is convoluted.

The user will most probably use the help system, like the Std_WhatsThis tool. Or the user will click on the corresponding icon in the Draft Workbench page.
my suggestion was: a single page for polyline and inside that page, to have an explanation about the code using "wire". I also understand your point of view.

what about the shortcuts?
No. The best way is to be consistent, with code and documentation. Unfortunately this is something the Draft developer hasn't thought out very well. But to solve the problem we should discuss with him. We could rename the command from Draft_Wire to Draft_Polyline, and also provide some other commands, like makePolyline instead of makeWire. But the internal class will always be a "Draft._Wire", at least for the time being.
david69
Posts: 142
Joined: Wed Jan 01, 2014 7:48 pm

Re: Draft Wire & Draft Polyline

Postby david69 » Tue Dec 03, 2019 12:06 pm

all right, noted & understood. thank you.
david69
Posts: 142
Joined: Wed Jan 01, 2014 7:48 pm

Re: Draft Wire & Draft Polyline

Postby david69 » Wed Dec 04, 2019 12:48 pm

back to this topic, I see the shorcut on the wiki page for Polyline has been modified to be aligned with Freecad, P L.

the Menulocation should be also modified: Draft --> Polyline. I just want to double check that on the English version, it's well the way to create a Polyline using the tool Wire. On the French version of Freecad it is the case.