Part Design: Origin and Clone precise positioning

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Nick1951
Posts: 35
Joined: Fri Apr 29, 2022 2:03 pm

Part Design: Origin and Clone precise positioning

Post by Nick1951 »

Hi Guys, can anybody advise me a good videotutorial about positioning two separate Bodies for example Origin and its Clone ?
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Part Design: Origin and Clone precise positioning

Post by GeneFC »

What are you trying to accomplish?

At the basic level this is so trivial that it is hard to believe the question would be asked.

Must be something more complex.

Gene
wieszak17
Posts: 250
Joined: Fri Jan 10, 2014 7:59 pm

Re: Part Design: Origin and Clone precise positioning

Post by wieszak17 »

I suspect that he is confused with clone placing after cloning body which is not at 0,0,0. I still do not get why it is done this way...
drmacro
Veteran
Posts: 8870
Joined: Sun Mar 02, 2014 4:35 pm

Re: Part Design: Origin and Clone precise positioning

Post by drmacro »

wieszak17 wrote: Tue Feb 07, 2023 11:29 am I suspect that he is confused with clone placing after cloning body which is not at 0,0,0. I still do not get why it is done this way...
The Body of the clone is still referenced to Global origin. If you look at the placement of the clone, in the Body, it's Placement matches the Body it was cloned from.

It is confusing, but, it is the way the Body paradigm works.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
wieszak17
Posts: 250
Joined: Fri Jan 10, 2014 7:59 pm

Re: Part Design: Origin and Clone precise positioning

Post by wieszak17 »

I know that, but why? Copy and Paste do not follow such rule. It is only making Clone hard to use, and creating traps in project. Maybe then another tool (then it could also copy source name and maybe even be created in same Part object if Body belongs to one) or switch in preferences which way clone should work?
drmacro
Veteran
Posts: 8870
Joined: Sun Mar 02, 2014 4:35 pm

Re: Part Design: Origin and Clone precise positioning

Post by drmacro »

wieszak17 wrote: Tue Feb 07, 2023 12:07 pm I know that, but why? Copy and Paste do not follow such rule. It is only making Clone hard to use, and creating traps in project. Maybe then another tool (then it could also copy source name and maybe even be created in same Part object if Body belongs to one) or switch in preferences which way clone should work?
It is a misconception to equate the Placement object (which is a vector, as in vector math) to the "origin" concept in Euclidean space. They are of course related. But, the Placement vector of the Body and the Placement vector of the contents of members of the Body are there for the vector manipulation of objects (as in OOP software objects, not as in physical components). The relationship between the Body Placement object and the member Placement object to it's parent Body Placement object, their relationship (in this case to the parent, the original Body) and with the global placement is what allows them to move in space correctly. I agree that this is quite frustrating to the mind when the mind tends to default to Euclidean space and not mathematical manipulation of software objects in global and local coordinate systems.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Part Design: Origin and Clone precise positioning

Post by onekk »

wieszak17 wrote: Tue Feb 07, 2023 12:07 pm I know that, but why? Copy and Paste do not follow such rule. It is only making Clone hard to use, and creating traps in project. Maybe then another tool (then it could also copy source name and maybe even be created in same Part object if Body belongs to one) or switch in preferences which way clone should work?
EDIT: This is a totally not inerent answer as I have misunderstood the work of Clone, and described the way Part WB is working in respect to Placement property. :oops:

You could think like that:

You create a body, a body is created around a "reference point" and could be moved somewhere.

When you copy the object the placement is not cloned do you have to reapply or "reuse" the placement of the base object and operate on it.

There are some operations that reset the placement as example if you place the object and make a boolean operation in Part WB the placement is "reset" to origin for the new object you have created.

It is a rough and probably incorrect explanation to some extent, but help when thinking in 3d.

But this don't take in account Attachment and Links and similar things.

Please don't think that modifying the behaviour of FreeCAD will ease your life as probably it will broke all your old files.

When you copy and object you rarely want an exact copy, as probably you want to reposition it in another place. having a unique reference point will permit to reuse it easily, as example if you want simmetrical object and the base object is centered around the origin you will have obj1 position = vector(0, pos, 0) and obj2 position = vector(0, -pos, 0) for the other copy, short and meaningful.

if you have obj1 copied with original position you have to make obj2 vector in a counterintuitive way that will not show immediately the simmetry as you have to made it vector(0, pos * -2, 0).

I hope you could see why.

Regards

Carlo D.
Last edited by onekk on Tue Feb 07, 2023 4:56 pm, edited 2 times in total.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
wieszak17
Posts: 250
Joined: Fri Jan 10, 2014 7:59 pm

Re: Part Design: Origin and Clone precise positioning

Post by wieszak17 »

