Action:
|
Converts a closed 2D sheet into a solid volume.
|
|
Filename:
|
cstr/cstr_scm/sht_scm.cxx
|
|
APIs:
|
api_enclose_void
|
|
Syntax:
|
(sheet:enclose face side [lumps=#f])
|
|
Arg Types:
|
face
|
face
|
|
side
|
boolean
|
|
lumps
|
boolean
|
|
Returns:
|
body
|
|
Description:
|
Converts the void volume of a face into a filled volume. It changes the containment information of all the faces in the minimal volume enclosing set related to the specified
side of the original face. The argument
side is the
REVBIT sense, telling it to take the current inside/outside markings or to reverse them. The return body is the owner of the face.
|
|
|
Optional argument
lumps indicates that the algorithm should determine if any distinct lumps are contained within the old void and should process them by repairing their external face containment information; otherwise, such processing is not performed.
|
|
|
This routine walks outward from the face along the closest radial enclosing faces until a volume is enclosed or
NULL coedges are encountered. It changes the containment data on the faces that are detected so they no longer contain a void. An outside face is changed to single-sided (unless it is detected twice in the search) and a single-sided face is changed to inside. Requires no action if the side of the face given is already a material containing.
|
|
|
face is an input face argument.
|
|
|
side is the
REVBIT sense, telling it to take the current inside/outside markings or to reverse them.
|
|
|
lumps indicates that the algorithm should determine if any distinct lumps are contained within the old void and should process them by repairing their external face containment information; otherwise, such processing is not performed.
|
|
Example:
|
; sheet:enclose
|
|
; Converts the volume of a face into a filled volume.
|
|
; Create solid block 1
|
|
(define block1
|
|
|
(solid:block (position -50 -50 -50)
|
|
|
(position 50 50 50)))
|
|
;; block1
|
|
; Change the view size for better viewing.
|
|
(view:compute-extrema)
|
|
;; ()
|
|
(define refresh (view:refresh))
|
|
;; refresh
|
|
; Create solid block 2.
|
|
(define block2
|
|
|
(solid:block (position -25 -25 -25)
|
|
|
(position 25 25 25)))
|
|
;; block2
|
|
; Subtract block 2 from block 1 to create a
|
|
; void volume inside the larger block.
|
|
(define subtract (solid:subtract block1 block2))
|
|
;; subtract
|
|
(define 2d (sheet:2d block1))
|
|
;; 2d
|
|
(solid:massprop block1)
|
|
;; (("volume" . 0) ("accuracy achieved" . 0))
|
|
(define enclose (sheet:enclose (pick:face
|
|
|
(ray (position 0 0 0) (gvector 0 0 1)) 1) #f #t))
|
|
;; enclose
|
|
(solid:massprop block1)
|
|
;; (("volume" . 875000) ("accuracy achieved" . 0))
|