5.4. Sculpting Your Model with Boolean Operations

Boolean algebra provides a means for combining sets of data, using such logical operators as intersect, union, subtract, etc. The Mechanical APDL program allows you to apply these same Boolean operators to your solid model, so that you can modify your solid model constructions more easily.

You can apply Boolean operations to almost any solid model construction, whether it was created from the top down or from the bottom up. The only exceptions are that Boolean operations are not valid for entities created by concatenation (see Free or Mapped Mesh) and that some Boolean operations cannot always be performed on entities that contain degeneracies. (See Solid Model Loads later in this chapter.)

Also, all solid-model loads and element attributes should be defined after you complete your Boolean operations. If you are using Booleans to modify an existing model, you should take care to redefine your element attributes and solid-model loads.


Note:  Boolean operations and other solid modeling operations can be unreliable, either failing to work or corrupting/contaminating the database. You should SAVE a copy of your database before a Boolean operation in order to cleanly recover from a failure. See Considerations and Cautions for Solid Modeling for additional information.


5.4.1. Boolean Operation Settings

You can specify Boolean operation options using the BOPTN command (Main Menu> Preprocessor> Modeling> Operate> Booleans> Settings).

When you perform a Boolean operation on two (or more) entities, you are faced with the decision of whether or not you want to keep the original entities. You can control this action with the KEEP label of the BOPTN,Lab,Value command, as illustrated schematically in Figure 5.18: Boolean Keep Options:

Figure 5.18: Boolean Keep Options

Boolean Keep Options

Boolean operations on lower-order entities that are attached to higher-order entities are generally permitted.

Boolean operations cannot be performed on meshed entities. You must clear the mesh from the entity before performing the Boolean operation.

The label NWARN on the BOPTN command allows you to control warning messages. A value of "0" will result in a warning message if a Boolean operation has no effect. A value of "1" will suppress all warning or error messages if a Boolean operation has no effect. A value of "-1" will allow error messages if a Boolean operation has no effect. The default value of this label is "0".

The VERSION label can be used to control which numbering scheme Mechanical APDL uses to number the entities produced by Boolean operations. By default, Mechanical APDL numbers entities using the Revision 5.2 numbering scheme, but you can force Mechanical APDL to use the Revision 5.1 numbering scheme instead. Normally, you will want to use the default numbering scheme when running Revision 5.2 or newer versions. However, if you are reading input that was created at Revision 5.1, you should activate Revision 5.1 numbering (BOPTN,VERSION,RV51) before reading in the file (/INPUT) so that the input will run properly.


Note:  A command input stream created at Revision 5.1 may produce different entity numbering at Revision 5.2 or Revision 5.3 unless the Revision 5.1 numbering scheme is specified (BOPTN,VERSION,RV51).


The label DEFA will reset all BOPTN settings to default values. The label STAT lists the status of present settings.

5.4.2. Entity Numbering After Boolean Operations

The numbering scheme assigns numbers to Boolean output entities based on information relating to their topology and geometry. The topology information used for an area, for example, includes the number of loops it is defined by, the number of lines (that is, 3-sided area, 4-sided area, etc.) making up the area, the line numbers of any original lines (lines existing before the Boolean operation) in the area, keypoint numbers of any original keypoints, etc. The geometry information used for an area consists of the coordinates of its centroid, endpoints, and other "control points" relative to some arbitrary reference coordinate system. "Control points" are defined by the NURBS used to parametrically describe your model. The numbering scheme first assigns numbers (beginning with the next available number) to those output entities that can be uniquely identified by their topology. Any remaining entities are then assigned numbers based on their geometry. Unfortunately, entity numbering based on geometry may not be consistent across runs where the geometry changes. Therefore, when geometry-based entity numbering occurs, the program issues the following warning message:

*** WARNING ***

Entity numbers from the Boolean operation were assigned based on geometry.
If you are planning to do optimization, (or input looping), do not rely 
on the entity numbers for loads, etc.  To suppress this warning, issue "BOPT,NWARN,0".

5.4.3. Intersect

An intersection defines a new set of entities which is common to every original entity included in the operation. In other words, an intersection represents the region of overlap of two or more entities. The new set can be of the same or lower dimension as the original entities. For instance, the intersection of two lines can be a keypoint (or a set of keypoints), or it can be a line (or set of lines). The Boolean intersect commands are as follows:

