Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

index

source files: [cx]lsp.[ch]

SYNTAX

(index <dimension>)

DESCRIPTION

This operator gives pointwise operations access to the array indices of the elements on which they operate. For example, if the graphic-relation in question is 100x100x100, and the element currently being operated on is the 12,34,67th element, then

(index 0)

would return 12,

(index 1)

would return 34

(index 2)

would return 67, and any other choice of <dimension> would trigger an error.

EXAMPLE

A quick way to generate a square grid of points is:

(setq checkerboard (send class-graphic-relation :new '(100 100)))
(send checkerboard-relation :pointwise-eval
  '(progn
     (setq :POINT-X (float (index 0)))
     (setq :POINT-Y (float (index 1)))
     (setq :POINT-Z 0)))

See also ROW-MAJOR-INDEX.


Go to the first, previous, next, last section, table of contents.