onekk wrote: Tue Feb 07, 2023 1:46 pm Pleaese don't think that modifying the beahviour of FreeCAD will ease your life as probably it will broke all your old files.
It will not. Change how clone works would only affect user experience, hence proposal to add it into preferences - once clone is created one way or another it will stay that way regardless change in clone behaviour. So old files are safe.
onekk wrote: Tue Feb 07, 2023 1:46 pm When you copy and object you rarely want an exact copy, as probably you want to reposition it in another place. having a unique reference point will permit to reuse it easily, as example if you want simmetrical object and the base object is centered around the origin you will have obj1 position = vector(0, pos, 0) and obj2 position = vector(0, -pos, 0) for the other copy, short and meaningful.
As should clone also work. Usually i do copy/paste when i will change something inside body with existing features, so it is rather another bodypart from source, clone if i need same bodypart only somewhere else, and clone or basefeature if i need bodypart a bit different from source like adding something. So it would be good if that tools would work similar.
drmacro wrote: Tue Feb 07, 2023 1:02 pm The relationship between the Body Placement object and the member Placement object to it's parent Body Placement object, their relationship (in this case to the parent, the original Body) and with the global placement is what allows them to move in space correctly.
onekk wrote: Tue Feb 07, 2023 1:46 pm if you have obj1 copied with original position you have to make obj2 vector in a counterintutive way that will not show immediately the simmetry as you have to made it vector(0, pos * -2, 0).
With current clone way of working it is also pain if you just want to rotate object. It just ends up in randomly looking place from user point of view if you forgot that you moved/rotated Body before Clone. So you are in position when you must check if you are rotating source (and rotate Body as you cannot rotate features inside) or clone (then you must rotate Clone object inside Body) or... just remember to _always_ reset Clone object position to get rid of that behaviour. And never use Clone placement property for anything.

Current Clone behaviour also gets in the way when you want place something new in the same place as existing body - you again need to check if you copying placement from source or from clone as above.
onekk wrote: Tue Feb 07, 2023 1:46 pm I hope you could see why.
Nope. I still think it is just big mistake - even after somewhat unnecessarily complicated explanation by drmarco. For me someone just can't decide what is what. Current behaviour would be logical to some extent if i would select Feature inside Body, _not_ Body itself and click Clone (then drmarco's explanation more or less works) so i'm cloning not Body but some body content - then yes, it is new body filled with clone of something . But when i'm selecting Body i want to get clone of _whole_ body with its shape, placement and even _name_ . Also quite good feature would be cloning of Part object - or by adding new Part with Bodies with Clones of source items (i think that would be better option) or Part with one Body with Clone of whole source Part's shape.
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Part Design: Origin and Clone precise positioning

Post by onekk »

clone_test.FCStd
(16.06 KiB) Downloaded 14 times
wieszak17 wrote: Tue Feb 07, 2023 4:33 pm ...
With current clone way of working it is also pain if you just want to rotate object. It just ends up in randomly looking place from user point of view if you forgot that you moved/rotated Body before Clone. So you are in position when you must check if you are rotating source (and rotate Body as you cannot rotate features inside) or clone (then you must rotate Clone object inside Body) or... just remember to _always_ reset Clone object position to get rid of that behaviour. And never use Clone placement property for anything.
...
I have misunderstood things, but Clone is using a sort of link to the body.

It could be discussed if Placement property should go in the Clone object or in the new body.

Copy is more static, it copies the object making a new body with a similar content to the old body, it is a copy and even the placement is duplicated in the "right place" so in the Body Placement.

Copy seems to be consistent with a "real copy" and you could select what properties to copy. So it not seems counterintuitive in the way it is working, it is creating an "independent object".

What is wrong with Clone?


Test done on this FC version:

Code: Select all

OS: Artix Linux (openbox)
Word size of FreeCAD: 64-bit
Version: 0.20.2.29603 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20.2)
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.10.8, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: Italian/Italy (it_IT)
Installed mods: 
  * QuickMeasure 2022.10.28
  * Assembly4 0.12.4
  * fasteners 0.4.24
  * toSketch 1.0.1
  * Curves 0.6.1
  * Help 1.0.3
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
wieszak17
Posts: 250
Joined: Fri Jan 10, 2014 7:59 pm

Re: Part Design: Origin and Clone precise positioning

Post by wieszak17 »

onekk wrote: Tue Feb 07, 2023 4:52 pm So I can't guess what you want to achieve.
1. Select Body and Body001, Edit->Placement and set Yaw (rotation on z axis) to 90 degree. No longer overlaps.

2. Undo.

3. Select Clone, Edit->Placement, Reset, Apply.

Repeat 1. Now they correctly overlaps.
Post Reply