Create the intersection ofCommand
lines LINL
areas AINA
volumes VINV
a line with an area LINA
an area with a volume AINV
a line with a volume LINV

5.4.3.1. Illustrations of Intersection Operations

The following figures illustrate the intersection operations listed above:

Figure 5.19: LINL (Line Intersect Line)

LINL (Line Intersect Line)

Figure 5.20: AINA (Area Intersect Area)

AINA (Area Intersect Area)

Figure 5.21: VINV (Volume Intersect Volume)

VINV (Volume Intersect Volume)

Figure 5.22: LINA (Line Intersect Area)

LINA (Line Intersect Area)

Figure 5.23: AINV (Area Intersect Volume)

AINV (Area Intersect Volume)

Figure 5.24: LINV (Line Intersect Volume)

LINV (Line Intersect Volume)

5.4.4. Pairwise Intersect

A pairwise intersection defines a new set of entities which is any overlapping set of entities included in the operation. In other words, a pairwise intersection represents the region of overlap of at least any two of the original entities. The new set can be of the same or lower dimension as the original entities. For instance, the pairwise intersection of a set of lines can be a keypoint (or a set of keypoints), or it can be a line (or set of lines). The Boolean pairwise intersect commands are as follows:

Find the pairwise intersection ofCommand
lines LINP
areas AINP
volumes VINP

5.4.4.1. Illustrations of Pairwise Intersection Operations

Figure 5.25:  LINP (Line Intersect Pairwise), Figure 5.26:  AINP (Area Intersect Pairwise), and Figure 5.27:  VINP (Volume Intersect Pairwise) illustrate the pairwise intersection operations listed above:

Figure 5.25: LINP (Line Intersect Pairwise)

LINP (Line Intersect Pairwise)

Figure 5.26: AINP (Area Intersect Pairwise)

AINP (Area Intersect Pairwise)

Figure 5.27: VINP (Volume Intersect Pairwise)

VINP (Volume Intersect Pairwise)

5.4.5. Add

An addition of entities defines a new entity that includes all parts of the originals. (This operation is also known mathematically as a union, joining, or summation.) The resulting entity is a single seamless whole, containing no internal divisions. (As a practical matter, "added" entities will often not mesh as well as will "overlapped" entities.) Only volumes or coplanar 2D areas can be added in the Mechanical APDL program. Areas added may contain holes within the area (that is, internal loops). The Boolean add commands are as follows:

AddCommand
separate areas to create a single area AADD
separate volumes to create a single volume VADD

5.4.5.1. Illustrations of Addition Operations

The following figures illustrate the add operations listed above.

Figure 5.28: AADD (Add Areas)

AADD (Add Areas)

Figure 5.29: VADD (Add Volumes)

VADD (Add Volumes)

5.4.6. Subtract

If you subtract one entity (E2) from another (E1), you will obtain one of two results: Either you will create a new entity or entities (E1 - E2 E3) that is of the same dimensionality as E1 and that contains no overlap with E2, or, if the overlap is of a lower dimensionality, you will simply divide E1 into two or more new entities (E1 - E2 E3 and E4).

If the command field SEPO on the subtract command is set to blank (default), the subtraction of entities can result in lines with a common end point, or areas with a common line boundary, or volumes sharing a common boundary area. If the command field is set to "SEPO", the resulting entities will no longer share common boundaries but have distinct but coincident boundaries. This latter operation is not valid if the overlap of entities does not divide one of the input entities into at least two distinct lines, areas, or volumes. The Boolean subtract commands (and their corresponding GUI paths) are as follows:

SubtractCommand
lines from lines LSBL
areas from areas ASBA
volumes from volumes VSBV
areas from lines LSBA
volumes from lines LSBV
volumes from areas ASBV
lines from areas ASBL [1]
areas from volumes VSBA
  1. The SEPO field is not available on the ASBL command.

You can subtract multiple entities from a single entity. All entity subtraction commands are of the form eSBe, where "e" represents multiple or single entities.

You can set either entity field value of the subtract operation to ALL. If ALL is used in the minuend field, the entity or entities listed or picked in the subtrahend field will be removed from all selected entities. If ALL is used in the subtrahend field, all selected entities will be subtracted from those listed in the minuend field. If ALL is used in both minuend and subtrahend fields for subtraction of like entities, nothing will happen. That is, the result will be your input entities.

