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

Action: Creates a filter entity that selects for the type of an entity.

Filename: kern/kern_scm/filt_scm.cxx

Syntax: (filter:type type-name)

Arg Types: type-name string

Returns: entity-filter

Description: This extension creates the specified type-name as a filter, which specifies the type of entity to be used in another filter operation.


If a new type filter is created, it replaces the previously-defined type.


Refer to filter:color for creating filters based on color, and filter:types to display the list of available filter types.


type-name specifies an entity-filter to be created. The possible string values for the type-name are:


"edge:curve?", "edge:linear?", "edge:circular?", "edge:elliptical?", "edge:spline?", "edge?", "body?", "solid?", "wire-body?", "mixed-body?", "wire?", "face?", "face:planar?", "face:spherical?", "face:cylindrical?", "face:conical?", "face:toroidal?", "face:spline?", "wcs?", "text?", "vertex?", or "point?".

Example: ; filter:type

; Create a solid block.

(define part1


(solid:block (position 10 0 10)


(position 20 30 40)))

;; part1

; Create linear edge.

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


(position 10 10 10)))

;; part2

; Create circular edge.

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

;; part3

; Change the color of the existing entities to red.

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

;; ()

; Create solid sphere.

(define part4 (solid:sphere


(position 20 30 40) 30))

;; part4

; Create solid cylinder.

(define part5 (solid:cylinder


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

;; part5

; Create another linear edge.

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


(position 50 50 0)))

;; part6

; Create a spline edge.

(define part7 (edge:spline (list


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


(position 50 40 10))))

;; part7

; Get a list of available filter types.

(filter:types)

;; ("point?" "vertex?" "text?" "wcs?" "face:spline?"

;; "face:toroidal?" "face:conical?"

;; "face:cylindrical?" "face:spherical?"

;; "face:planar?" "face?" "wire?" "mixed-body?"

;; "wire-body?" "solid?" "body?" "edge?"

;; "edge:spline?" "edge:elliptical?"

;; "edge:circular?" "edge:linear?" "edge:curve?")

; Apply a solid filter and get entities.

(part:entities (filter:type "solid?"))

;; (#[entity 2 1] #[entity 5 1] #[entity 6 1])

; Apply edge:spline filter and get entities.

(part:entities (filter:type "edge:spline?"))

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