Cyclic dependency invisble in the dependency graph

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
galou_breizh
Posts: 437
Joined: Wed Sep 15, 2010 9:38 am

Cyclic dependency invisble in the dependency graph

Post by galou_breizh »

I have a file with a cyclic dependency that I cannot sort out, at least not from the dependency graph, where I don't see any cycle.

I attach the files and the dependency graph.
bug-cyclic_dependency.fcstd
(16.5 KiB) Downloaded 12 times
depgraph.png
depgraph.png (85.05 KiB) Viewed 598 times
The reported errors when I click on "Recompute" are:

Code: Select all

6868.3 <App> Document.cpp(2816): Dependency cycles: 
6868.3 <App> Document.cpp(2846): 

vacuum_cleaner_flat_tool_v3#Part, vacuum_cleaner_flat_tool_v3#Body, vacuum_cleaner_flat_tool_v3#Pad, vacuum_cleaner_flat_tool_v3#DatumPlane, 

<Exception> Document.cpp(2847): The graph must be a DAG.
6870.22 <App> Document.cpp(2849): The graph must be a DAG.
Attacher: linked object Part is unexpected, assuming it has no shape.
PartDesign::Plane / DatumPlane: Links go out of the allowed scope
Attacher: linked object Part is unexpected, assuming it has no shape.
Attacher: linked object Part is unexpected, assuming it has no shape.
PartDesign::Plane / DatumPlane: Links go out of the allowed scope
Attacher: linked object Part is unexpected, assuming it has no shape.
6870.31 <App> Document.cpp(3202): vacuum_cleaner_flat_tool_v3#Part still touched after recompute
6870.31 <App> Document.cpp(3202): vacuum_cleaner_flat_tool_v3#Pad still touched after recompute
I managed to do what I want with the file, so it's more a bug suspicion (by the way https://forum.freecadweb.org/viewtopic.php?f=8&t=31491). If I remember correctly, I had a cyclic dependency that I created by using a Shape Binder but I deleted the "Shape Binder" object afterward because of this.

Thanks,
Gaël

OS: Ubuntu 18.04.3 LTS (i3/i3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Cyclic dependency invisble in the dependency graph

Post by openBrain »

I can't open the file, but if the Body is inside the Part (which IIRC is not shown in the graph) , there is indeed a cyclic dependency.
Datum plane relies on Part for its placement while Part needs Datum plane to be built.
Anyway there is an 'out of scope' error (red arrow) that shall be corrected. ;)
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: Cyclic dependency invisble in the dependency graph

Post by chrisb »

I neither get this bug on recompute all, nor do I see a body. I do see an orphaned origin.
Snip macro screenshot-87428a.png
Snip macro screenshot-87428a.png (9.95 KiB) Viewed 581 times
Edit: I see it now and I see the error message. My FreeCAD seems to have gone out of whack after loading a Sketch with more than 5000 elements.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: Cyclic dependency invisble in the dependency graph

Post by chrisb »

You must not attach the DatumPlane to the Part itself, you should attach it to a plane of the Body, probably XY_Plane001.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
galou_breizh
Posts: 437
Joined: Wed Sep 15, 2010 9:38 am

Re: Cyclic dependency invisble in the dependency graph

Post by galou_breizh »

chrisb wrote: Thu Jan 09, 2020 12:52 pm You must not attach the DatumPlane to the Part itself, you should attach it to a plane of the Body, probably XY_Plane001.
Got it thanks! I did it this way because I had another body which is supposed to be glued to the first one and I wanted to define the plane for the junction from a common "object".

Sometimes I have the impression that dependencies would be more manageable if there were more fined-grained, down to the deepest possible element but this may not be possible.

Thanks again,
Gaël
galou_breizh
Posts: 437
Joined: Wed Sep 15, 2010 9:38 am

Re: Cyclic dependency invisble in the dependency graph

Post by galou_breizh »

I just noticed the subtlety. I attached the Plane to "Part" with "ObjectXY" mode rather than to "Part/XY_Plane" with "Plane face" mode. Now the cyclic dependency is gone (proving that the dependency system is more fine-grained than I thought).

Of course I still have the "out of scope" error which I don't really get because the body is contained within the part.

Thanks for the hints,
Gaël
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: Cyclic dependency invisble in the dependency graph

Post by chrisb »

You can use a ShapeBinder.
Attachments
bug-cyclic_dependency_cb.fcstd
(10.5 KiB) Downloaded 11 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply