Next Previous Up Top Contents Index

4.3 DUIM-DCs Module

make-pattern

Function

Summary

Returns a pattern generated from a two-dimensional array.

Signature

make-pattern array colors => pattern

Arguments

array
An instance of type <array>.

colors
An instance of type limited(<sequence>, of: <color>).

Values

pattern
An instance of type <pattern>.

Library

duim-dcs

Module

duim-dcs

Description

Returns a pattern design that has (array-dimension array 0) cells in the vertical direction and (array-dimension array 1} cells in the horizontal direction. array must be a two-dimensional array of non-negative integers less than the length of designs. designs must be a sequence of designs. The design in cell i,j of the resulting pattern is the nth element of designs, if n is the value of (aref array i j). For example, array can be a bit-array and designs can be a list of two designs, the design drawn for 0 and the one drawn for 1. Each cell of a pattern can be regarded as a hole that allows the design in it to show through. Each cell might have a different design in it. The portion of the design that shows through a hole is the portion on the part of the drawing plane where the hole is located. In other words, incorporating a design into a pattern does not change its alignment to the drawing plane, and does not apply a coordinate transformation to the design. Drawing a pattern collects the pieces of designs that show through all the holes and draws the pieces where the holes lie on the drawing plane. The pattern is completely transparent outside the area defined by the array.

Each cell of a pattern occupies a 1 by 1 square. You can use transform-region to scale the pattern to a different cell size and shape, or to rotate the pattern so that the rectangular cells become diamond-shaped. Applying a coordinate transformation to a pattern does not affect the designs that make up the pattern. It only changes the position, size, and shape of the cells' holes, allowing different portions of the designs in the cells to show through. Consequently, applying make-rectangular-tile to a pattern of nonuniform designs can produce a different appearance in each tile. The pattern cells' holes are tiled, but the designs in the cells are not tiled and a different portion of each of those designs shows through in each tile.


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index