Introduction to Booleans   

<<< Imprinting and Curve Projection Chapters Manifold Booleans >>>

Contents

[back to top]


51.1 Introduction

This chapter introduces you to the boolean operations available in Parasolid.

Boolean operations carried out when general topology is disabled in a session are referred to as manifold booleans. The input bodies to this type of boolean must be manifold bodies and any result bodies will also be manifold. Boolean operations on either general or manifold bodies that may result in general bodies are referred to as general booleans. It is assumed that you are familiar with the characteristics of the various body types, as explained in Chapter 15, “Body Types”.

 

Note: When performing boolean operations, we strongly recommend that you set local coordinate systems to be the same as the Parasolid coordinate system wherever possible.

 

Note: This functionality offers partial support for facet geometry. See the PK Interface Programming Reference Manual for more information.

 

Related Topics:

[back to top]


51.2 The three basic boolean operations

The basic boolean operations are analogous to mathematical set operations:

 

Figure 51-1 Basic boolean operations

For an example of this functionality, see the code example in the C#\ExampleApplication.Net\Code Examples\Modelling\Booleans located in example_applications in your Parasolid installation folder.

[back to top]


51.3 Terminology

This section introduces you to the terminology used in Parasolid’s boolean operations.

51.3.1 Target and tool

The operands of a boolean are called the target and the tool. The target of a boolean is the body you begin with, and the tool is the body you operate on it with. The target is modified by the tool, and the tool is deleted at the end of the operation. Parasolid preserves the tags of entities in the target as far as possible.

The following diagram shows the effect of swapping the target and tool of subtract:

 

Figure 51-2 Target, tool and result bodies on boolean subtraction

This is important when we come to consider booleans between bodies of different types.

 

Note: If you are performing boolean operations on a single target with many tools, we recommend using a single multi-tool boolean.

51.3.2 Tag persistence during boolean operations

The rules for the persistence of tags described in Section 2.4.2, “Tags”, apply during boolean operations. However, tag persistence is disabled if normal attribute callbacks are registered and used. See Section 94.3, “Callback functions”, for more information.

51.3.3 Global booleans

A global boolean involves comparing all face pairs from the target and tool bodies.

Global booleans are performed using PK_BODY_boolean_2, which requires one target body, one or more tool bodies and an options structure. If more than one tool body is supplied, the union of overlapping tools is computed first and then the boolean between the target and the tools is performed. For intersect boolean operations, the intersection of one target and two tools is the intersection between the target and the result of uniting two tools rather than the mutual intersection between the three bodies.

For an example of this functionality, see the code example in the C++\Code Examples\Modelling\Booleans\Global folder, located in example_applications in your Parasolid installation folder.

 

Note: You can perform global booleans on any combination of manifold solid and sheet bodies, wire bodies and general bodies, so long as target and tools have no acorn vertices. For more information about performing booleans with general bodies, see Chapter 53, “General Booleans”.

51.3.4 Local booleans

A local boolean involves comparing selected face pairs in the target and tool bodies. This form of boolean operation is quicker than a global boolean but does not guarantee topological consistency on the resulting bodies.

Local booleans are performed using PK_FACE_boolean_2, which requires one or more faces from a single target and tool body and an options structure. Local booleans using general bodies are not supported.

For an example of this functionality, see the code example in the C++\Code Examples\Modelling\Booleans\Local folder, located in example_applications in your Parasolid installation folder.

 

Note: Both PK_BODY_boolean_2 or PK_FACE_boolean_2 may return a status code of PK_boolean_result_failed_c following a failure, with a return code of PK_ERROR_no_errors from the function. In these cases, the model might be left in an invalid state. We therefore recommend that, if PK_boolean_result_failed_c is returned from a call to either of these functions, you roll back to a valid state of the model. For more information, see Section 120.3, “Failure status codes”.

51.3.5 Boundary regions

In order to perform boolean operations, edges are imprinted on the target and tool to denote the intersecting parts of the two bodies. These imprinted edges divide the boundaries of the bodies into boundary regions.

Suppose the bodies shown in Figure 51-3 are used to perform a global and local boolean respectively.

 

Figure 51-3 Bodies used in a simple union

For global booleans, all the boundary regions of the tool bodies lie either completely inside or completely outside of the target body, as shown in Figure 51-4.

 

Figure 51-4 Boundary regions for global booleans

For local booleans, because not all faces of both bodies are used to compute the imprinted edges, boundary regions of the tool body are classified as inside if they are locally inside the target body near a loop of imprinted edges, and are classified as outside if they are locally outside near the loop of imprinted edges, as shown in Figure 51-5. Options are provided for you to select which regions are to be excluded or included in a local boolean: see Section 51.4.2, “Selecting regions in local booleans”.

 

Figure 51-5 Boundary regions for local booleans

[back to top]


51.4 Options for booleans

You can modify the behaviour of PK_BODY_boolean_2 (global booleans) and PK_FACE_boolean_2 (local booleans) using an options structure passed to each function. The options structures for these functions are different, but have a large number of identical options.The following table lists the options in these functions and indicates which ones can be used for global, local, manifold or general booleans:

 

Option

Global

Local

Manifold

General

function

*

*

*

*

configuration

*

*

*

 

default_tol

*

*

*

*

max_tol

*

*

*

*

matched_region

*

*

*

*

selected_topolset

*

 

*

 

select_region

 

*

*

 

target_material_side

*

*

*

 

tool_material_side

*

*

*

 

imprint_complete_targ

*

*

*

*

imprint_complete_tool

*

*

*

*

target_face_overflow

*

*

*

 

tool_face_overflow

*

*

*

 

extend_face_list

 

*

*

 

limit_target_faces

 

*

*

 

limit_tool_faces

 

*

*

 

imprint_overlapping

*

 

*

 

merge_imprinted

*

*

*

 

selective_merge

*

*

*

 

keep_target_edges

*

*

*

*

merge_attributes

*

*

*

 

merge_in_solid

*

 

 

*

merge_in_solid_dimension

*

 

 

*

merge_in_face

*

 

 

*

merge_in_face_dimension

*

 

 

*

merge_in_edge

*

 

 

*

merge_tools

*

 

 

*

impose_bodies

*

 

 

*

prune_in_void

*

 

 

*

nm_edge_repair

*

 

*

 

blend_radius

*

 

*

 

stop_self_intersection

 

*

*

 

resulting_body_type

*

*

*

*

allow_disjoint

*

*

*

 

tracking

*

*

*

*

tracking_type

*

*

*

*

track_regions

*

 

 

*

flag_no_effect

*

*

*

 

check_fa

*

*

*

*

fence

*

*

*

 

update

*

*

*

*

The following table provides a summary of the options found in PK_BODY_boolean_2 and PK_FACE_boolean_2.

 

Option

Description

function

The boolean operation to be performed: union, subtraction or intersection. Default: PK_boolean_unite_c

configuration

A sub-structure that describes the configuration of the target and tool bodies.

Default: NULL

See Section 51.4.1, “Optimising local and global boolean operations” for more information.

default_tol

The default tolerance to which the boolean operation, if it has to, may approximate entities or assume that entities are coincident.

When performing global booleans with wire bodies, this option has no effect. Instead, set a tolerance on the vertices, using PK_VERTEX_set_precision.

Default: 1.0e-5

max_tol

The maximum tolerance which may be applied to any entity involved in the boolean operation.

Default: 0.0

matched_region

A sub-structure that describes how matching between the target and tool bodies should be performed. See Section 51.4.5, “Matched topology in local and global boolean operations” for more information.

Default: NULL

selected_topolset

A sub-structure for global booleans that is used to identify regions of the input bodies to be included in or excluded from the result body. See Section 51.4.3, “Selecting regions in global booleans”, for more information.

