Complex Attribute Boolean Conditions
List of: Discussion Topic
Subjects: Attributes
Contents: Kernel

The split and merge functions do not address all changes to complex attributes. In Figure 3-6, assume that both faces A and B have instances of the same complex attribute. During a unite of the "tool" body containing face A with the "blank" body containing face B, the attribute on B is notified of a split. However, face A does not participate in the Boolean because it is neither split nor merged. Therefore, after the Boolean, the face A body pointer is still pointing at the now deleted tool body. This must be repaired after the Boolean.


Figure 3-6. Complex Attribute

Because the virtual functions do not solve all of these problems, the programmer must be aware that the application may have to do extra work. The application may have to scan the resulting body to determine whether attributes have been updated, and update them where necessary.

For example, assume you have two blocks, and each block uses a simple attribute to identify each FACE. Now subtract one block (the tool), as shown in the figure below. This subtraction creates three new FACEs in the blank.


Figure 3-7. bool:subtract

During a Boolean operation, the blank and tool faces are split where they intersect. Each split creates a new face and one or more edges. By default, the new faces have no attributes. Later in the Boolean, containment is determined and the faces which are not part of the result are lost. There is no guarantee which faces will be lost. In some cases it will be the original and in others the faces created by the split.

So in this example, if you need to have the attributes which are tagged to the tool FACEs automatically be transferred to the corresponding new FACEs created in the blank, it can not be done directly. To do that, you would override the split_owner method of the attributes. In that method, make a copy of the attribute and put it on the face being created by the split.
PDF/KERN/03ATT.PDF
HTM/DATA/KERN/KERN/03ATT/0023.HTM