The KEEP(X) argument fields of the entity subtraction commands allow you to selectively keep or delete entities. For instance, the KEEPA and KEEPL arguments on the ASBL command allow you to keep or delete the areas and/or lines used in an ASBL operation. This is in contrast to the BOPTN,KEEP,Value command which demands you either keep or delete all input entities. The KEEPL and KEEPA arguments override previous settings made with the BOPTN command (Main Menu> Preprocessor> Modeling> Operate> Booleans> Settings). If these two fields are left blank, the default settings are controlled by the BOPTN command. The default setting for BOPTN is to delete all entities that are used as inputs to entity subtraction commands.

5.4.6.1. Illustrations of Subtraction Operations

Figure 5.30:  LSBL (Line Subtract Line) through Figure 5.37:  VSBA (Volume Subtract Area) illustrate simple entity subtraction operations. See the descriptions of the LSBL, ASBA, VSBV, LSBA, LSBV, ASBV, ASBL, and VSBA commands for more information.

Figure 5.30: LSBL (Line Subtract Line)

LSBL (Line Subtract Line)

Figure 5.31: ASBA (Area Subtract Area)

ASBA (Area Subtract Area)

Figure 5.32: VSBV (Volume Subtract Volume)

VSBV (Volume Subtract Volume)

Figure 5.33: LSBA (Line Subtract Area)

LSBA (Line Subtract Area)

Figure 5.34: LSBV (Line Subtract Volume)

LSBV (Line Subtract Volume)

Figure 5.35: ASBV (Area Subtract Volume)

ASBV (Area Subtract Volume)

Figure 5.36: ASBL (Area Subtract Line)

ASBL (Area Subtract Line)

Figure 5.37: VSBA (Volume Subtract Area)

VSBA (Volume Subtract Area)

The entity subtraction commands can have multiple inputs. You can subtract one entity from multiple entities, or you can subtract multiple entities from one entity. You may also subtract multiple entities from multiple entities. Figure 5.38:  LSBL (Multiple Line Subtract a Line) to Figure 5.45:  VSBA (Single Volume Subtract Multiple Areas) illustrate multiple entity subtractions.

Figure 5.38: LSBL (Multiple Line Subtract a Line)

LSBL (Multiple Line Subtract a Line)

Figure 5.39: ASBA (Multiple Area Subtract an Area)

ASBA (Multiple Area Subtract an Area)

Figure 5.40: VSBV (Multiple Volume Subtract a Volume)

VSBV (Multiple Volume Subtract a Volume)

Figure 5.41: LSBA (Multiple Line Subtract an Area)

LSBA (Multiple Line Subtract an Area)

Figure 5.42: LSBV (Multiple Line Subtract a Volume)

LSBV (Multiple Line Subtract a Volume)

Figure 5.43: ASBV (Multiple Area Subtract a Volume)

ASBV (Multiple Area Subtract a Volume)

Figure 5.44: ASBL (Multiple Area Subtract a Line)

ASBL (Multiple Area Subtract a Line)

Figure 5.45: VSBA (Single Volume Subtract Multiple Areas)

VSBA (Single Volume Subtract Multiple Areas)

5.4.7. Working Plane Subtract

The working plane can be subtracted from an entity to divide it into two or more entities. The working plane can be subtracted from lines, areas, and volumes by using the commands and GUI paths described below. For each of these subtract commands, the SEPO field can be used to determine whether the entities produced will have shared or coincident but separate boundaries. The KEEP field can be used to retain or delete input entities regardless of the setting of the BOPTN command.

The working plane is often used to cut up an existing model prior to map meshing. You can use any of the methods described in the following table to subtract the working plane from an entity.

Subtract the intersection of the working plane fromCommand
lines LSBW
areas ASBW
volumes VSBW

5.4.7.1. Illustrations of Working Plane Subtraction Operations

The following figures illustrate the working plane subtraction operations listed above:

Figure 5.46: LSBW (Line Subtract Working Plane)

LSBW (Line Subtract Working Plane)

Figure 5.47: ASBW (Area Subtract Working Plane)

ASBW (Area Subtract Working Plane)

Figure 5.48: VSBW (Volume Subtract Working Plane)

VSBW (Volume Subtract Working Plane)

5.4.8. Classify

Classification is similar to subtraction, except that both the original entities are replaced by new entities. At present, only line-line classification is possible in the Mechanical APDL program. To perform line-line classification, use the LCSL command. You cannot access the LCSL command directly in the GUI. The following figure illustrates the classification operation.