Default: NULL

select_region

A sub-structure for local booleans that is used to identify regions of the input bodies to be included in or excluded from the result body. See Section 51.4.2, “Selecting regions in local booleans”, for more information.

Default: NULL

target_material_side

Force the target to be treated as a solid or a sheet, or allow it to be treated according to its actual body type.

Default: PK_boolean_material_default_c.

See Section 51.4.14, “Specifying the body type of tool and target”, for details.

Not supported for general booleans. See Section 53.6, “Unsupported options”.

tool_material_side

Force the tool to be treated as a solid or a sheet, or allow it to be treated according to its actual body type.

Default: PK_boolean_material_default_c

See Section 51.4.14, “Specifying the body type of tool and target”, for details.

Not supported for general booleans. See Section 53.6, “Unsupported options”.

imprint_complete_targ

Turn imprint completion on and off for the target.

Default: PK_imprint_complete_no_c

See Section 51.4.13, “Imprint completion”, for details.

imprint_complete_tool

Turn imprint completion on and off for the tool.

Default: PK_imprint_complete_no_c

See Section 51.4.13, “Imprint completion”, for details.

target_face_overflow

How to process the overflow from a target body onto a tool body at the laminar edge of the target body. To use this option, imprint_complete_tool must be set to PK_imprint_complete_no_c.

Default: NULL

See Section 51.4.6, “Overflow imprints at boundaries” for more information.

tool_face_overflow

How to process the overflow from a tool body onto a target body at the laminar edge of the tool body.To use this option, imprint_complete_targ must be set to PK_imprint_complete_no_c.

Default: NULL

See Section 51.4.6, “Overflow imprints at boundaries” for more information.

extend_face_list

A local boolean receives a subset of the faces of a target and/or tool body. If the imprinting phase of the boolean results in incomplete loops of imprinted edges, this option specifies whether to use additional target and/or tool faces in an attempt to complete the loop.

Default: PK_imprint_face_list_no_c.

See Section 51.4.9, “Extending face lists during local booleans” for more information.

limit_target_faces

Limits the faces on the target body to be deleted. See Section 51.4.14, “Specifying the body type of tool and target” for more information.

Default: PK_LOGICAL_false.

limit_tool_faces

Limits the faces on the tool body to be deleted. See Section 51.4.14, “Specifying the body type of tool and target” for more information.

Default: PK_LOGICAL_false.

imprint_overlapping

Whether to imprint the boundaries of overlapping areas.See Section 51.4.7, “Imprinting the boundaries of overlapping areas” for more information.

Default: PK_LOGICAL_false.

merge_imprinted

Whether all mergeable imprinted edges on the result body that were imprinted by the boolean operation are merged.

Default: PK_LOGICAL_false.

See Section 51.4.13, “Imprint completion” for more information.

selective_merge

Modify the edge merging behaviour. The merge phase avoids merging edges in the imprint that existed and were mergeable before the start of the boolean.This option should be used in conjunction with merge_imprinted .

Default: PK_LOGICAL_false.

See Section 51.4.13, “Imprint completion” for more information.

keep_target_edges

Specify the edge that survives when a target edge and tool edge coincide during a boolean operation. This can be one of:

  • PK_LOGICAL_false: The older edge (with the smallest tag) survives. This is the default.
  • PK_LOGICAL_true: The target edge survives, unless both (a) the target edge is a new edge imprinted during the boolean, and (b) the tool edge was already present; in which case the tool edge survives.

If both faces adjacent to the tool edge survive, then the tool edge survives, regardless of the value of this option. If generalised topology is on, the target edge always survives.

Default: PK_LOGICAL_false

merge_attributes

Whether face attributes are merged during the boolean operations.

Default: PK_LOGICAL_false

See the PK Reference documentation for more information.

Note: This option only takes effect when general topology is disabled. Attributes on coincident faces are always merged when general topology is enabled. (General topology is disabled by default when you start your Parasolid session.)

merge_in_solid
merge_in_solid_dimension

merge_in_solid specifies whether to merge out topologies which become surrounded by solid during the boolean operation.

Default: PK_LOGICAL_false.

See Section 53.3, “Merging redundant topology” for more information.

merge_in_solid_dimension determines the highest dimension of topologies surrounded by solid to be merged out when merge_in_solid is PK_LOGICAL_true.

Default: PK_TOPOL_dimension_any_c

See Section 53.3, “Merging redundant topology” for more information.

Note: These options are only allowed when general topology is enabled.

merge_in_face
merge_in_face_dimension

merge_in_face specifies whether to merge out redundant vertices or edges within or between faces in the result body which were not redundant in the tool or target bodies. Default: PK_LOGICAL_false.

See Section 53.3, “Merging redundant topology” for more information.

merge_in_face_dimension determines the highest dimension of topologies imprinted within faces to be merged out when merge_in_face is PK_LOGICAL_true.

Default: PK_TOPOL_dimension_any_c

See the PK Reference documentation for more information.

Note: These options are only allowed when general topology is enabled

merge_in_edge

Whether to merge out redundant vertices between edges in the result body which were not redundant in the tool or target bodies.

Default: PK_LOGICAL_false.

See the PK Reference documentation for more information.

Note: This option is only allowed when general topology is enabled.

impose_bodies

Controls whether the target body can impose on the tool bodies or vice versa.

Default: PK_boolean_impose_no_c.

See Section 53.3.1, “Finer control over region survival and inheritance” for more information.

Note: This option is only allowed when general topology is enabled.

merge_tools

Whether to merge overlapping tools in a multi-tool boolean.

Default: PK_merge_tools_no_c.

See Section 53.3.1, “Finer control over region survival and inheritance” for more information.

Note: This option is only allowed when general topology is enabled.

prune_in_void

Whether to prune all void regions in the resulting body. Any faces, edges or vertices in the result body which are completely surrounded by void regions are deleted, so long as the result body contains some pieces of a higher dimension, e.g. a sheet face is only deleted if the result body contains at least one solid region.

Default: PK_LOGICAL_false.

See the PK Reference documentation for more information.

Note: This option is only allowed when general topology is enabled.

nm_edge_repair

Whether to attempt to repair certain configurations of non-manifold results. Default: PK_nm_edge_repair_no_c.

See Section 51.4.18, “Repairing non-manifold results using blends”.

Not supported for general booleans. See Section 53.6, “Unsupported options”.

blend_radius

The radius to use for the new blends constructed to repair non-manifold edges when using the nm_edge_repair option. See Section 51.4.18, “Repairing non-manifold results using blends”.

Default: 1.0e-5

Not supported for general booleans. See Section 53.6, “Unsupported options”.

stop_self_intersection

Whether to stop self-intersection of tool faces which survive the boolean. After imprinting, tool faces which survive the boolean are compared against all surviving faces of the target body.

Default: PK_LOGICAL_false.

resulting_body_type

Specify the type of body that is returned by global and local boolean operations.

Default: PK_boolean_prefer_original_c.

See Section 51.4.17, “Specifying the body type of the result”, for details.

allow_disjoint

Whether to return a single disjoint body if the operation would result in more than one body.

Default: PK_LOGICAL_false.

See the PK Reference documentation for more information.

tracking

Whether to request additional tracking data on the boolean result.

Default: PK_LOGICAL_false.

tracking_type

Allows you to specify the level of information you want the tracking records for the boolean operation to contain.

Default: PK_boolean_track_type_basic_c.

See Section 51.4.15, “Tracking imprinted edges” for more information.

track_regions

Allows you to track regions when performing boolean operations. See Section 51.4.16, “Tracking regions” for more information.

Default: PK_region_track_no_c

