relationship of two parts: child and parent

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!
Post Reply
ollydbg
Posts: 36
Joined: Thu Apr 07, 2016 2:54 pm

relationship of two parts: child and parent

Post by ollydbg »

Coming from Blender world, there it has the "parent" operation, thus an object A becomes a child of another object B. That's very common feature, such as in the serial robot arm motion. I see FreeCAD only has "compound" feature, but this is not quite similar.

Any ideas on implement a child and parent relationship of two parts? The main different is that for compound, the origin is the origin at the time when the two parts makes to a compound. But for a parent and child relationship, the origin is the parent object's origin.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: relationship of two parts: child and parent

Post by DeepSOIC »

Hi!
In the current development version of FreeCAD, there are placeable groups called Part containers. This kind of what you are asking for. They are at their infancy, though, and in many cases can behave unexpectedly. Nexting of Part containers is not supported yet, but I think this will come eventually.

There is a bit of a problem. FreeCAD did not support parenting from the beginning (apparently). Now it's being "bodged" in attempts to avoid reprogramming most features.
See related topics:
viewtopic.php?f=8&t=15332
viewtopic.php?f=8&t=15356
viewtopic.php?f=20&t=10786
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: relationship of two parts: child and parent

Post by microelly2 »

Yes you have to learn this other kind of relationship.
But the concept is more general. You arange some parts to a group and than you can move them as a compound.
The same idea is implemented in Open Inventor and vrml and vpython.
With the new Version of part Design you will have more opportunities. So wait some days until the 0.17 master is stable.
Or use compound, I never had problems in all of my animations. ;)
ollydbg
Posts: 36
Joined: Thu Apr 07, 2016 2:54 pm

Re: relationship of two parts: child and parent

Post by ollydbg »

Thanks for your replies.
I will just wait for the next release. :D

@microelly2
In your animation workbench:
Is it possible that when I try to set the "target" of object in the "Placer" dialog, the object's translation and rotation is automatically fetched to the dialog?
For me, when the Placer attach to an object, the translation and rotation will get reset, that's not quite good. For a motion, I just want to let the current position of the object be the start position. I'm not sure you can understand my feature request...

Thanks.
ollydbg
Posts: 36
Joined: Thu Apr 07, 2016 2:54 pm

Re: relationship of two parts: child and parent

Post by ollydbg »

@microelly2
I found an issue of your animation workbench, if an object is added to a compound, then in its associated Placer dialog, I can still change its translation or rotation by the noodle, but the button "backword" and "forward" do not works any longer. If it does not in a compound, then those two buttons can work OK.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: relationship of two parts: child and parent

Post by microelly2 »

The problem with the Placer and compound is that changing the placements of the components does not change the compound because the internals of the execute function of object proxys.
I have a trick: I use a toucher object that forces a recompute for the compound

see this
viewtopic.php?f=3&t=15283
example file is included.
ollydbg
Posts: 36
Joined: Thu Apr 07, 2016 2:54 pm

Re: relationship of two parts: child and parent

Post by ollydbg »

microelly2 wrote:The problem with the Placer and compound is that changing the placements of the components does not change the compound because the internals of the execute function of object proxys.
I have a trick: I use a toucher object that forces a recompute for the compound

see this
viewtopic.php?f=3&t=15283
example file is included.
Hi, thanks for the reply, I just retest the FreeCAD files in this post: Re: rotation along a selected axis, but I found that when I move the needle, I see the arm never moved again. If I remember correctly, it works with before which I used 0.15 release, maybe its my new 0.16 release?

Basically, I use the placer dialog to rotate the arm, so that I get different gestures of the robotic arm. I don't need to generate the animation. It is really bad if I can't manipulate the arm by the needle.

Is the toucher object used only in the animation? (when I click the run button in the My_manager dialog)

Here is my environment:
OS: Windows XP
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.16.6698 (Git)
Build type: Release
Branch: master
Hash: ca7c5d31a4d61f32a25b71025b14641a6e378328
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: relationship of two parts: child and parent

Post by microelly2 »

I have the same version of FreeCAD and it works,

so I hope you have the manager active (means visible)

In this case the Placers are controlled by the Manager and the dialog/dialer has no effect.
Two ways you can work:
a) hide the manager but let the placer visible
b) move the placer from the manager outside to the top level of the object tree

in both cases the manager loses the control over the placer



OS: Ubuntu 14.04.4 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6698 (Git)
Build type: None
Branch: master
Hash: ca7c5d31a4d61f32a25b71025b14641a6e378328
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
ollydbg
Posts: 36
Joined: Thu Apr 07, 2016 2:54 pm

Re: relationship of two parts: child and parent

Post by ollydbg »

microelly2 wrote:I have the same version of FreeCAD and it works,

so I hope you have the manager active (means visible)

In this case the Placers are controlled by the Manager and the dialog/dialer has no effect.
Two ways you can work:
a) hide the manager but let the placer visible
b) move the placer from the manager outside to the top level of the object tree

in both cases the manager loses the control over the placer
Thank you very much!
In-fact, I don't have the manager active. (I can open the manager dialog and close it, the manager dialog is not opened when I open the FreeCAD source file animation_chain.fcstd)
So, only the second method of the above two methods works here on my computer. :(
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: relationship of two parts: child and parent

Post by microelly2 »

I will test it on a windows xp computer and give feedback ..
Post Reply