Constraints extended naming

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!
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Constraints extended naming

Post by Jee-Bee »

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
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Constraints extended naming

Post by chrisb »

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.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Constraints extended naming

Post by abdullah »

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
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Constraints extended naming

Post by Jee-Bee »

I understand
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Constraints extended naming

Post by abdullah »

Jee-Bee wrote: Tue May 29, 2018 10:33 amI 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
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Constraints extended naming

Post by uwestoehr »

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
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Constraints extended naming

Post by chrisb »

We have this offset in other places too in FreeCAD, e.g. faces, edges and vertices show this offset as well.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Constraints extended naming

Post by uwestoehr »

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
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Constraints extended naming

Post by abdullah »

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: 45
Joined: Sun Jun 02, 2019 8:02 pm

Re: Constraints extended naming

Post by AndrewCSP »

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?
Post Reply