Not supported for manifold booleans. See Section 52.1, “Introduction”.

flag_no_effect

Determine whether the original target body was unaffected by the tools. Default: PK_boolean_no_effect_basic_c.

check_fa

Whether to check faces involved in the boolean operation. Only faces which are adjacent to imprinted edges are checked.

Default: PK_boolean_check_fa_yes_c.

fence

Modify the behaviour of the subtract operation and determine which resultant bodies are returned when performing solid/ sheet (trimming) or sheet/solid (punching) boolean operations. It is recommended that you use tool_material_side and target_material_side when performing fencing operations.

Default: PK_boolean_fence_none_c.

See Section 51.4.14, “Specifying the body type of tool and target”, for details.

Not supported for general booleans. See Section 53.6, “Unsupported options”.

update

Update switch to maintain consistency when rebuilding models built in older versions of Parasolid.

Default: PK_boolean_update_default_c.

See Section 51.4.19, “Update control”, for more information.

51.4.1 Optimising local and global boolean operations

If the boolean operation involves instancing, i.e. a boolean operation which takes a single target body and a list of tool bodies, e.g. when drilling an array of holes in a body, the performance of the operation can be improved by using one of the following instancing options in the configuration option sub-structure:

 

Option

Description

no_tool_intersect

This option can be set when the set of tool bodies are known not to intersect each other, though they are allowed to clash with existing edges on the target (including the periphery edge). This option can also be set for subtract and intersect operations when the tool bodies do not intersect within the target region.

no_loop_intersect

This option can be set when there is no interference between any instances and the existing edges of the target, though the tools can clash with each other

 

Figure 51-6 Situations in which instancing can be optimised during boolean operations

For a more efficient method of instancing when only a single tool body and a single target body are involved use PK_FACE_boolean_2 or PK_FACE_instance_bodies. PK_FACE_instance_bodies can also be used when you are using multiple tools.

These options are not supported for general booleans. See Section 53.6, “Unsupported options”.

51.4.2 Selecting regions in local booleans

 

Note: In this section, the term “region” refers to a boundary region as described in Section 51.3.5, “Boundary regions”, rather than a topological region as described in Chapter 14, “Model Structure”. A boundary region is a face set which lies wholly inside or outside the target or tool body. Tool faces which intersect the target body are split by the local boolean, and vice versa: the resultant faces lie wholly inside or outside the target body, or tool body, respectively.

As described in Section 51.3.5, “Boundary regions”, boundary regions in the context of global booleans are always completely specified: regions that are included or excluded in the resulting body are always unambiguously defined. In local booleans, however, it can be unclear as to which regions should be included in the resulting body, and which should be excluded.

To address this problem, Parasolid lets you identify boundary regions in either the target or tool body that are to be included in or excluded from the result of a local boolean. You can do this using the select_region structure of PK_FACE_boolean_o_t.

The select_region structure identifies either all the regions in the result that you want to keep, all the regions you want to throw away, or a combination of both. Each region is identified by a single face, edge or vertex which is interior to it.

For an example of this functionality, see the code example in the C++\Code Examples\Modelling\Booleans\Boolean with Selectors folder, located in example_applications in your Parasolid installation folder.

 

Note: The select_region structure is ignored by PK_FACE_instance_tools in cases where there is more than one instance, unless all configuration options are true. See Section 54.2.2, “Improving the performance of instancing operations”, for more information.

The structure contains the following fields:

 

Option

Description

select_type

Whether to include or exclude the specified regions, or have a combination of both.

selectors

An array of faces, edges, or vertices, each of which uniquely identifies a single region. Sometimes, a face may not unambiguously identify the region to be included or excluded. In this case, it can be associated with an element in the help points array. You should ensure that any faces associated with help points are specified first in the array.

help_points

An optional array of help points (vectors) which, when combined with the corresponding face in the selectors array, unambiguously identifies a region. The first element in this array is associated with the first element in selectors , the second element with the second element in selectors , and so on. You should specify PK_ENTITY_null if you do not want to specify a help point for a corresponding element in selectors .

selector_types

An optional array that describes the type of each region specified in the selectors array. The first element describes the type of the first region in selectors , the second element describes the second region, and so on. The following choices are available:

  • Whether the region is allowed to be on or adjacent to any edges that are imprinted as a result of the boolean.
  • Whether to propagate the value of the select_type field in cases where the region is split by any edges imprinted as a result of the boolean

region_types

An optional array that is used in conjunction with select_type . If select_type is PK_boolean_mixed_selection_c, you can choose to include some regions on one body and exclude some regions on another body. All regions of the same body must have the same value (i.e all regions on the body are either included or excluded)

Figure 51-7 illustrates the effect of defining regions to exclude during a local boolean. Two regions have been defined for the tool body, by specifying face 1 and face 2 in the selectors array. The select_type field is set to PK_boolean_exclude_c to ensure that these regions are excluded from the result. No help points are required, because both face 1 and face 2 lie completely inside a region created by combining the target and tool, ensuring that the regions to exclude are defined unambiguously

 

Figure 51-7 Excluding regions in a local boolean

Figure 51-8 illustrates the effect of defining regions to include. Here, face 1 from the tool is passed to the selectors array to define a single boundary region, and select_type is set to PK_boolean_include_c. Any other boundary regions in the tool are excluded from the resulting body.

 

Figure 51-8 Including regions in a local boolean

Figure 51-9 illustrates the effect of specifying help points to unambiguously define a region. A region has been defined for the tool body, by specifying face 1 (which is also the face used for the boolean operation itself) in the selectors array. The select_type field is set to PK_boolean_include_c to ensure that the region is included in the result.

Specifying this region without help points causes the boolean to fail, because face 1 lies in several of the regions that are created by combining the target with the tool (in fact, it lies in all the possible regions). The boolean can be made to succeed by specifying a help point which lies in the region that you want to include.

 

Figure 51-9 Using help points to identify regions in a local boolean

51.4.3 Selecting regions in global booleans

Using the selected_topolset option, you can alter the result of a boolean operation by choosing to keep or discard topolsets in the target or tool body that would otherwise have been excluded or included in the operation. Topolsets are connected sets of solid regions and boundary regions which are bounded by the imprint (of the boolean operation) and are chosen by specifying a selector topology that lies within that topolset. Selector topologies can be solid regions, faces, edges or vertices. The selected_topolset option structure contains the following options:

 

Options

Description

n_selectors

The number of selector topologies supplied.

selectors

An array that may contain a mixture of solid regions, faces, edges or vertices each of which uniquely identifies a single region. In cases where a selector does not clearly identify the region to be excluded or included, the selector can be associated with an element in help_points . Any selectors that are associated with help_points must first be specified in the array.

n_help points

The number of help_points supplied. This can be any number between zero and n_selectors .

help_points

An array of vectors, which when combined with an appropriate topological entity from selectors , clearly identify a unique topolset.

target_select

Whether to exclude or include the selected topolset from the target body.

tool_select

Whether to exclude or include the selected topolset from the tool body.

split_action

What action to take if a selector without a help point is split by the chosen boolean operation.

You can set target_select and tool_select to any of the following values:

 

Value

Description

PK_selector_type_exclude_c

Exclude selected topolsets from the boolean operation.

PK_selector_type_include_c

Include selected topolsets in the boolean operation.

PK_selector_type_off_c

Turn off topolset selection. This is the default value.

Selected topolsets from either the target or tool body have to be all excluded or all included. You cannot exclude some topolsets from a body and include others. from the same body.The exclusion or inclusion of a selected topolset holds for the duration of the chosen boolean operation. All other non-selected topolsets from the same origin are either included or excluded respectively.

 

Note: Multiple tools can be used with the selected_topolset option.

