On this page:
nw: rectangle
scene+ line
Version: 4.1.2.4

4 Scenes and Images

For the creation of scenes from the world, use the functions from (part "image"). The following two functions have turned out to be useful for the creation of scenes, too.

(nw:rectangle width height solid-or-filled c)  image?
  width : natural-number/c
  height : natural-number/c
  solid-or-filled : Mode
  c : Color

Creates a width x height rectangle, solid or outlined as specified by solid-or-filled and colored according to c, with a pinhole at the upper left corner.

(scene+line s x0 y0 x1 y1 c)  Scene
  s : Scene
  x0 : number?
  y0 : number?
  x1 : number?
  y1 : number?
  c : Color

Creates a scene by placing a line of color c from (x0 ,y0) to (x1 ,y1) into scene; (x ,y) are comp. graph. coordinates; in contrast to the add-line function, this one cuts off those portions of the line that go beyond the boundaries of the given s.