filter:color
List of: Scheme Extensions
Subjects: Colors, Filtering
Contents: Scheme Support

Action: Creates an entity-filter that tests on the basis of color.

Filename: scm/scmext/dent_scm.cxx

Syntax: (filter:color color)

Arg Types: color color

Returns: entity-filter

Description: The filter color created defines the color of entity used for any particular filter operation. color specifies a color integer (0 - 7) or an rgb color value (double, double, double).


Additional filter types can be created. Refer to filter:type and filter:display.

Example: ; filter:color

; Create solid block 1.

(define block1


(solid:block (position 10 0 10)


(position 20 30 40)))

;; block1

; block1 => #[entity 2 1]

; Create linear edge 2.

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


(position 10 10 10)))

;; edge1

; edge1 => #[entity 3 1]

; Create circular edge 3.

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

;; edge2

; edge2 => #[entity 4 1]

; 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

; sphere1 => #[entity 5 1]

; Create solid sphere 5.

(define cyl1 (solid:cylinder


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

;; cyl1

; cyl1 => #[entity 6 1]

; Create linear edge 6.

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


(position 50 50 0)))

;; edge3

; edge3 => #[entity 7 1]

; Create spline edge 7.

(define edge4 (edge:spline (list


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


(position 50 40 10))))

;; edge4

; edge4 => #[entity 8 1]

(zoom-all)

;; #[view 1075640874]

; OUTPUT Original


; 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])



Figure 4-4. Filter:color
PDF/SCM/04SC.PDF
HTM/DATA/SCM/SCM/04SC/0056.HTM