The topolsets that can be chosen depend on the boolean operation being performed. For unite operations, selectors determines whether a topolset from either the target or tool will survive after the operation. Figure 51-10 shows a unite boolean between a solid target and solid tool. The face surrounded by a blue frame on the tool body is the selected topology and tool_select is set to PK_selector_type_exclude_c.

 

Figure 51-10 Unite boolean with selected_topolset on the tool body

Figure 51-11 shows the same unite boolean between a solid target and solid tool. In this case, an edge of the tool body is the selected topology and tool_select is set to PK_selector_type_include_c.

 

Figure 51-11 Unite boolean operation with selected_topolset on the tool body

In cases where the boolean operation splits the selected topolset, you can either choose to propagate the selection to all topolsets on the same body using the split_action option or you can provide help_points to show which of the topologies resulting from the split are being specified.

The help_points must each uniquely identify a topolset and must lie within their corresponding selector topology. Figure 51-12 illustrates the use of help_points in a unite boolean between a solid tool and a solid target. The tool has one help point in a topolset and the tool_select is set to PK_selector_type_exclude_c.

 

Figure 51-12 Unite boolean using help_points

If you choose not to supply help points, the split_action option can be used which takes the following values:

 

Values

Description

PK_selector_split_fail_c

If selectors are split, force the operation to fail.

PK_selector_split_propagate_c

Propagate the selection to all the topological entities derived from the selector after the split.

Figure 51-13 shows a unite boolean with a solid tool and target. No help points have been set, the selector is from one topolset on the tool body and split_action has been set to PK_selector_split_propagate_c. The selector type has been set to PK_selector_type_exclude_c.

 

Figure 51-13 Unite boolean using split_action

 

Note: If help_points are set for the selector, then the value of split_action is ignored.

51.4.4 Using region selection with material side

The selected_topolset option can be used with target_material_side and tool_material_side options (referred to hereafter as the material-side options). The selector is first located on the model and then the chosen material-side option is taken into account. If the selector topology is found to be invalid due to the material-side options then an error is returned. If the selector topology remains valid, the boolean operation is then performed taking the material-side options into account.

 

Note: When using material-side options with selected_topolset , only one tool body can be used. If you want to use multiple tools with selected_topolset , the material-side options need to be set to their default values.

Figure 51-14 illustrates a unite operation with a solid tool and solid target. One face on the tool has a help point and is set to exclude the mid-face. The material-side options for the tool body are set to the default and the material-side option for the target body is set to target_material_outside.

 

Figure 51-14 Unite boolean with material-side options on the target body

Figure 51-15 illustrates a unite operation between a solid target and solid tool. Both bodies have their respective material-side options set to material_outside and a help point is set on the tool body.

 

Figure 51-15 Unite boolean with material-side options set on both the target and tool

 

Note: When using this option, the fence option should be left at its default value of PK_boolean_fence_none_c. Material-side options can be used to produce the desired fencing result. See Section 51.4.14, “Specifying the body type of tool and target”, for more information on material-side options.

51.4.5 Matched topology in local and global boolean operations

When performing global and local boolean operations, Parasolid can automatically look for regions between the target and tool that are nearly coincident. These regions, known as matched regions, represent areas of overlap between two topological entities that are geometrically coincident to within a specified tolerance. Using matched regions can produce a better result (by ensuring the coincident regions match as closely as possible) and can also make the boolean operation faster.

In general, we recommend that you let Parasolid control how matched regions are identified, by following the recommendations in the note below. However, if your application already has information about matched regions, then you can optionally supply these to provide further aid to the boolean operation.

Matched region information is controlled using the matched_region structure (PK_boolean_match_o_t) in PK_BODY_boolean_o_t, PK_FACE_boolean_o_t, PK_BODY_imprint_faces_o_t, PK_BODY_imprint_o_t, PK_FACE_imprint_faces_o_t, PK_FACE_imprint_o_t, PK_BODY_section_o_t and PK_FACE_section_o_t.

 

Note: To get the best results from matched regions, we strongly recommend that you set match_style to PK_boolean_match_style_auto_c and, optionally, set a tolerance using auto_match and auto_match_tol . If you want to supply your own matched region information, read the rest of this section.

The matched_region structure takes the following information:

 

Field

Description

match_style

Controls how Parasolid automatically looks for matched regions. This can have the following values:

We recommend that you always use PK_boolean_match_style_auto_c to switch on auto-matching of topologies during these operations. See Figure 51-18 for an example.

auto_match

When match_style is PK_boolean_match_style_auto_c, you can optionally choose to specify a tolerance that Parasolid uses to identify matched regions.

For boolean and sectioning operations, this field can be set to PK_LOGICAL_true if match_style is PK_boolean_match_style_auto_c, in which case a tolerance value must also be supplied in auto_match_tol . If set to PK_LOGICAL_false, default_tol is used when match_style is PK_boolean_match_style_auto_c. See Section 55.4, “Options for global and local sectioning” for more information about using this field with section operations.

For imprinting operations, this field must be set to PK_LOGICAL_true if match_style is PK_boolean_match_style_auto_c. See Section 50.4.1, “Imprinting” for more information.

Note: This field should only be set to PK_LOGICAL_true if match_style is PK_boolean_match_style_auto_c.

(Default: PK_LOGICAL_false).

auto_match_tol

An optional tolerance value to use when automatically selecting matched regions.

Note: This field should only be used if match_style is PK_boolean_match_style_auto_c and auto_match is PK_LOGICAL_true.

(Default: 0.0)

n_match_regions
match_regions

The match_regions is an array of substructures (PK_boolean_match_region_o_t) containing information about each pair of entities that are matched. The entities in the matched region must be in the target or tools of the boolean operation. (Default: NULL)

If your application already has information about suitable matched regions, it can supply them using match_regions . The n_match_regions field should contain the number of matched regions supplied. (Default: 0)

If match_regions are supplied and your application uses facet geometry, match_style must be set to PK_boolean_match_style_auto_c.

Note: You should only supply match_regions if your application already has this information available.

update

If your application relies on reproducing behaviour when updating models created using old versions of Parasolid, you should use this option to preserve old behaviour and help eliminate differences in rebuild results. You can use it to disable enhancements to boolean matching that have been added at different Parasolid versions. Doing this ensures that matching gives the same results in the latest version of Parasolid as in older versions.

See PK_boolean_match_update_0_c in the PK Interface Programming Reference Manual, for more information on this update option.

If your application already has the information, then you can supply pairs of matched entities in the match_regions substructure, using the following information:

 

Field

Description

regions

A pair of topological entities that are to be treated as matched. The following combinations of entities can be matched:

  • Edge - Edge
  • Face - Edge
  • Face - Face
  • Vertex - Vertex (only for a match_type of imprinted or exact)

(Default: PK_ENTITY_null, PK_ENTITY_null)

match_type

The type of match. See below for details. (Default: PK_boolean_match_exact_c)

tolerance

The tolerance within which the matched entities are geometrically coincident.

The match_type classifies the relationship between the entities:

 

Match type

Value

Description

Exact

PK_boolean_match_exact_c

The bounds of the topological entities match within the specified tolerance .

Contains

PK_boolean_match_contains_c

The bounds of the second entity lie within the bounds of the first entity.

Overlap

PK_boolean_match_overlap_c

The bounds of one entity overlap with the bounds of the second entity.

Imprinted

PK_boolean_match_imprinted_c

The bounds have been created by imprinting the topological entities.

The following table shows the relationship between regions and match_type :

 

Regions

Match type

Exact

Contains

Overlap

Imprinted

Vertex-Vertex

Vertex points coincident

Invalid

Invalid

Bounds created by imprinting vertices

