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!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
tsadowski
Posts: 36
Joined: Tue Jan 20, 2015 10:50 pm

Body clone inside body position properties dissapear after save

Post by tsadowski »

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

Re: Body clone inside body position properties dissapear after save

Post by chrisb »

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.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
tsadowski
Posts: 36
Joined: Tue Jan 20, 2015 10:50 pm

Re: Body clone inside body position properties dissapear after save

Post by tsadowski »

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

Re: Body clone inside body position properties dissapear after save

Post by chrisb »

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.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
tsadowski
Posts: 36
Joined: Tue Jan 20, 2015 10:50 pm

Re: Body clone inside body position properties dissapear after save

Post by tsadowski »

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

Re: Body clone inside body position properties dissapear after save

Post by chrisb »

It is better if the clone has an AttachmentOffset.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
tsadowski
Posts: 36
Joined: Tue Jan 20, 2015 10:50 pm

Re: Body clone inside body position properties dissapear after save

Post by tsadowski »

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

Re: Body clone inside body position properties dissapear after save

Post by chrisb »

It's the other way round: AttachmentOffset is a property that the PartDesign sketches have, not those in Part workbench outside a body.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Body clone inside body position properties dissapear after save

Post by abdullah »

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
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Body clone inside body position properties dissapear after save

Post by abdullah »

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.
Post Reply