[possible bug?] placement of part design clone

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

Re: [possible bug?] placement of part design clone

Post by chrisb »

Jee-Bee wrote: Mon Aug 08, 2022 3:21 pm It is a bug because it by the name the tool have another behavior can be expected / should be expected.
If the name was Make a copy of it shape and put it in a new body container that is placed at origin then i expect current behaviour.
If something is called a clone then i may expect a exact clone of the object i choose. If i choose a body container then i expect a clone that selected body container(with or without object(s)).
As of now this is just not the case. It don't clone the body container! It only clone the shape that's inside the container and put that in a new container (placed at origin) ...
And that's how the PartDesign is designed and should work. If you want a clone with the behaviour you describe, then you can use a Draft clone.
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: [possible bug?] placement of part design clone

Post by Jee-Bee »

chrisb wrote: Mon Aug 08, 2022 9:54 pm then you can use a Draft clone.
The draft clone don't clone a body(it named it that way). The draft clone, clones only the object inside the body and that's it. What is kind of logical because draft don't use body containers.
PD clone should also handle PD-body containers and it doesn't
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: [possible bug?] placement of part design clone

Post by Jee-Bee »

If the goal of the clone is / was to only work with (external) shapes... Block then the input of body containers.
Then it's purpose is clear.

Nothing selected (works as expected)
Screenshot 2022-08-09 at 11.20.40.png
Screenshot 2022-08-09 at 11.20.40.png (80.98 KiB) Viewed 651 times

current status if body is selected (If this one is greyed out (or whatever the term may be) too then it is also a solution)
Screenshot 2022-08-09 at 11.20.58.png
Screenshot 2022-08-09 at 11.20.58.png (83.1 KiB) Viewed 651 times

but still work with (works as expected)
Screenshot 2022-08-09 at 11.21.19.png
Screenshot 2022-08-09 at 11.21.19.png (88.94 KiB) Viewed 651 times
wieszak17
Posts: 250
Joined: Fri Jan 10, 2014 7:59 pm

Re: [possible bug?] placement of part design clone

Post by wieszak17 »

adrianinsaval wrote: Mon Aug 08, 2022 2:06 pm Can you explain in what situation it would be useful to put the placement on the body rather than the clone? Keep in mind what I've said before about using basefeature.
Well, i would ask for scenario where current behaviour is logical - for me there is none. It was a countless cases when i need to reset position of a clone inside its body to get it correct because i forgot about cloning before positioning. I even thinking of creating a macro which corrects that behaviour. If i want clone I'm thinking about something identical to original. So when I'm _cloning_ a PB positioned somewhere in space i want to behave it same - especially when i then repositioning clones. I could get position from some script, some calculations, spreadsheet etc and why i must then do it in different ways if i first created original then clone and then do positioning or when i position first object, then clone and do repositioning of clones. In other words, why original have absolute position while clones relative? They should be the _same_ object as original.

Basefeature vs clones - It is exactly what basefeature should do - it _starts_ new object keeping as start point shape of something else, while clones are not new object, they are... clones of existing one. They should not differ in behaviour.

It also possibility to add switch into preferences so user would choose which behaviour is good for him.
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: [possible bug?] placement of part design clone

Post by chrisb »

Jee-Bee wrote: Tue Aug 09, 2022 9:04 am The draft clone don't clone a body(it named it that way).
Of course it does. But you don't want a clone, you want to change its DNA. Which then isn't a clone any more. To stay in the picture: You cannot do much to a clone, perhaps change the haircut or move to another place, but not much more.
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: [possible bug?] placement of part design clone

Post by Jee-Bee »

chrisb wrote: Tue Aug 09, 2022 9:33 am Of course it does.
Explain that. the only thing is see is a shape. everything that is related to the body-container is gone(no container, no origin, no planes).
chrisb wrote: Tue Aug 09, 2022 9:33 am But you don't want a clone, you want to change its DNA. Which then isn't a clone any more.
Nice one clone and DNA!! :lol:
I don't think i want to change it's DNA. The case is more what is it's DNA.
If i have a file with a body inside it see example:

Code: Select all

filename.FCStd
  | - body
      |-- (relation to general origin of the file == placement)
    |- origin
      |-- hard coupled with the body container
    |- shape features
      |-- (relation to body origin)
    |- Additional axis, planes and LCS
      |-- (relation to body origin / shape)
To me these relations are also the DNA of a body container.

When i create a clone of the body(so no external geometry or selection of objects that are inside the container).
- Ask yourself what is the stuff that should end up int the cloned instance?
- Equally important what are the relationships inside the clone and with the external world?

When i think of this. the internal relations should be equal to the relations of the original.
It is not only that the shape inside both containers are equal, but also that the relation to the body origin is equal.

The reason i'm constantly talking about the placement is as follows: When the placement of a body is not equal to {0, 0, 0, 0 ,0 ,0} the original and the clone diverge.
- The shapes are equal.
- The location of the shapes are equal.
- The relation between the shape and it's body origin is not equal.
The origin of the clone is not equal to the origin of the original.
Maybe it possible assert that current implementation alter the DNA...

In my opinion there are a few ways to fix this.
- Change name so it better suit it's implementation
- Only allow shape objects (thus no bodies anymore)
- Change the way it handles it's relations to body origin

My personal best option is the latest one.... bit the first 2 are more easy to change... i guess

chrisb wrote: Tue Aug 09, 2022 9:33 am You cannot do much to a clone, perhaps change the haircut or move to another place, but not much more.
where did i request for anything else as the above?
wieszak17
Posts: 250
Joined: Fri Jan 10, 2014 7:59 pm

Re: [possible bug?] placement of part design clone

Post by wieszak17 »

Or maybe something else: do not create Body container for Clone object? I mean Clone object at same level as its Body origin. It becames uneditable this way, but if you want editable copy then either use copy-paste to get unrelated copy or use basefeature. This way it is true clone, you can move it but not change it. And it have only one set of properties.

Nice feature would be cloning of Part object, but it probably is thing for macro...
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: [possible bug?] placement of part design clone

Post by adrianinsaval »

For that you should just use a link...
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: [possible bug?] placement of part design clone

Post by chrisb »

Jee-Bee wrote: Tue Aug 09, 2022 12:35 pm he reason i'm constantly talking about the placement is as follows: When the placement of a body is not equal to {0, 0, 0, 0 ,0 ,0} the original and the clone diverge.
- The shapes are equal.
- The location of the shapes are equal.
- The relation between the shape and it's body origin is not equal.
I'm not sure to understand what you mean. The Draft clone of a body gets the same Placement as the body.

We always tell people that the tools from outside of PartDesign should always use the whole body and not any sketches or features from inside. Same with a clone: It takes the body as is, and just creates a duplicate that follows further changes to the body.
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: [possible bug?] placement of part design clone

Post by Jee-Bee »

chrisb wrote: Tue Aug 09, 2022 4:46 pm I'm not sure to understand what you mean.
I have the idea you didn't understand me. The part you quoted was about PD and your response about draft
I don't use draft and from what i can see is the behavior kind of what i think i can expect...
chrisb wrote: Tue Aug 09, 2022 4:46 pm We always tell people that the tools from outside of PartDesign should always use the whole body and not any sketches or features from inside. Same with a clone: It takes the body as is, and just creates a duplicate that follows further changes to the body.
What i noticed at least in this topic is that body == shape. In the way of working that is not True. I can't start modeling in PD and at the moment i create a shape then i have also a body... No i have to create a body first and after that i can start creating my shape.
What is mentioned as a body is a body-container including an origin, optionally extra references and likely but optionally geometry.

That is where as far as i can see a lot of confusion comes from. Since a body is more than it's shape this should also be visible when using PD clone, when the original is already a PD body.
Post Reply