Edge-Edge

Edge curves and equivalent edge vertices are coincident

Edge curves are coincident. Bounds of second edge lie within first.

Edge curves are coincident. Some overlap between edges

Bounds created by imprinting edges.

Face-Edge

Invalid

Edge curve is coincident with face surface. Edge is within face.

Edge curve is coincident with face surface. Edge overlaps face.

Invalid

Face-Face

Faces surfaces coincident. Edges must match, but not necessarily exactly.

Faces surfaces coincident. Second lies completely within first. Edges may be coincident.

Faces surfaces are coincident and may intersect

Invalid

When supplying matched regions of type face-face or face-edge, it is recommended that you always use match_type overlap.

51.4.5.1 Example: Performing a unite boolean with matched faces

In Figure 51-16 the tool body is a copy of the target body reflected about the plane of face F1.

 

Figure 51-16 Unite boolean with matched faces

Uniting the two bodies may fail due to the near coincident and tangential geometry meeting at the boundary of face F1 and F2. This is especially true if the geometry is of an approximate nature.

Specifying face F1 and F2 as a matched pair, with a suitable tolerance, enables the unite operation to succeed. The match_type should be overlap.

51.4.5.2 Example: Performing a unite boolean with matched faces and edges

In Figure 51-17 the target and tool bodies have been created by sweeping different profiles along the same guide path.

 

Figure 51-17 Unite boolean with matched face and edges

Boolean operations have difficulty with such bodies due to the approximate nature of the geometry of face F1 and F2. The boundaries of face F1 lie within a tolerance of face F2.

Specifying the face, F2, and the edges, E1 and E2, as matched topology, with a suitable tolerance, enables the unite operation to succeed. The match_type should be overlap.

51.4.5.3 Example: Performing a unite boolean with neighbouring faces that intersect

In Figure 51-18, the target and tool bodies can be united at the base.

 

Figure 51-18 Unite boolean with intersecting neighboring faces

Specifying the base of the cone F1, and the base of the hemisphere, F2, as matched topology, with a suitable tolerance, lets the unite operation succeed if match_style is set to PK_boolean_match_style_auto_c. Because the neighbouring faces of the matched topology intersect in the united body, using the default match_style of PK_boolean_match_style_basic_c would cause the unite operation to fail.

51.4.6 Overflow imprints at boundaries

51.4.6.1 Dealing with overflowing imprints at laminar boundaries

In addition to tangential imprint completion, you can also complete imprints at laminar boundaries using ruled and swept solutions, allowing you to preserve the laminar boundary in the region of the trim. Depending on the operation you want to perform, there will be some cases where the tangential solution gives the ideal result, and other cases when ruled or swept solutions are more appropriate.

Figure 51-19 shows how imprint completion on a flat sheet target causes the imprinted edges to overflow onto the V-shaped tool body that created the imprints. The result that is created by completing the imprint tangentially is generally not the result that you are likely to want. Instead, you can opt to create an alternative solution by using the options described below.

 

Figure 51-19 How imprints on a target can overflow onto the tool

You can control Parasolid’s behaviour for overflows such as this using the target_face_overflow and tool_face_overflow options; the option you need to use depends on whether you are completing imprints on the target or the tool.

 

Option

Description

target_face_overflow

Lets you specify what to do with imprints that overflow from the target onto the tool.

tool_face_overflow

Lets you specify what to do with imprints that overflow from the tool onto the target.

These options are not supported for general booleans. See Section 53.6, “Unsupported options”.

Both of these options structures themselves contain the following options for specifying how to handle imprint overflow:

 

Option

Description

laminar_overflow

How to handle imprint overflow on the tool (for target_face_overflow ) or the target (for tool_face_overflow ). This is one of the following:

  • PK_FACE_overflow_tangent_c - overflow onto the body by extending the laminar overflow boundary tangentially along the normal of the boundary’s owning face. This is the default.
  • PK_FACE_overflow_ruled_c - overflow onto the body by intersecting the laminar overflow boundary with a ruled sheet.
  • PK_FACE_overflow_swept_c - overflow onto the body by intersecting the laminar overflow boundary with a swept sheet, using the specified sweep_direction.
sweep_direction

A unit vector that specifies the sweep direction to use when extending imprint overflow by intersection with a swept sheet. This option is only used when laminar_overflow is PK_FACE_overflow_swept_c. Default: (0, 0, 1)

laminar_walled

A boolean that specifies whether or not to create a side face. Default: PK_LOGICAL_false.

Figure 51-20 shows the non-tangential results that can be obtained by specifying different laminar_overflow behaviour for a given tool, where imprint completion is taking place on the tool.

In each case, the following options have been set:

The results for each type of overflow have been obtained as follows:

 

Overflow

Notes

Ruled

  • laminar_overflow is set to PK_FACE_overflow_ruled_c.
  • Parasolid completes the imprint at the laminar edge of the target by imprinting a sheet onto the tool that is normal to the target at the laminar edge

Swept

  • laminar_overflow is set to PK_FACE_overflow_swept_c.
  • Parasolid completes the imprint at the laminar edge of the target by imprinting a sheet onto the tool at an angle to the target at the laminar edge.
  • The angle of this sheet is specified using sweep_direction .

 

 

Figure 51-20 Different methods for overflowing imprints at laminar boundaries

Figure 51-21 shows the effect of setting the laminar_walled option to PK_LOGICAL_true. In this example, to create a result body on which a side face can be built, the following options have been set:

 

Figure 51-21 Creating a side face for overflowing imprints at laminar boundaries

 

Note: There are restrictions on how you can combine the use of imprint completion and overflow behaviour, as follows:

  • If a non-default value of imprint_complete_tool is used, laminar_overflow in target_face_overflow must be left at its default value.
  • If a non-default value of imprint_complete_targ is used, laminar_overflow in tool_face_overflow must be left at its default value.

51.4.6.2 Dealing with overflowing imprints at interior boundaries

As well as providing control over overflowing imprints at laminar boundaries, Parasolid lets you specify how overflowing imprints at interior boundaries should be processed. The interfaces you use to control these overflows are similar to the ones used to control overflowing imprints at laminar edges (described in Section 51.4.6.1, “Dealing with overflowing imprints at laminar boundaries”), though the behaviour provided is different.

As with overflows at laminar boundaries, you control overflows at interior boundaries using the target_face_overflow and tool_face_overflow options; the option you need to use depends on whether you are completing imprints on the target or the tool.

Unlike overflows at laminar boundaries, interior overflows are only feasible for local booleans, and should therefore only be specified in calls to PK_FACE_boolean_2.

 

Option

Description

target_face_overflow

Lets you specify what to do with imprints that overflow from the target onto the tool.

tool_face_overflow

Lets you specify what to do with imprints that overflow from the tool onto the target.

Both of these options structures themselves contain the following option for specifying how to handle imprint overflow:

 

Option

Description

interior_overflow

How to handle imprint overflow onto the tool (for target_face_overflow ) or the target (for tool_face_overflow ). This is one of the following:

  • PK_FACE_overflow_added_c - overflow an interior edge by including other faces from the body as faces to imprint on, as required.
  • PK_FACE_overflow_mixed_c - overflow an interior edge using a mixture of techniques: for concave edges, add the adjacent face to the faces to imprint on; for convex edges, extend the adjacent face.
  • PK_FACE_overflow_none_c - do not attempt to overflow. Instead, return the result PK_boolean_result_failed_c and the report PK_boolean_report_imprint_fail_c in the results structure returned from the operation. This is the default.

 

Note: When using PK_FACE_overflow_mixed_c, the settings for the material side options, and the boolean operation used, can both affect whether an edge is regarded as concave or convex.

