Action:
|
Sets the options in the data structure to be used by glue operations.
|
|
Filename:
|
bool/bool_scm/glue_scm.cxx
|
|
Syntax:
|
(glue:options "name-of-option" {value} [glue-opts])
|
|
Arg Types:
|
"name-of-option"
|
string
|
|
value
|
boolean
|
|
glue-opts
|
glue-options
|
|
Returns:
|
glue-options
|
|
Description:
|
Every option default value is set to
#f (unset). These options are designed to provide additional information to the glue operation for improved performance. The information provided must be accurate because the glue operation relies heavily on this information.
|
|
|
See
bool:glue-unite for the definition of coincident faces.
|
|
|
Given bodies b1 and b2, a coincident patch P1 in b1 is a maximal set of connected faces of b1 such that there exists a corresponding maximal set P2 of connected faces in b2 and a (well-defined onto) coincidence mapping from P1 to P2.
|
|
|
Face f1 covers face f2 if the point set of f2 is a subset of the point set of f1. Patch P1 covers patch P2 if the point set of P2 is a subset of the point set of P1. Given a pair of coincident patches P1 and P2, P1 is a strict cover of P2 if the point set of P2 is a subset of the interior point set of P1.
|
|
|
The
name-of-option argument could take one of the following values:
|
|
|
patch_and_face_cover
|
|
blank_patches_strict_cover
|
|
non_trivial
|
|
|
Setting
patch_and_face_cover to
#t will induce a performance enhancement.
patch_and_face_cover may be set to
#t if the following conditions are satisfied:
|
|
|
for every pair of coincident faces (to be specified in the glue operation), one face covers the other face;
|
|
for every pair of coincident patches, one patch covers the other patch.
|
|
|
In addition to setting
patch_and_face_cover to
#t, setting
blank_patches_strict_cover to
#t will induce another performance enhancement.
blank_patches_strict_cover may be set to
#t if the following conditions are satisfied:
|
|
|
patch_and_face_cover is set to
#t;
|
|
every patch in the blank (first) body is a strict cover of its corresponding patch in the tool (second) body.
|
|
|
non_trivial may be set to
#t if it is guaranteed that the Boolean operation will be non-trivial. In the case of glue-unite, this is when the tool body lies outside the blank body. In the case of glue-subtract, this is when the tool body is completely contained in the blank body. This will induce another performance enhancement. It is not dependent on the previous flags.
|
|
|
name-of-option argument could take one of the following values:
patch_and_face_coverblank_patches_strict_covernon_trivial
|
|
|
value is the value of the option.
|
|
|
glue-opts is the glue options.
|
|
Example:
|
; glue:options
|
|
; Create a block
|
|
(define block1 (solid:block
|
|
|
(position -10 -10 25) (position 35 10 35)))
|
|
;; block1
|
|
(define block2 (solid:block
|
|
|
(position 20 -10 15) (position 35 10 25)))
|
|
;; block2
|
|
(define faces1 (entity:faces block1))
|
|
;; faces1
|
|
(define faces2 (entity:faces block2))
|
|
;; faces2
|
|
; Pick out the coincident faces on each body
|
|
(define f11 (list-ref faces1 1))
|
|
;; f11
|
|
(define f20 (list-ref faces2 0))
|
|
;; f20
|
|
; change highlight color for images
|
|
(env:set-highlight-color 1)
|
|
;; ()
|
|
; Highlight the face pair to see they are coincident
|
|
(entity:set-highlight (list f11 f20) #t)
|
|
;; (#[entity 33 1] #[entity 38 1])
|
|
; Construct a glue options object.
|
|
; face_pair_cover can be set to #t because
|
|
; f11 covers f20.
|
|
; blank_patches_strict_cover cannot be set
|
|
; to #t because f11 (a patch with one face) does not
|
|
; strictly cover f20 (the corresponding patch with
|
|
; one face) -- the patches have coincident boundary
|
|
; edges. non_trivial can be set to #t because the
|
|
; bodies lie outside one another.
|
|
(define g (glue:options "face_pair_cover" #t
|
|
|
"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 f11) (list f20) g))
|
|
;; glue-result
|
|
(entity:check glue-result)
|
|
; checked:
|
|
; 1 lumps
|
|
; 1 shells
|
|
; 0 wires
|
|
; 8 faces
|
|
; 8 loops
|
|
; 36 coedges
|
|
; 18 edges
|
|
; 12 vertices
|
|
;; ()
|
|
; OUTPUT Original
|
|
|
; Now create another block
|
|
(define block3 (solid:block
|
|
|
(position -20 -20 -20) (position 20 25 25)))
|
|
;; block3
|
|
(define faces3 (entity:faces block3))
|
|
;; faces3
|
|
(define faces4 (entity:faces glue-result))
|
|
;; faces4
|
|
; Pick out the coincident faces
|
|
(define f30 (list-ref faces3 0))
|
|
;; f30
|
|
(define f35 (list-ref faces3 5))
|
|
;; f35
|
|
(define f42 (list-ref faces4 2))
|
|
;; f42
|
|
(define f41 (list-ref faces4 1))
|
|
;; f41
|
|
; Highlight each face pair to see they are coincident
|
|
(entity:set-highlight (list f30 f42) #t)
|
|
;; (#[entity 17 1] #[entity 23 1])
|
|
(entity:set-highlight (list f35 f41) #t)
|
|
;; (#[entity 22 1] #[entity 13 1])
|
|
; Construct a glue options object.
|
|
; face_pair_cover can be set to #t because
|
|
; f30 covers f43 and f35 covers f41.
|
|
; blank_patches_strict_cover can be set to #t because
|
|
; the patch consisting of f30 and f35 strictly covers
|
|
; the patch consisting of f43 and f41. The boundary
|
|
; edges of the smaller patch (f43 and f41)
|
|
; do not touch the boundary edges of the larger
|
|
; patch (f30 and f35). non_trivial can be set to #t
|
|
; because the bodies lie outside one another.
|
|
; In this example, we re-use the previous glue
|
|
; options object.
|
|
(define g (glue:options
|
|
|
"blank_patches_strict_cover" #t g))
|
|
;; g
|
|
; g => #[Glue_Options "face_pair_cover" 1
|
|
; "blank_patches_strict_cover" 1 "non_trivial" 1]
|
|
(bool:glue-unite block3 glue-result
|
|
|
(list f30 f35) (list f42 f41) g)
|
|
;; #[entity 16 1]
|
|
(entity:check block3)
|
|
; checked:
|
|
; 1 lumps
|
|
; 1 shells
|
|
; 0 wires
|
|
; 12 faces
|
|
; 12 loops
|
|
; 60 coedges
|
|
; 30 edges
|
|
; 20 vertices
|
|
;; ()
|
|
; OUTPUT Result
|
|
|
|
|
Figure 2-21. glue:options
|