layer assignment problem, one object two layer

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

layer assignment problem, one object two layer

Post by bernd »

load the file test_layer_not_ok and make the same as in the screen cast.


layer-problem.gif
layer-problem.gif (935.6 KiB) Viewed 3260 times


If I create a file from scratch I am not able to add one object to two layers. See test_layer_ok.


OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.26155 (Git)
Build type: Release
Branch: master
Hash: 0926a4148bcff11249fd4f56bc30256102ffe105
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: German/Switzerland (de_CH)
Attachments
test_layer_ok.FCStd
(17.81 KiB) Downloaded 24 times
test_layer_not_ok.FCStd
(14.66 KiB) Downloaded 24 times
User avatar
thomas-neemann
Veteran
Posts: 11801
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: layer assignment problem, one object two layer

Post by thomas-neemann »

bernd wrote: Tue Oct 26, 2021 2:24 pm
confirmed
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: layer assignment problem, one object two layer

Post by Roy_043 »

Confirmed. If you replace the Part_Box objects in your OK file with Part_SimpleCopies you will see the same bug in that file.

The bug seems to depend on 2 conditions:
1. You need to drop the object on a nested object instead of on the Layer (this is perhaps a user error? :mrgreen: )
2. The nested object you drop onto has to be of a certain type.

Note that it is technically possible for an object to be inside two layers. This can be done by changing the Group property of the Layer.

Code: Select all

OS: Windows 8.1 (6.3)
Word size of FreeCAD: 64-bit
Version: 0.20.26201 (Git)
Build type: Release
Branch: master
Hash: 9f2dd4a363053e87e1b1def0d005ed441d378796
Python version: 3.8.12
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: Dutch/Netherlands (nl_NL)
Attachments
lyr-test-roy.FCStd
(13.72 KiB) Downloaded 30 times
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: layer assignment problem, one object two layer

Post by Roy_043 »

If you repeat the experiment with groups instead of layers you will see that dropping onto a non-group object inside a group does not work either. But the problem is handled better. There is a warning: "Object can only be in a single Group" (which does not seem correct for the situation) and nothing else happens.
User avatar
saso
Veteran
Posts: 1920
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: layer assignment problem, one object two layer

Post by saso »

This implementation to support layers in FreeCAD is IMO completely wrong and is in conflict with the tree management of the model elements (this are and should be two completely different things/systems). The correct way to implement it would be to add a property to all the objects, similar to how for example realthunder did for "shadow style" property in his link branch, instead the existing "group" elements were reused, that are used (or at least should be) to managed the tree structure...

I also know that the reason (or at least part of) why this was done like this is because it was at that time shown and suggested as an example how layers are managed and represented to the user in Creo, they "look" similar with a tree of elements under layers, BUT even in Creo this is a separate view that represents only the layer property of the elements and is not mixed with the general tree of elements (and their features) of the model. Similar for example also in more general cad systems like AutoCAD, layers have their own management view, but there, all the drawing/model elements are not shown...

Like with a few other things in FreeCAD the proper "cad system architecture" is not really well considered before implementation, instead a quick workaround is chosen that maybe "looks" ok, but does not really function as it should and unfortunately instead of properly fixing such things at the core, often only additional workarounds are created on top and around of it.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: layer assignment problem, one object two layer

Post by bernd »

saso wrote: Wed Oct 27, 2021 10:36 am This implementation to support layers in FreeCAD is IMO completely wrong and is in conflict with the tree management of the model elements (this are and should be two completely different things/systems). The correct way to implement it would be to add a property to all the objects, similar to how for example realthunder did for "shadow style" property in his link branch, instead the existing "group" elements were reused, that are used (or at least should be) to managed the tree structure...
In short ... In your opinion the layer in Arch should be implemented the same way as Materials in Arch.

I would not say it is completely wrong, but IMHO it would make sense to thing about if it would be better to implement Layer the same way as Materials.

cheers bernd
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: layer assignment problem, one object two layer

Post by bernd »

Roy_043 wrote: Wed Oct 27, 2021 7:42 am If you repeat the experiment with groups instead of layers you will see that dropping onto a non-group object inside a group does not work either. But the problem is handled better. There is a warning: "Object can only be in a single Group" (which does not seem correct for the situation) and nothing else happens.
This is what I would have expected on my example too.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: layer assignment problem, one object two layer

Post by yorik »

The layers system is designed to break apart from the tree system. That's a feature and not a bug. You must be able to group your objects in one way, and have your layers follow a completely different organization. I also don't like forcing all objects to follow a rule that is created by one particular structure. Some people don't care about layers. Some other modules will want to implement this differently. If we have layers, it's those layers that take care of their own stuff, they don't force all FreeCAD to bend to them. For me that's an important feature of FreeCAD and a big part of its modularity. I feel really uneasy with modifying core objects all the time for particular purposes.

The materials system is not perfect either. Many FreeCAD objects don't care about materials. Some people even consider materials to be something else. But I think the right way to do things is to implement things a non-intrusive way, and progressively "convince" others to adopt it ;)

That said, indeed it shouldn't be possible for an object to be part of two layers. That's indeed a bug :)
User avatar
thomas-neemann
Veteran
Posts: 11801
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: layer assignment problem, one object two layer

Post by thomas-neemann »

yorik wrote: Fri Oct 29, 2021 11:06 am .... For me that's an important feature of FreeCAD and a big part of its modularity. I feel really uneasy with modifying core objects all the time for particular purposes.....
complete agreement
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: layer assignment problem, one object two layer

Post by yorik »

Now, something else, it should be possible (optionally, of course ;) ) to "clean" the tree a little bit, by hiding these "unseen"objects (layers, materials) from it, and offering another UI to manage them. I think since one of RT's merges it is possible to have objects not appearing in the tree...
Post Reply