Figure 51-22 shows the results obtained by specifying different interior_overflow behaviour for a given tool and target, where imprint completion is taking place onto the tool.

 

Figure 51-22 Different methods for overflowing imprints at interior boundaries

In each case, the following options are set to the same values as for the example in Section 51.4.6.1, “Dealing with overflowing imprints at laminar boundaries”:

The results for each type of overflow have been obtained as follows:

 

Overflow

Notes

Added

  • interior_overflow is set to PK_FACE_overflow_added_c.
  • Parasolid completes the imprint at the interior edges of the target by adding any target faces required to the boolean operation. In this example, all the target faces are added to the operation, leading to the result shown.

Mixed

  • interior_overflow is set to PK_FACE_overflow_mixed_c.
  • Parasolid completes the imprint at the interior edges of the target as follows:
    • For the concave overflowing edge, the adjacent target face is added to the boolean operation, as shown.
    • For the convex overflowing edge, the adjacent target face is extended to intersect the tool faces.

None (not shown)

  • interior_overflow is set to PK_FACE_overflow_none_c.
  • No result is returned. Instead, PK_ERROR_cant_complete_imprint is returned.

51.4.7 Imprinting the boundaries of overlapping areas

You can use the imprint_overlapping option in PK_BODY_boolean_o_t to imprint any boundaries in overlapping areas in cases where a face from the target and a face from the tool share the same surface. This is useful if you have scribed details onto a body that you want to preserve. By default, overlapping boundaries are not imprinted on the boolean result. Figure 51-23 illustrates the behaviour of this option.

 

Figure 51-23 Imprinting overlapping boundaries

This option is not supported for general booleans. See Section 53.6, “Unsupported options”.

51.4.8 Limiting the faces to delete during face trims

When performing local booleans using PK_FACE_boolean_2, you can use the limit_target_faces and limit_tool_faces options to limit the scope of the local boolean when trimming and joining sheet targets or tools.

When limit_target_faces is PK_LOGICAL_true, the boundaries of the targets passed to PK_FACE_boolean_2 are used in the imprint phase of the boolean to complete the imprints. Similarly, when limit_tool_faces is PK_LOGICAL_true, the boundaries of the tools are used in the same way.

This has the effect of ensuring that only the specified targets or tools (as appropriate) are considered as candidates for trimming: any faces from the owning body that are not explicitly passed to PK_FACE_boolean_2 as either targets or tools will not be trimmed. If either limit_target_faces or limit_tool_faces is PK_LOGICAL_false - the default setting - any faces in the owning body may be trimmed, even if they have not been specified as targets or tools .

The effects of using limit_target_faces are illustrated in Figure 51-24, which shows how you can trim just the side faces of a boss in a sheet body by specifying only those side faces and setting limit_target_faces to PK_LOGICAL_true.

 

Figure 51-24 Limiting trim faces to those specified as targets

Figure 51-25 shows a more detailed view of the boss before and after the boolean operation shown in Figure 51-24 has been performed.

 

Figure 51-25 Trimming the side faces of a boss

51.4.8.1 Restrictions

The limit_target_faces and limit_tool_faces options can only be used if both the following are true:

 

Figure 51-26 Boolean join operation

51.4.9 Extending face lists during local booleans

During the imprint phase of a local boolean, you can use the extend_face_list option of PK_FACE_boolean_2 to add adjacent faces to the tool or target (or both) in an attempt to prevent incomplete loops of edges. This option is identical to the extend_face_list option available for PK_FACE_imprint_faces_2: see Section 50.4.1, “Imprinting”, for more details.

51.4.10 Sheet punching operations

Figure 51-27 illustrates the punching of a target sheet body with solid tool bodies, so that the areas of the target outside the tools, plus the areas of faces of the tools on one side of the target are the resultant sheet body.

 

Figure 51-27 Punching a target (sheet) body with 5 solid tool bodies

 

Note: More generalised punching functionality is supported via the target_material_side and tool_material_side options. See Section 51.4.14, “Specifying the body type of tool and target”, for details.

51.4.11 Enclosing solid regions with a sheet body

It is possible to enclose solid regions or add solid regions to an existing solid body by uniting the solid body with a sheet body as shown in Figure 51-28. The sheet body must enclose a valid manifold solid region within the solid body. This operation is only valid with generalised topology disabled.

 

Figure 51-28 Uniting solid and sheet bodies to enclose a solid region

 

Note: Enclosure functionality is also supported via the target_material_side and tool_material_side options. See Section 51.4.14, “Specifying the body type of tool and target”, for details.

51.4.12 Effect of the fence option on solid and sheet operations

Use of the fence option controls which regions of the sheet body are returned.

51.4.12.1 Example 1:

Subtracting sheet body from solid body using the ‘none’ fence option

 

Figure 51-29 Solid sectioned by sheet, 4 bodies returned.

51.4.12.2 Example 2:

Subtracting sheet body from solid body using the ‘front’ fence option

 

Figure 51-30 Solid sectioned by sheet - only regions in front of the sheet body are returned, 3 bodies returned.

51.4.12.3 Example 3:

Subtracting sheet body from solid body using the ‘back’ fence option

 

Figure 51-31 Solid sectioned by sheet - only regions behind the sheet body are returned, 1 body returned.

This option is not supported for general booleans. See Section 53.6, “Unsupported options”.

 

Note: Fencing functionality is also supported via the target_material_side and tool_material_side options. We strongly recommend that you use these options when performing fencing operations. See Section 51.4.14, “Specifying the body type of tool and target”, for details.

51.4.13 Imprint completion

During the imprinting phase of both local and global sheet booleans, you can request that Parasolid extends any imprinted edges tangentially. When used in conjunction with the material side options (see Section 51.4.14, “Specifying the body type of tool and target”), this makes it easy, for example, to split a sheet target using a sheet tool, without having to ensure that the tool is large enough to perform the operation successfully, as shown in Figure 51-32.

 

Figure 51-32 Splitting large sheet targets using imprint completion

As well as completing imprints on a sheet target, you can also complete imprints on a sheet tool if you wish. You use the imprint_complete_targ and imprint_complete_tool options in PK_BODY_boolean_o_t and PK_FACE_boolean_o_t to switch on imprint completion in the target or tool respectively.

You can only complete imprints on the target from the laminar edges of the supplied tool (and vice versa when completing imprints on the tool). Thus, if the tool contains non-laminar edges that intersect the target, you cannot extend their imprinted edges from the point of intersection, as illustrated in Figure 51-33.

 

Figure 51-33 Splitting large sheet targets using imprint completion

This functionality is very similar to Parasolid’s support for completing imprints created by PK_BODY_imprint_body and PK_FACE_imprint_faces_2. This is described in Section 50.5, “Legacy curve imprinting”, and you should look there for more details on how the boolean imprint completion functionality works.

The only difference between the two types of imprint completion is that imprints created using boolean functions can only be completed tangentially, whereas imprints created using imprint functions can be completed tangentially or orthogonally.

51.4.14 Specifying the body type of tool and target

You can use the tool_material_side and target_material_side options to control how the tools and targets specified in boolean operations are interpreted with regard to their body type. This section:

51.4.14.1 Description of material-side options

The material-side options let you treat faces locally as if they come from a body of a different type. Faces on a sheet body can be treated as if they are part of a solid and faces from a solid body can be treated as if they are part of a sheet. Use tool_material_side to control faces in tools and target_material_side to control faces in targets.

For each of these material-side options the following settings are available:

 

Value

Description

PK_boolean_material_default_c

Treat bodies as normal.

  • For a solid body, material is assumed to be present on the side of the body behind each face normal.
  • For a sheet body, no material is assumed to exist on either side of each face in the body.

