filter:not
List of: Scheme Extensions
Subjects: Filtering
Contents: Kernel

Action: Computes the NOT of an input entity-filter.

Filename: kern/kern_scm/filt_scm.cxx

Syntax: (filter:not filter)

Arg Types: filter entity-filter

Returns: entity-filter


filter specifies an entity-filter.

Example: ; filter:not

; Create solid block 1.

(define block1


(solid:block (position 10 0 10)


(position 20 30 40)))

;; block1

; Create linear edge 2.

(define edge1 (edge:linear (position 0 0 0)


(position 10 10 10)))

;; edge1

; Create circular edge 3.

(define edge2 (edge:circular (position 0 0 0) 20))

;; edge2

; Change the color of the entities so far to red.

(entity:set-color (part:entities) 1)

;; ()

; Create solid sphere 4.

(define sphere1 (solid:sphere


(position 20 30 40) 30))

;; sphere1

; Create solid sphere 5.

(define cyl1 (solid:cylinder


(position 40 0 0) (position 5 5 5) 8))

;; cyl1

; Create linear edge 6.

(define edge3 (edge:linear (position 0 50 0)


(position 50 50 0)))

;; edge3

; Create spline edge 7.

(define edge4 (edge:spline (list


(position 20 20 20) (position 10 20 30)


(position 50 40 10))))

;; edge4

; Apply a green filter and obtain the entities.

(filter:apply (filter:color 2) (part:entities))

;; (#[entity 5 1] #[entity 6 1] #[entity 7 1]

;; #[entity 8 1])

; Define a yes-red filter.

(define yes-red (filter:color 1))

;; yes-red

(part:entities yes-red)

;; (#[entity 1 1] #[entity 2 1]

;; #[entity 3 1] #[entity 4 1])

; Define a not-red filter.

(define not-red (filter:not (filter:color 1)))

;; not-red

; Apply a not-red filter and obtain the entities.

(part:entities not-red)

;; (#[entity 5 1] #[entity 6 1] #[entity 7 1]

;; #[entity 8 1])
PDF/KERN/13SCF.PDF
HTM/DATA/KERN/KERN/13SCF/0022.HTM