bool:chop
List of: Scheme Extensions
Subjects: Booleans
Contents: Boolean

Action: Simultaneously finds the intersection and difference between two bodies.

Filename: bool/bool_scm/bool_scm.cxx

APIs: api_boolean_chop_body

Syntax: (bool:chop body1 body2 [keep-leftovers=#t]


[keep-opt] [acis-opts])

Arg Types: body1 body

body2 body

keep-leftovers boolean

keep-opt string

acis-opts acis-options

Returns: entity ...

Description: This extension chops the blank body (body1) with the tool body (body2). The returned list contains the result of intersecting the two bodies, the result of subtracting body2 from body1, and (possibly) a body containing any "leftovers." Either of the first two bodies returned may be empty. Leftovers can only exist if the tool body is incomplete. If there is a body containing leftovers, the keep-leftovers argument controls whether it is deleted or not: if keep-leftovers is #f, any leftovers are deleted and the returned list is always of length 2. If keep-leftovers is #t, the returned list is only of length 3 if there are some leftovers (i.e., an empty leftovers body is never returned).


The optional keep_opt specifies whether some or all input bodies should be preserved. Value "keep_blank" preserves body1 and returns the result of the chop as a new body. "keep_tool" preserves body2 . . . bodyn. "keep_both" preserves all input bodies and returns the result of the chop as a new body.


body1 is a blank body.


body2 is a tool body.


keep-leftovers argument controls whether body containing leftovers deleted or not.


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


acis-opts contains parameters for versioning and journaling.

Example: ; bool:chop

; Create a solid block.

(define block1


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


(position 20 25 25)))

;; block1

; Create another solid block.

(define block2


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


(position 30 15 35)))

;; block2

; OUTPUT Original


; Chop block1 with block2

(define chop-result (bool:chop block1 block2))

;; chop-result

; OUTPUT Result



Figure 2-1. bool:chop
PDF/BOOL/02SC.PDF
HTM/DATA/BOOL/BOOL/02SC/0001.HTM