Action:
|
Determines if a Scheme entity is a surface.
|
|
Filename:
|
kern/kern_scm/surf_scm.cxx
|
|
Syntax:
|
(surface? object)
|
|
Arg Types:
|
object
|
scheme-object
|
|
Returns:
|
boolean
|
|
Description:
|
The extension returns
#t if the object is a surface, and
#f if it is not a surface.
|
|
|
object specifies the
scheme-object that has to be queried for a surface.
|
|
Example:
|
; surface?
|
|
; Create a solid block.
|
|
(define block1
|
|
|
(solid:block (position 0 0 0)
|
|
|
(position 10 10 10)))
|
|
;; block1
|
|
; Create a cylindrical face.
|
|
(define cyl1
|
|
|
(face:cylinder (position 0 0 0)
|
|
|
(position 0 20 0) 10))
|
|
;; cyl1
|
|
; Determine if the solid block is a surface.
|
|
(surface? block1)
|
|
;; #f
|
|
; Get a list of the faces of the block.
|
|
(define entities1
|
|
|
(entity:faces block1))
|
|
;; entities1
|
|
; Convert one face to a surface.
|
|
(define surface1 (surface:from-face
|
|
|
(car entities1)))
|
|
;; surface1
|
|
; Determine if one of the surfaces of the block
|
|
; is actually a surface.
|
|
(surface? surface1)
|
|
;; #t
|