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: 15808
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: 15808
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: 15808
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: 15808
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.
abdullah
Posts: 3122
Joined: Sun May 04, 2014 3:16 pm

Re: Body clone inside body position properties dissapear after save

Postby abdullah » Tue Jun 25, 2019 11:37 am

tsadowski wrote:
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?
It is Part::AttachExtension, which is an extension and it is indeed in the Part WB.

PartDesign WB relies on Part WB.

PartDesign::Feature inherits directly from Part::Feature

The "Attachment offset" is shown to the user when an object is attached. It works the same in the Part WB and PartDesign WB.

Example Part WB:
1. Make a Part::Box and a Part::Cylinder.
2. At this point there is no attachment offset in any of them.
3. Use the attachment tool in the menu of the Part WB to attach one to the other.
4. The attached one now shows the attachment offset.

Example PartDesign WB:
1. Make a body and place a sketch on XY
2. There is an attachment offset property shown.
3. In the properties deactivate the attachment (Map mode deactivated).
4. Now there is none.
abdullah
Posts: 3122
Joined: Sun May 04, 2014 3:16 pm

Re: Body clone inside body position properties dissapear after save

Postby abdullah » Tue Jun 25, 2019 11:46 am

tsadowski wrote:
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?
FeaturePrimitive is an example of a PartDesign feature that is attachable and when attached has an offset property shown.