PK_boolean_material_inside_c

Treat bodies as if they are solid.

  • For a solid body, this is no different to the default setting.
  • For a sheet body, Parasolid assumes that material exists on the side of the faces behind their normals, for the purposes of the boolean operation.

PK_boolean_material_outside_c

Treat bodies as if they are solid, but with material on the side of the faces indicated by their positive normal directions.

  • For a solid body, the body is treated as negated for the purposes of the boolean operation. The region outside the body is treated as solid and the body itself is treated as void.
  • For a sheet body, Parasolid assumes that material exists on the side of each face indicated by the direction of that faces normal, for the purposes of the boolean operation.

PK_boolean_material_none_c

Treat bodies as if they are sheets.

  • For a solid body, Parasolid assumes that no material exists on either side of each face in the body, for the purposes of the boolean operation.
  • For a sheet body, this is no different to the default setting.

For an example of this functionality, see the code example in the C++\Code Examples\Modelling\Booleans\Boolean Material Side folder, C#\ExampleApplication.Net\Code Examples\Modelling\Booleans\Boolean Material Side located in example_applications in your Parasolid installation folder.

These options are not supported for general booleans. See Section 53.6, “Unsupported options”.

51.4.14.2 Examples of using material-side options during boolean operations

Simple usage of material-side options with boolean operations are illustrated in this section. Each image uses the same model with different combinations of material-side options applied. The model is divided into four numbered imaginary volumes, each representing a possible region in the result. Figure 51-34 explains what region of the model each volume represents. Each volume will be either treated as solid or void depending on the material-side options.

 

Figure 51-34 The regions that the volumes of the model represent

 

Note: For some combinations of options, volume 1 should be solid after the boolean has been completed. Since this is clearly invalid, Parasolid negates all solid and void volumes (including volume 1) in these cases so as to ensure a valid result.Volumes that would have been treated as void in the end result prior to the flip are shown with their numbers crosses out in red. See Section 51.4.14.9, “Summary” for more information.

 

Figure 51-35 Boolean operations with material-side options set to PK_boolean_material_inside_c for both the target and the tool (default settings)

 

Figure 51-36 Boolean operations with material-side options set to PK_boolean_material_inside_c for the target and PK_boolean_material_outside_c for the tool.

 

Figure 51-37 Boolean operations with material-side options set to PK_boolean_outside_c for the target and PK_boolean_inside_c for the tool.

 

Figure 51-38 Boolean operations with material-side options set to PK_boolean_outside_c for both the target and the tool.

Material-side options can be used with boolean operations to achieve a number of different results. See Section 51.4.14.3, “Achieving different effects with material-side options”

51.4.14.3 Achieving different effects with material-side options

Depending on the configuration of the tool and target bodies, the boolean operation being performed, and the values chosen for the material-side options, a variety of different effects can be achieved. In particular, you can use these options to:

This section describes each use in turn.

 

Note: Many other effects can be created by using different combinations of material-inside options and boolean operations, many of which will fail or produce invalid results. This section only describes the most useful combinations available.

51.4.14.4 Creating corners

You can create a simple corner by performing a boolean between two sheets and setting the material-side option for both the target and the tool to PK_boolean_material_inside_c. The boolean operation you perform, and the value of the material-side option chosen, determines the configuration of the resulting sheet body corner, as shown in Figure 51-39. Parasolid ensures that the normals on the resulting faces are consistent, preserving the normal on the target body in the process.

 

Figure 51-39 Creating simple corners using different boolean operations

 

Note: If you wish, you can use PK_boolean_material_outside_c to create corners in this way as well.

You can also use the imprint completion functionality described in Section 51.4.13 to create more complex corner configurations in cases where one body does not intersect the other body completely, as shown in Figure 51-40. When imprint completion is turned off, Parasolid would return a failure for a boolean such as this, regardless of the material-side option settings.

 

Figure 51-40 Using imprint completion to create more complex corners

51.4.14.5 Performing sheet punching operations

You can use material-side options to punch a solid tool into a sheet target, for example by setting target_material_side to PK_boolean_material_inside_c and performing either a subtract or a unite operation to produce a sheet body. The final shape of the punched target depends on the direction of the face normal of the target, and which operation is performed, as shown in Figure 51-41.

 

Figure 51-41 Punching a solid tool into a sheet target

In addition, you can punch a sheet tool into a sheet target by setting the material-side options of both target and tool to PK_boolean_material_inside_c. Punching sheets in this way requires the same operation and settings as creating corners, and is actually just a more general version of the same technique.

51.4.14.6 Performing fence operations

To represent fence information when performing a boolean between a sheet tool and a solid target, set tool_material_side and perform a subtract operation to produce a solid body. The direction of the fencing operation (that is, which part of the target remains), depends on the value of tool_material_side , as follows:

 

Fence type

Boolean

Value of tool_material_side

Front

Subtract

PK_boolean_material_inside_c

Back

Subtract

PK_boolean_material_outside_c

None

Subtract

PK_boolean_material_none_c. This is the default.

Figure 51-42 shows how you can emulate “front” fence and “back” fence behaviour (as described in Section 51.4.12) using this technique:

 

 

Figure 51-42 Performing fence operations using material-side options

 

Note: It is possible to perform fencing operations using a number of different combinations of material-side option values and boolean operations. The setting described here are the recommended ones.

51.4.14.7 Enclosing a solid region with a sheet body

You can also use the material-side options to enclose a solid region with a sheet body (as described in Section 51.4.11) by uniting a solid target and a sheet tool, and setting tool_material_side to PK_boolean_material_inside_c.

 

Figure 51-43 Enclosing a solid region with a sheet

 

Note: Enclosure, as described in Section 51.4.11, is the default behaviour when uniting a solid target and sheet tool using the default values for all boolean options. However, if you want to implement enclosure functionality using the material-side options, you should use the settings described here.

51.4.14.8 Constraints

There are a few constraints when using material-side options. These are as follows:

51.4.14.9 Summary

This section summarises the results of using the material-side options.

 

Boolean operation:

If the target volume is treated as ...

If the tool volume is treated as ...

Then the result volume will be ...

Unite

Solid

Solid

Solid

Solid

Void

Solid

Void

Solid

Solid

Void

Void

Void

Subtract

Solid

Void

Solid

Solid

Solid

Void

Void

Void

Void

Void

Solid

Void

Intersect

Solid

Solid

Solid

Solid

Void

Void

Void

Solid

Void

Void

Void

Void

51.4.15 Tracking imprinted edges

Both PK_BODY_boolean_2 and PK_FACE_boolean_2 let you track edges that are imprinted onto the target during a boolean operation, subject to the following restriction:

You can control the amount of tracking information that is returned using the tracking_type option, which can take the following values:

 

Value

Description

PK_boolean_track_type_basic_c

Return basic tracking information that associates imprinted edges with the target topology on which those edges are imprinted. This is the default.

PK_boolean_track_type_comp_c

Return complete tracking information that associates imprinted edges with the following:

Figure 51-44 shows an example that illustrates the second of these.

 

Figure 51-44 Tracking imprint completion back to originating tool topology

51.4.16 Tracking regions

You can use the track_regions option to specify the level of region information to be tracked and recorded by PK_BODY_boolean_2. This tracking information is returned for both new regions and original regions that have been affected by a boolean operation.The track_regions option takes the following values:

 

Value

Description

PK_region_track_no_c

No region tracking information is returned for boolean operations.

This is the default.

PK_region_track_basic_c

Returns a set of basic region tracking records (PK_TOPOL_track_record_r_t) as follows:

  • If a solid region is derived from any solid original regions then it is tracked in a record of type PK_TOPOL_track_derive_c containing those regions.
  • If a void region is derived from any void original regions then it is tracked in a record of type PK_TOPOL_track_derive _c containing those regions.
  • If a region is only derived from regions of the opposite solidity then it is tracked in a record of type PK_TOPOL_track_create_c.