Figure 5.49: LCSL (Line Classify Line)

LCSL (Line Classify Line)

5.4.9. Overlap

The overlap commands will join two or more entities to create three or more new entities that encompass all parts of the originals. The end result is similar to an "add" operation, except that boundaries will be created around the overlap zone. Thus, the overlap operation produces a number of relatively uncomplicated regions, as compared to the single relatively complicated region created by the add operation. For this reason, overlapped entities will often mesh better than added entities.

Overlapping is valid only if the overlap region has the same dimensionality as the original entities. The Boolean overlap commands (and their corresponding GUI paths) are as follows:

OverlapCommand
lines LOVLAP
areas AOVLAP
volumes VOVLAP

5.4.9.1. Illustrations of Overlap Operations

The following figures illustrate the overlap operations listed above:

Figure 5.50: LOVLAP (Line Overlap Line)

LOVLAP (Line Overlap Line)

Figure 5.51: AOVLAP (Area Overlap Area)

AOVLAP (Area Overlap Area)

Figure 5.52: VOVLAP (Volume Overlap Volume)

VOVLAP (Volume Overlap Volume)

5.4.10. Partition

The partition commands will join two or more entities to create three or more new entities that encompass all parts of the originals. The end result is similar to an "overlap" operation if the overlap is of the same dimensionality as the original entities. However, unlike the overlap operations, non-overlapping input entities will not be deleted. The Boolean partition commands are as follows:

PartitionCommand
lines LPTN
areas APTN
volumes VPTN

5.4.10.1. Illustrations of Partition Operations

Figure 5.53:  LPTN (Line Partition), Figure 5.54:  APTN (Area Partition), and Figure 5.55:  VPTN (Volume Partition) illustrate partition operations. See the descriptions of the LPTN, APTN, and VPTN commands for more information.

Figure 5.53: LPTN (Line Partition)

LPTN (Line Partition)

Figure 5.54: APTN (Area Partition)

APTN (Area Partition)

Figure 5.55: VPTN (Volume Partition)

VPTN (Volume Partition)

5.4.11. Glue (or Merge)

Glue is similar to overlap, except that it applies only to cases in which the intersection between entities occurs at a boundary, and is one dimension lower than the original entities. The entities maintain their individuality (they are not "added"), but they become connected at their intersection (they "talk" to each other), as shown in the illustrations below. The Boolean glue commands (and their corresponding GUI paths) are as follows:

Generate newCommand
lines by "gluing" lines LGLUE
areas by "gluing" areas AGLUE
volumes by "gluing" volumes VGLUE

5.4.11.1. Illustrations of Glue Operations

The following figures illustrate the glue operations listed above:

Figure 5.56: LGLUE (Line Glue Line)

LGLUE (Line Glue Line)

Figure 5.57: AGLUE (Area Glue Area)

AGLUE (Area Glue Area)

Figure 5.58: VGLUE (Volume Glue Volume)

VGLUE (Volume Glue Volume)

5.4.12. Alternatives to Boolean Operations

Boolean operations can sometimes be relatively slow and expensive. As a general guideline, if you can replace a Boolean command with another, similarly convenient command, do so. Some of the alternative procedures that can sometimes be used in place of Booleans are described below.

Dragging and Rotating: A complicated prismatic or cylindrical volume might be defined just as conveniently, but more efficiently, using VDRAG and VROTAT (as described below) in place of Boolean operations. A good example would be a model of a block with a number of holes drilled through it.

Extruding and Offsetting: A 2D cross section can also be offset or extruded into a 3D volume using VEXT and VOFFST (as described below). See Creating Your Solid Model from the Bottom Up earlier in this chapter, which also discusses how to extrude, offset, rotate, or drag meshed areas into meshed volumes.

Utilizing the Options on Primitive Commands: A number of primitive commands allow you to define a relatively complicated shape in a single command. For example, you can create a hollow spherical segment of specified wall thickness, using a single SPHERE command (Main Menu> Preprocessor> Modeling> Create> Volumes> Sphere> By Dimensions):

Figure 5.59: Hollow Spherical Segment Created With One Command

Hollow Spherical Segment Created With One Command

It is clear from this example how exercising the full ability of one primitive command can sometimes save the expense of performing several Boolean operations.