Constraints extended naming

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Jee-Bee
Posts: 1966
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Constraints extended naming

Postby Jee-Bee » Tue May 29, 2018 5:20 am

Now the last post are a bit off topic.. I would do also a feature request..
Would it be possible that constraints and or dimensions temporary switched off. So when my sketch swapt after a constraint or i did it in the wrong direction i can easily changing.
chrisb
Posts: 19455
Joined: Tue Mar 17, 2015 9:14 am

Re: Constraints extended naming

Postby chrisb » Tue May 29, 2018 5:36 am

I think there are better ways to achieve this. My favorite is to have the sketch arranged as near as possible to what they shall look after applying a constraint. If it swaps I undo the constraint and rearrange the sketch and apply them again.
Sometimes this does't work; then I use the block constraint to simply fix things until a few steps further. They are really a great help in these cases.
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: Constraints extended naming

Postby abdullah » Tue May 29, 2018 10:03 am

Jee-Bee wrote:
Tue May 29, 2018 5:20 am
Now the last post are a bit off topic.. I would do also a feature request..
Would it be possible that constraints and or dimensions temporary switched off. So when my sketch swapt after a constraint or i did it in the wrong direction i can easily changing.
I think it is feasible. I would put it in the tracker, as I have several PRs relating to the sketcher in the queue, and I prefer to have them merged first, as it start to touch too many different parts and I hate git conflicts. :)
Jee-Bee
Posts: 1966
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Constraints extended naming

Postby Jee-Bee » Tue May 29, 2018 10:33 am

I understand
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: Constraints extended naming

Postby abdullah » Tue May 29, 2018 4:32 pm

Jee-Bee wrote:
Tue May 29, 2018 10:33 am
I understand
In fact I think it would be easy to implement, as it can make use of the support for the Block constraint by declaring the disabled constraints unenforceable. Put a ticket in the tracker. A moderator can put it on my name. ;)
User avatar
uwestoehr
Posts: 765
Joined: Sun Jan 27, 2019 3:21 am

Re: Constraints extended naming

Postby uwestoehr » Sun Jul 14, 2019 9:43 pm

abdullah wrote:
Wed May 23, 2018 6:16 pm
[(GeoId1,PosId1);(GeoId2,PosId2);(GeoId3,PosId3)]
GeoId identifies the element. It is the value you use in Python to identify the geometric element.
I think we then have an off-by one problem because the extended info does not use the number of the element as used in the list of elements. So e.g. a line with the number '12' in the list of sketch elements will be addressed in python and thus also by the GeoId1 as '11'.
Could this be uniformed? I mean since the numbering in python is crucial, the numbers in the list of elements should then start from 0 and not from 1 to avid off-by-one mistakes.

While documenting the feature I had confusions/was hard to get it because of this.
chrisb
Posts: 19455
Joined: Tue Mar 17, 2015 9:14 am

Re: Constraints extended naming

Postby chrisb » Sun Jul 14, 2019 11:25 pm

We have this offset in other places too in FreeCAD, e.g. faces, edges and vertices show this offset as well.
User avatar
uwestoehr
Posts: 765
Joined: Sun Jan 27, 2019 3:21 am

Re: Constraints extended naming

Postby uwestoehr » Sun Jul 14, 2019 11:45 pm

chrisb wrote:
Sun Jul 14, 2019 11:25 pm
We have this offset in other places too in FreeCAD, e.g. faces, edges and vertices show this offset as well.
Then it is time to fix this ;)

I don't see a reason why numbers are different in the dialogs than in the scripts. This is error-prone and I don't think users have a problem that numbers in the dialogs begin with '0'.
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: Constraints extended naming

Postby abdullah » Sun Jul 21, 2019 7:08 am

uwestoehr wrote:
Sun Jul 14, 2019 11:45 pm
chrisb wrote:
Sun Jul 14, 2019 11:25 pm
We have this offset in other places too in FreeCAD, e.g. faces, edges and vertices show this offset as well.
Then it is time to fix this ;)

I don't see a reason why numbers are different in the dialogs than in the scripts. This is error-prone and I don't think users have a problem that numbers in the dialogs begin with '0'.
I can follow your argumentation. However, life is not that simple. Geometry elements include external elements, which are negative values indexed starting at -3, as -2 and -1 are the vertical and horizontal axes.

I do not think it is practical to search for uniformity in the context. As it is the objective is to encapsulate the internals, and the checkbox there to break this encapsulation for power users.
AndrewCSP
Posts: 16
Joined: Sun Jun 02, 2019 8:02 pm

Re: Constraints extended naming

Postby AndrewCSP » Wed Aug 14, 2019 1:56 pm

This is a fascinating discussion, but the extended naming has now been implemented, so is fixed for the moment.
As a newbie I searched for an explanation in the Wiki and found none, except the reference in the 0.18 release documentation that the check box had been added.
It would be useful if an explanation was added to the Wiki with a few examples.

uwestoehr - you mention 'documenting the feature'. Can this be used?