Body clone inside body position properties dissapear after save

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
tsadowski
Posts: 21
Joined: Tue Jan 20, 2015 10:50 pm

Body clone inside body position properties dissapear after save

Postby tsadowski » Thu May 23, 2019 9:55 pm

Hello,

I have to bring this topic up again:

https://forum.freecadweb.org/viewtopic.php?t=25636

Right now a clone is immediately placed into a new body. This seems to be necessary. FreeCAD wants to migrate the design if the clone is taken out of the body. The position can either be changed by moving the body or by moving the clone.

The position properties of the clone disappear after save/load. Only position properties of clones outside of a body are restored.

I like the possibility to use two reference frames and the change would be very small:

Code: Select all

void FeatureBase::onDocumentRestored()
{
    // if the base is not part of a body then show its placement property again
    auto body = getFeatureBody();
    if (!body)
        Placement.setStatus(App::Property::Hidden, false);
}
to

Code: Select all

void FeatureBase::onDocumentRestored()
{
        Placement.setStatus(App::Property::Hidden, false);
}
If this creates other problems, the position properties of the clone should never be displayed.

Cheers,
Torsten
chrisb
Posts: 15769
Joined: Tue Mar 17, 2015 9:14 am

Re: Body clone inside body position properties dissapear after save

Postby chrisb » Thu May 23, 2019 10:58 pm

None of the PartDesign features has the possibility to change the Placement. And I think that the BaseFeatures should behave in the same way. So the issue is probably that it shouldn't be possible in the first place to be able to change the placement.

However, all normal features have an AttachmentOffset, and that would fit very well in the PartDesign concept. So you should think about introducing AttachmentOffset for BaseFeatures.

An expert should look at this and the implications.
tsadowski
Posts: 21
Joined: Tue Jan 20, 2015 10:50 pm

Re: Body clone inside body position properties dissapear after save

Postby tsadowski » Sun May 26, 2019 7:58 pm

I found another issue.
When I clone a body FreeCAD creates a new body positioned at the origin (0,0,0). The Position of the original body is in the clone feature. I will try to track this down.

Cheers,
Torsten
chrisb
Posts: 15769
Joined: Tue Mar 17, 2015 9:14 am

Re: Body clone inside body position properties dissapear after save

Postby chrisb » Sun May 26, 2019 10:10 pm

You are probably talking about the PartDesign Clone. And there it is supposed to work like this. The clone is a parametric copy of the body and of course has all its attributes, including the position. This clone is then included as a BaseFeature in a new body.
tsadowski
Posts: 21
Joined: Tue Jan 20, 2015 10:50 pm

Re: Body clone inside body position properties dissapear after save

Postby tsadowski » Mon May 27, 2019 7:07 pm

This is exactly the point. The clone as the base feature has the position of the original body. The enclosing body of the clone has the position (0,0,0). After a save/load it is impossible to edit the position of the clone.

Either the position of the clone remains editable or the new body gets the position of the original body and the clone position is (0,0,0). What is better?

Cheers,
Torsten
chrisb
Posts: 15769
Joined: Tue Mar 17, 2015 9:14 am

Re: Body clone inside body position properties dissapear after save

Postby chrisb » Mon May 27, 2019 9:09 pm

It is better if the clone has an AttachmentOffset.
tsadowski
Posts: 21
Joined: Tue Jan 20, 2015 10:50 pm

Re: Body clone inside body position properties dissapear after save

Postby tsadowski » Tue Jun 04, 2019 8:54 pm

The AttachmentOffset seems to be a Part property not PartDesign. Is there any plan to add this to PartDesign at all?
chrisb
Posts: 15769
Joined: Tue Mar 17, 2015 9:14 am

Re: Body clone inside body position properties dissapear after save

Postby chrisb » Tue Jun 04, 2019 10:12 pm

It's the other way round: AttachmentOffset is a property that the PartDesign sketches have, not those in Part workbench outside a body.