pattern:coords-to-index
List of: Scheme Extensions
Subjects: Patterns
Contents: Kernel

Action: For the specified pattern, returns the pattern index associated with the specified pattern coordinates.

Filename: kern/kern_scm/pattern_scm.cxx

Syntax: (pattern:coords-to-index pat coords)

Arg Types: pat pattern

coords pair

Returns: integer


pat specifies a pattern.


coords specifies the pattern coordinates.

Example: ; pattern:coords-to-index

; make a pattern

(define center (position 1 2 3))

;; center

(define normal (gvector 0 0 1))

;; normal

(define num-radial 4)

;; num-radial

(define num-angular 5)

;; num-angular

(define spacing 3)

;; spacing

(define pat (pattern:radial center


normal num-radial num-angular spacing))

;; pat

; find the pattern index of a specific element

(define coords (list 3 2))

;; coords

(define index (pattern:coords-to-index pat coords))

;; index
PDF/KERN/14SCI.PDF
HTM/DATA/KERN/KERN/14SCI/0057.HTM