Geometric Modeler |
Topology |
The Boolean OperatorsBest Practices |
Technical Article |
AbstractThe Boolean operators are the base operations of a topological modeler: they allow the user to add, subtract or intersect topological objects, called bodies. They are very sensitive to the geometry of overlapping areas, that is, the place where the skins of the two objects are the same or nearly the same. This article presents best practices to handle the overlapping areas, in order to optimize the use of the Boolean operators. |
The Boolean operators add, subtract or intersect topological objects (called bodies, see [1]). Moreover, these basic operations can be combined to perform more complex one such a split, sewing or trim.
The Boolean operators proceed in three steps:
Fig. 1 illustrates the way Boolean
operators proceed, by taking the example of the difference operator.
The specificity of each operator are taken into account during the second step:
|
When parts (such as "A and B" in Fig. 1), common to both input bodies, have to be kept, they are "simplified": they are taken as a single part in the final result.
The basic Boolean operators are exposed through the CATDynBoolean class.
[Top]
The Boolean operators perform intersections to compute the paths, and then split the input bodies into different parts. When the intersections between the two bodies are frank, the operator is easily executed: it finds a point, if two edges are intersected, an edge if two faces are intersected, or a face if two volumes are intersected.
But imagine now that the two bodies have part of their boundaries that are geometrically confused. In this case, the intersection may give an edge when intersecting two edges, or a face when intersecting two faces.
These case are sensitive: they slow down the execution, and may lead to results of lesser quality: creation of small numerous elements, as an example.
Fig. 2 depicts some overlapping cases.
But the overlapping areas can be often avoided, by following some rules that are described in the next section.
[Top]
Some simple rules can help you to optimize your use of the Boolean operators:
[Top]
The idea is to change the shape of one of the operands (or both) to suppress the overlapping, without changing the final result.
[Top]
A geometric element is shared if several cells directly refer it. In this case the intersections between the cells referring the same geometric element are not run and the overlap is treated as a logical information.
A logical information can also be put directly by specialized operators, that precisely know the build of their object. It is the goal of the next section.
[Top]
If you write your own operator, match the cells that you know they will refer the same geometry. The matching can be down by the means of transient attributes, see [2] to learn how to use them.
[Top]
The idea is to use operator of higher level, instead of chaining several basic Boolean operators, and creating overlap situations.
[Top]
The split operator removes matter that is on a given side of the object to split.
The split operator offers you two versions, according to the type of object you want to split:
Both ask for the side on each operand, on which the matter has to be kept.
[Top]
Sewing means joining together a surface and a body. This capability consists in computing the intersection between a given surface and a body while removing useless material (such as a split operation). Moreover, material is added to the body if the intersection paths define closed contours. This operator is managed by the CATSewing class.
Take the example of Fig. 5, that is again displayed besides. | |
The Pad material that is upside the Surface is removed.
Moreover, the intersection path on the upper face is closed. So that the
dome is that is defined by this way is added to the initial Pad.
Notice that in this case, choosing to remove the matter that is below the Surface does not lead to a correct result: it would twist the resulting body. |
[Top]
The Trim operation is a way to shrewdly tune the parts to be kept or removed after the computation of the intersection paths. Three majors rules govern this operator:
The "keep" and "remove" stamps can be put on both input bodies, but must be consistent. The common parts are always kept.
There are two classes to handle the trim operation:
[Top]
Some primitives such as Pad or Revolute are defined as the extrusion or rotation of a contour. You can define the height of a Pad by giving a numerical number or by defining it logically: the Pad ends as it encounters a given surface. In this last case, the operator that creates the Pad (CATTopPrism) uses the logical information and does not compute useless intersections. Moreover, it allows you to directly chain the Boolean operation in a single execution (SetBooleanResult method).
The Case "b" is a better way to proceed: it allows you to give a logical information to the prism operator, that is used to avoid useless computations. |
[Top]
[Top]
[1] | Topology Concepts |
[2] | The Management of Foreign Data |
[Top] |
Version: 1 [Mar 2000] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.