bool:glue-unite
List of: Scheme Extensions
Subjects: Booleans
Contents: Boolean

Action: Unites two bodies that have a set of overlapping, coincident faces and no penetrating face-face intersections.

Filename: bool/bool_scm/glue_scm.cxx

APIs: api_boolean_glue

Syntax: (bool:glue-unite body1 body2 faces1 faces2


[glue-opts | "name-of-option" {value} ...]


[keep-opt] [acis-opts])

Arg Types: body1 body

body2 body

faces1 face | (face ...)

faces2 face | (face ...)

glue-opts glue-options

"name-of-option" string

value boolean

keep-opt string

acis-opts acis-options

Returns: body

Description: This extension performs a Boolean unite operation on two bodies in the special case where the intersection graph (see solid:slice) lies precisely on a set of overlapping, coincident faces, and neither body penetrates the faces of the other body. This operation is designed to increase performance over the general Boolean operation, bool:unite.


Intuitively, this operation (when non-trivial) can be viewed as "gluing" two solid objects together by pasting their coincident faces.


Two faces are coincident if the intersection of their interior point sets is non-empty and bounded by the edges of either face, and on this overlap, their surface geometries are coincident.


The glue operation performs only those face-face intersections deemed necessary by the lists of pairwise coincident faces, faces1 and faces2, of body1 and body2 respectively. It is essential that the lists are accurate and complete because there is no verification that each pair of faces is coincident.


Refer to glue:options for information on the options designed to enhance performance. The options may be specified directly or in a Scheme object.


body1 and body2 are two bodies, where the intersection graph lies precisely on a set of overlapping, coincident faces, and neither body penetrates the faces of the other body.


faces1 and faces2 are the faces of body1 and body2 respectively.


glue-opts options designed to enhance performance.


name-of-option is the name of the glue option.


value is the value of the option.


keep-opt specifies whether some or all input bodies should be preserved.


acis-opts contains journaling and versioning information.

Example: ; bool:glue-unite

; Create a solid block.

(define block1


(solid:block (position -20 -20 -20)


(position 20 25 25)))

;; block1

; Create a second solid block to glue to the first.

(define block2


(solid:block (position -15 -30 -15)


(position 15 -20 20)))

;; block2

; Retrieve the list of faces for each body

(define faces1 (entity:faces block1))

;; faces1

(define faces2 (entity:faces block2))

;; faces2

; Pick out the coincident faces on each body

(define f12 (list-ref faces1 2))

;; f12

(define f24 (list-ref faces2 4))

;; f24

(env:set-highlight-color 1)

;; ()

; Highlight the face pair to see they are coincident

(entity:set-highlight (list f12 f24) #t)

;; (#[entity 6 1] #[entity 14 1])

; OUTPUT Original


; Now create a glue options object

(define glue-opts (glue:options


"face_pair_cover" #t "blank_patches_strict_cover"


#t "non_trivial" #t))

;; glue-opts

; Perform a glue unite

(define glue-result (bool:glue-unite block1 block2


(list f12) (list f24) glue-opts))

;; glue-result



Figure 2-5. bool:glue-unite


; Example 2

(part:clear)

;; #t

(define block1 (solid:block


(position -20 -20 -20) (position 20 25 25)))

;; block1

(define block2 (solid:block


(position -10 -10 25) (position 30 10 35)))

;; block2

(define faces1 (entity:faces block1))

;; faces1

(define faces2 (entity:faces block2))

;; faces2

; Pick out the coincident faces

(define f10 (list-ref faces1 0))

;; f10

(define f21 (list-ref faces2 1))

;; f21

; Highlight the face pair to see they are coincident

(entity:set-highlight (list f10 f21) #t)

;; (#[entity 18 1] #[entity 25 1])

; OUTPUT Original


; Define a glue options object for a unite operation.

; face_pair_cover cannot be set to #t because f10

; does not cover f21 and f21 does not cover f10.

; blank_patches_strict_cover cannot be set to #t

; because face_pair_cover is not set to #t.

; non_trivial can be set to #t because the bodies

; lie outside one another.

(define g (glue:options "non_trivial" #t))

;; g

; g => #[Glue_Options "face_pair_cover" -1

; "blank_patches_strict_cover" -1 "non_trivial" 1]

(define glue-result (bool:glue-unite


block1 block2 (list f10) (list f21) g))

;; glue-result

(entity:check glue-result)

; checked:

; 1 lumps

; 1 shells

; 0 wires

; 12 faces

; 12 loops

; 56 coedges

; 28 edges

; 18 vertices

;; ()

; OUTPUT Result



Figure 2-6. bool:glue-unite - Example 2
PDF/BOOL/02SC.PDF
HTM/DATA/BOOL/BOOL/02SC/0005.HTM