Note: To use region tracking you must set the tracking option to PK_LOGICAL_true and have general topology enabled in the session.

In Figure 51-45 the boolean unite result general body has three solid regions. Region (r1) is derived from the solid region of the target, region (r2) is derived from the solid regions of both the target and the tool and region (r3) is derived from the solid region of the tool.

The tracking of each of these regions is returned as a record of type PK_TOPOL_track_derive_c. For more information about Regions see Section 14.2.2, “Region”.

 

Figure 51-45 Tracking regions using the track_regions option.

51.4.17 Specifying the body type of the result

You can specify the preferred type of the resulting body for both global and local booleans using the resulting_body_type option. This takes the following values:

 

Value

Description

PK_boolean_prefer_solid_c

Returns solid result bodies if all shells in the bodies are closed, otherwise returns sheet bodies.

  • If sheets are returned, the result field of the results return structure (PK_boolean_r_t) is set to PK_boolean_result_not_solid_c.
  • If the result contains several components, they are returned as separate bodies if allow_disjoint is PK_LOGICAL_false.

PK_boolean_prefer_sheet_c

Returns sheet bodies if possible.

If the result contains several components, they are returned as separate bodies if allow_disjoint is PK_LOGICAL_false.

PK_boolean_prefer_wire_c

Returns manifold wire bodies. This value only applies to PK_BODY_boolean_2.

PK_boolean_prefer_general_c

Returns general bodies. This value only applies to PK_BODY_boolean_2.

PK_boolean_prefer_original_c

Ensures that the result bodies has the same body type as the target. If this is not possible, an error is returned. You should ensure you use this value if the fence option is a non-default value: see Section 51.4.12, “Effect of the fence option on solid and sheet operations”.

This is the default.

PK_boolean_prefer_simplest_c

Returns the simplest possible body type it can without making any changes to the body. This value only applies to PK_BODY_boolean_2.

It is recommended to use this value instead of the default when generalised topology is enabled.

51.4.18 Repairing non-manifold results using blends

Sometimes, boolean operations fail because the resulting bodies are non-manifold. When performing global booleans, Parasolid can automatically repair certain configurations of non-manifold edge by replacing that edge with blend faces, thereby allowing the boolean operation to succeed. You can control this behaviour using the following options:

 

Option

Description

nm_edge_repair

Whether to attempt to repair non-manifold edges in the resulting body. Set this to PK_nm_edge_repair_blend_c if you want to attempt to repair non-manifold edges. Default: PK_nm_edge_repair_no_c

blend_radius

The radius of the blends that are created in order to repair a non-manifold edge. Default: 1.0e-5

These options are not supported for general booleans. See Section 53.6, “Unsupported options”.

Figure 51-46 shows an example where the non-manifold edge created by subtracting the cylinder from the cube has been successfully repaired by replacing it with two blends, thus allowing the boolean operation to succeed.

 

Note: This option is only intended to repair non-manifold edges created by booleans in which the target and tool share a common extrude direction (the vertical axis, in Figure 51-46), thereby creating non-manifold edges that lie in this same direction. More general configurations creating non-manifold edges are not guaranteed to work.

 

Figure 51-46 Repairing non-manifold edges in global booleans

51.4.19 Update control

If your application relies on reproducing behaviour when updating models built using earlier versions of Parasolid, you should use the update option to preserve old behaviour and help eliminate differences in the rebuild results.The option lets you disable some boolean enhancements that have been added at different Parasolid versions. Doing this ensures that boolean operations give the same results in the latest version of Parasolid as in older versions.

See PK_boolean_update_t in the PK Interface Programming Reference Manual for more information on this update option.

 

Note: The default value is PK_boolean_update_default_c which uses all appropriate boolean operations enhancements. Setting to a non-default value disables all appropriate boolean operations enhancements.

 

Note: The imprinting functions PK_BODY_imprint_body, PK_BODY_imprint_faces_2, and PK_FACE_imprint_faces_2 also use the update option. For these functions, update values PK_boolean_update_5_c and older give the same behaviour. See Section 50.4.1, “Imprinting”, for more information.

Note: The sectioning functions PK_BODY_make_section and PK_BODY_make_section_with_surfs also use the update option. For these functions, update values PK_boolean_update_v261_c and older give the same behaviour. See Section 55.5, “Non-destructive sectioning”, for more information.

[back to top]


51.5 Information returned by boolean functions

In addition to returning tracking information, both PK_BODY_boolean_2 and PK_FACE_boolean_2 have a results structure containing the result bodies, a Parasolid report, and a status code. The status code is returned in the result field of the results structure and communicates information regarding the overall success or failure of the boolean operation as follows:

 

Values:

Description:

PK_boolean_result_success_c

The boolean was successful and the resultant entities are returned in the bodies array.

PK_boolean_result_no_clash_c

The boolean was successful, however the target and tool entities did not interact. When using non default-values for material-side options with this value the following applies:

  • For unite cases, the tool is completely outside of the target and the resultant body is a disjoint body.
  • For intersect cases, both the tool and target are deleted and no body is returned.

PK_boolean_result_no_effect_c

The boolean was successful, however the tools had no effect on the target. When using non default-values for material-side options with this value the following applies:

  • For unite cases, the tool is completely inside the target.
  • For intersect cases, the target is completely inside the tool.

PK_boolean_result_imprint_c

The boolean was successful, however the target body may have gained some mergeable edges or vertices

PK_boolean_result_not_solid_c

The boolean was successful, however the resultant bodies cannot be converted into solid bodies.

PK_boolean_result_multiple_c

This value is deprecated and should not be used in new code.

PK_boolean_result_failed_c

The boolean has failed.

For further information on material-side options, see Section 51.4.14, “Specifying the body type of tool and target”.

See Section 120.3.1, “Types of failure status code returned”, for more information on status codes.

[back to top]


51.6 Shared geometry after a boolean operation

Figure 51-47 shows an example where a boolean operation is used to subtract a slot from a block. In this example, face ‘A’ is split creating the new face ‘B’ resulting in both the ‘A’ and ‘B’ faces sharing the original surface. Similarly this applies for edges ‘C’ and ‘D’ as they have a common direction.

 

Figure 51-47 Two faces sharing the same surface

 

Note: If the example illustrated in Figure 51-47 used facet geometry, then faces ‘A’ and ‘B’ would not share the surface but would have separate meshes. Similarly the edges ‘C’ and ‘D’ will have separate new plines.

51.6.1 Subtraction resulting in sharing

In Figure 51-48 face ‘E’ has the same surface as face ‘1’ and face ‘F’ has the same surface as face ‘2’. Therefore, if face ‘1’ and face ‘2’ shared the surface to begin with, then face ‘E’ and face ‘F’ share the surface in the result.

After the subtraction boolean faces ‘A’ and ‘B’ share the surface of the bottom of the tool, and faces ‘C’ and ‘D’ share the surface of the back of the tool since they were created from those surfaces of the tool.

 

Figure 51-48 Subtracting a tool from a target

51.6.2 Subtraction preserving sharing

Figure 51-49 is similar to the previous example except that the target and tool are reversed. In this example the sharing of the surface under faces ‘A’ and ‘B’ is determined by the sharing of the surface under faces ‘1’ and ‘2’; if ‘1’ and ‘2’ share, then so do ‘A’ and ‘B’.

 

Figure 51-49 Subtracting a tool from a target

 

[back to top]

<<< Imprinting and Curve Projection Chapters Manifold Booleans >>>