PartDesign Cloning sub-object breaks after reloading

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!
User avatar
sgparry
Posts: 12
Joined: Sun Mar 14, 2021 1:00 pm

PartDesign Cloning sub-object breaks after reloading

Post by sgparry »

I keep getting bitten by this issue; Is this a bug or a known limitation please?
Basically, if I clone a sub-object of a Body in Part Design, it works at first without issues, even if I force a recalculate. But then, if I reload the design and recalculate I get scope warnings like this:

Code: Select all

14:53:44  PartDesign::Body: Link(s) to object(s) 'Box' go out of the allowed scope 'Body001'. Instead, the linked object(s) reside within 'Body'.`
Between saving and reloading, the Base Feature property of the clone body changes from null to the cloned sub-object:
CloneIssueBefore.png
CloneIssueBefore.png (25.73 KiB) Viewed 1149 times
CloneIssueAfter.png
CloneIssueAfter.png (25.13 KiB) Viewed 1149 times

Code: Select all

OS: KDE neon User - 5.25 (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20.1)
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.10.5, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * Help 1.0.3
Attachments
CloneBodySubObjectTest.FCStd
(13.86 KiB) Downloaded 29 times
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: PartDesign Cloning sub-object breaks after reloading

Post by GeneFC »

I can replicate the behavior showing a change from "null" to "box", but I do not get any errors at any time.

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.30305 (Git)
Build type: Release
Branch: master
Hash: 5ffc2e10b69971e2cdcd798c4deacf44d407fd77
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: English/United States (en_US)
Installed mods: 
  * FeedsAndSpeeds 0.4.0
  * FeedsAndSpeeds-master.zip
  * Help 1.0.3
  * offline-documentation
Gene
chrisb
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: PartDesign Cloning sub-object breaks after reloading

Post by chrisb »

I can reproduce. The message occurs when I
- reload the
- mark all for recompute
- recompute

To clarify: we talk about the PartDesign Clone. The documentation is not very clear about this: Is a feature allowed for such a clone or only the whole body?

In any case there is a bug: If it is allowed, no message should occur after reload. If it is not allowed, the warning should be created immediately without requiring to save and reload first.

I'll update my version and retry.

Code: Select all

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.21.30143 (Git)
Build type: Release
Branch: master
Hash: a72bf218f9917df37e811d7e73a36333282028f5
Python 3.10.5, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: C/Default (C)
Installed mods: 
  * FC_SU
  * FeedsAndSpeeds 0.4.0
  * fcgear 1.0.0
  * fasteners 0.4.6
  * sheetmetal 0.2.57
  * ExplodedAssembly
  * Curves 0.5.8
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: PartDesign Cloning sub-object breaks after reloading

Post by chrisb »

Same situation with current version.

Code: Select all

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.21.30398 (Git)
Build type: Release
Branch: master
Hash: b3dfdc568a92810449bf47bc73b6784d65dfa206
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: C/Default (C)
Installed mods: 
  * FC_SU
  * FeedsAndSpeeds 0.4.0
  * fcgear 1.0.0
  * fasteners 0.4.6
  * sheetmetal 0.2.57
  * ExplodedAssembly
  * Curves 0.5.8
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: PartDesign Cloning sub-object breaks after reloading

Post by openBrain »

I found the (hidden) property "_Body" of the clone feature to be empty before reload, then set as owning body name after.
User avatar
mfraz74
Posts: 158
Joined: Mon Apr 05, 2021 9:19 am
Contact:

Re: PartDesign Cloning sub-object breaks after reloading

Post by mfraz74 »

Just come across this too:
Screenshot_20230216_105353.png
Screenshot_20230216_105353.png (19.97 KiB) Viewed 685 times
Reading this thread, am I correct in thinking this is due to cloning? Is there any way of fixing it?

Code: Select all

OS: Ubuntu 22.04.1 LTS (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.21.0.31850 (Git) AppImage
Build type: Release
Branch: master
Hash: d8d3bb8120ad139cf1eb2acf0be0ae6c297ac7f3
Python 3.10.9, Qt 5.15.6, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * sheetmetal 0.2.61
  * freecad.gears 1.0.0
  * Manipulator 1.5.0
  * lattice2 1.0.0
  * fcgear 1.0.0
  * Lithophane
  * Curves 0.6.6
  * Assembly4 0.12.4
  * kicadStepUpMod 10.17.1
  * InventorLoader 1.3.0
  * fasteners 0.4.54
  * A2plus 0.4.60i
  * QuickMeasure 2022.10.28
  * ThreadProfile 1.84.0
  * Assembly3 0.11.4 (Disabled)
  * VendorParts
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: PartDesign Cloning sub-object breaks after reloading

Post by adrianinsaval »

clone the body, not the fillet feature inside it
drmacro
Veteran
Posts: 8871
Joined: Sun Mar 02, 2014 4:35 pm

Re: PartDesign Cloning sub-object breaks after reloading

Post by drmacro »

Features of a Body are not atomic solids.

It would seem the "bug" is allowing a feature to be cloned.

Only the Body should be cloned.
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: PartDesign Cloning sub-object breaks after reloading

Post by wieszak17 »

drmacro wrote: Thu Feb 16, 2023 12:39 pm Features of a Body are not atomic solids.
What do you mean by atomic here?

drmacro wrote: Thu Feb 16, 2023 12:39 pm It would seem the "bug" is allowing a feature to be cloned.

Only the Body should be cloned.
Well, features are kinda allowed to be cloned, but only one of them. There is a tip property which exactly indicates which feature should be cloned when cloning body. Isn't it a bit artificial rule? The only thing it really limits is fact that you can only get exactly one shape out of body besides shape after last feature. Maybe better just cleanup that and 'officially' allow to clone any feature. And rather not removing the tip property - both ways have its practical uses.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: PartDesign Cloning sub-object breaks after reloading

Post by adrianinsaval »

I agree, some form of wrapper to "export" a specific step in a PD body would be nice
Post Reply