Feature request: CarbonCopy should use names for references

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
chrisb
Veteran
Posts: 54302
Joined: Tue Mar 17, 2015 9:14 am

Feature request: CarbonCopy should use names for references

Post by chrisb »

CarbonCopy uses the internal numbers for references. When substantial changes are made to the constraints, e.g. the first constraint is removed and another is added, then these numbers change.

If names are used to denote the dimensionals constraints then some very intelligent algorithm replaces the numbered references to names. This works often but not always.

To make CarbonCopy more robust I would like to see the following workflow:
- Create the source sketch, give names to dimensional constraints
- Create a CarbonCopy. If it exists CarbonCopy uses the name, else it uses the number as before.

This would make the model more robust against changes and on top it would be easier to understand the carbon copy if names are used in a sensible way.

What do you think?
Abdullah wrote:ping
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

Re: Feature request: CarbonCopy should use names for references

Post by ppemawm »

chrisb wrote: Thu Jul 11, 2019 5:57 am This would make the model more robust against changes
+1
"It is a poor workman who blames his tools..." ;)
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Feature request: CarbonCopy should use names for references

Post by openBrain »

Looks nice. As often, I'd agree with this a long as this is an option. Something like "Use constraint names when possible". ;)
If this is unchecked, it behaves as today (reference by index). If it's checked, it behaves as proposed (reference by name if latter exists, else reference by index).

@abdullah : what would you think of renaming "name" with "label" to be consistent with other FreeCAD modules where "name" refers to the internal name (always exists) and "label" refers to the alias given by the user (optional) ?
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Feature request: CarbonCopy should use names for references

Post by abdullah »

chrisb wrote: Thu Jul 11, 2019 5:57 am CarbonCopy uses the internal numbers for references. When substantial changes are made to the constraints, e.g. the first constraint is removed and another is added, then these numbers change.

If names are used to denote the dimensionals constraints then some very intelligent algorithm replaces the numbered references to names. This works often but not always.

To make CarbonCopy more robust I would like to see the following workflow:
- Create the source sketch, give names to dimensional constraints
- Create a CarbonCopy. If it exists CarbonCopy uses the name, else it uses the number as before.

This would make the model more robust against changes and on top it would be easier to understand the carbon copy if names are used in a sensible way.

What do you think?
Abdullah wrote:ping
Yes. Carbon copy is something I am looking forward to improve.

Please file a ticket.
chrisb
Veteran
Posts: 54302
Joined: Tue Mar 17, 2015 9:14 am

Re: Feature request: CarbonCopy should use names for references

Post by chrisb »

openBrain wrote: Thu Jul 11, 2019 11:59 am Looks nice. As often, I'd agree with this a long as this is an option. Something like "Use constraint names when possible". ;)
If this is unchecked, it behaves as today (reference by index). If it's checked, it behaves as proposed (reference by name if latter exists, else reference by index).
What would be the benefit of using the indexes? I can only think of very artificial use cases. (In case you are in the programming business: using names instead of numbers seems to be similar to moving from assembly code to higher programming languages.)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Feature request: CarbonCopy should use names for references

Post by Jee-Bee »

an index is also a name...
When the index in the carbon copy have the same index as in the original you have your "names".
But a new sketch start again with 0. In someway there should be a distinction between a carbon copy index and a normal index so it can't interfere with each other...
chrisb
Veteran
Posts: 54302
Joined: Tue Mar 17, 2015 9:14 am

Re: Feature request: CarbonCopy should use names for references

Post by chrisb »

The indexes are not CarbonCopy indexes, they are references to the source sketch. And they tell you me nothing about where they occur in the source, unless you I can always remember in which sequence the constraints where added.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54302
Joined: Tue Mar 17, 2015 9:14 am

Re: Feature request: CarbonCopy should use names for references

Post by chrisb »

abdullah wrote: Thu Jul 11, 2019 12:31 pm Please file a ticket.
Done: issue #4053
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Feature request: CarbonCopy should use names for references

Post by openBrain »

chrisb wrote: Thu Jul 11, 2019 11:37 pm What would be the benefit of using the indexes?
It works and isn't subject to any user interaction, which is a great thing. :)
I like names when I myself set expressions, but in the case of CarbonCopy I can't see no real gain (limited to my experience & workflow). ;)
And maybe I like much using numbers. :lol:
(In case you are in the programming business: using names instead of numbers seems to be similar to moving from assembly code to higher programming languages.)
Not sure this is a correct comparison, but that's not really a problem. :P
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Feature request: CarbonCopy should use names for references

Post by Jee-Bee »

chrisb wrote: Fri Jul 12, 2019 6:31 am The indexes are not CarbonCopy indexes, they are references to the source sketch. And they tell you me nothing about where they occur in the source, unless you I can always remember in which sequence the constraints where added.
I understand that yoe meant the difference in sequence. but that was exactly what i meant is that the index in the carbon copy is exactly the one from it's source.
How to handle the difference (count up from where carbon copy stops; addition on index from carbon copy(cfor carbon and same index as original); etc.) is not up to me.
Post Reply