KID Rendering   

<<< Viewing Environment and Definition Chapters Picking >>>

Contents

[back to top]


13.1 Introduction

The KID rendering functionality uses the rendering functions in Parasolid's PK interface. The KID rendering options have retained their six-character naming convention (as used in the KI interface), but are applied to the options used by the PK functions.

To render items in a given view, the view must be the current one, i.e. the last one to be selected. The following functions are available.

[back to top]

13.1.1 Wire frame pictures

sketch

Using the function "sketch", bodies, faces, edges and B-surfaces can be sketched.

 

Object

Function

graphics

sketch

> (graphics sketch ´[<object>])

If the optional argument is not given, all the items in the drawing_list property are rendered in the appropriate style. If an argument is given (which can be a single object or a list of objects), a new drawing list is defined which contains only these objects.

Another way to sketch objects is by the use of functions which are properties of the object itself.

 

Object

Function

topology

sketch

> (define view_1 graphics)
> (view_1 sketch ´b0)
> (view_1 zoom 2)
> (view_1 redraw)

This draws the object according to the current view and adds the object to the drawing list of the current view, unless it is already there.

[back to top]

13.1.2 Hidden line pictures

hidden

 

Object

Function

graphics

hidden

> (graphics hidden ´[<object>])

If the optional argument is not given, all the items in the drawing_list property are rendered in the appropriate style. If an argument is given (which can be a single object or a list of objects), a new drawing list is defined which contains only these objects.

[back to top]

13.1.3 Shaded pictures

shade

The procedure for opening an Xwindow for a shaded graphical display differs from that described previously. When using the "shade" function the following calls are used to open an Xwindow:

 

> (graphics open_device ´xcolour)
> (graphics shading_output [´device | ´file] )
                         -- use ´device to output to the screen
                             and ´file to output to a file

Object

Function

graphics

shade

> (graphics shade ´[<object>])

If the optional argument is not given, all the items in the drawing_list property are shaded according to the given shading options. If an argument is given (either a single object, or a list of objects), the drawing_list property is redefined, and the given objects are shaded.

 

Note: Note that the shade function is only available on UNIX, it does not work on NT.

[back to top]

13.1.4 Faceted pictures

facet

 

Object

Function

graphics

facet

> (graphics facet ´[<object>])

If the optional argument is not given, all the items in the drawing_list property are faceted according to the given faceting options. If an argument is given (either a single object, or a list of objects), the drawing_list property is redefined, and the given objects are faceted and output through the GO.

[back to top]


13.2 Rendering options

For all of the rendering options the option can be called by either its long name (as used in all the following option examples) or its code.

 

> (graphics drafting t)

    OR

> (graphics rropdr t)

anti_aliasing (RROPAN)

This option controls the anti_aliasing of entities passed to the shade function.

 

> (graphics anti_aliasing [ t | nil ])

If no argument is given, the current value of the anti_aliasing option is returned. If an argument is given, it is interpreted as follows:

 

Value

Description

t

option RROPAN is set

nil

option RROPAN is unset (default)

background_colour (RROPBK)

This option controls the background colour that is passed to the shade function.

 

> (graphics background_colour [argument])

If no argument is given, the current value of the background colour option is returned. If an argument is given, it is interpreted as follows:

 

Value

Description

list of three values

option RROPBK is set with the given values (in the order below)

anything else

option RROPBK is unset (default)

If the option RROPBK is not set, the following defaults are used for background color:

 

Color

Value

Red

0.0

Green

0.0

Blue

0.0

blend (RROPUB)

This option specifies that the rendering operation takes account of all unfixed blends in the entity passed to the sketch function.

 

> (graphics blend [ t | nil ])

If no argument is given, the current value of the unfixed blend option is returned. If an argument is given, it is interpreted as follows:

 

Value

Description

t

option RROPUB is set

nil

option RROPUB is unset (default)

convexity (RROPCV)

This option controls the convexity of the facets, that are to be output as convex polygons, by the facet function.

 

> (graphics convexity [<anything but nil OR nil>])

If no argument is given, the current value of convexity is used if it has been set; otherwise a default is used. If an argument is given, it is interpreted as follows:

 

Value

Description

t

option RROPCV is set

nil

option RROPCV is unset (default)

curve_tolerance (RROPCT)

This option controls the faceted representation by considering the curved edge approximation of the entity that is passed to the sketch, facet and hidden functions.

 

> (graphics curve_tolerance [argument])

If no argument is given, the current values of the curve tolerances are used if they have been set; otherwise defaults are used. If an argument is given, it is interpreted as follows:

 

Value

Description

list of three values

option RROPCT is set with the given values (in the order below)

anything else

option RROPCT is unset (default)

The curve tolerances are:

depth_modulation (RROPDM)

This option controls depth modulation of an entity that is passed to the shade function.

 

> (graphics depth_modulation [argument])

If no argument is given, the current value of the depth modulation option is returned. If an argument is given, it is interpreted as follows:

 

Value

Description

list of one value

option RROPDM is set with the given value

anything else but nil

option RROPDM is set with the value 0.3 (default)

nil

option RROPDM is unset

drafting (RROPDR)

This option controls the output of drafting-style lines of entities that are passed to the hidden function by distinguishing between lines which are blocked by other lines and those which are obscured by other faces of the body.

 

> (graphics drafting [ t | nil ])

If no argument is given, the current state of the drafting-style lines option is returned. If an argument is given, it is interpreted as follows:

 

Value

Description

t

option RROPDR is set

nil

option RROPDR is unset (default)

Note: The "drafting (RROPDR)" and "perspective (RROPPS)" options are mutually exclusive and turn each other off.

edge_data (RROPED)

This option controls the drawing of edge data of the entities passed to the sketch function.

 

> (graphics edge_data [ t | nil ])

If no argument is given, the current state of the edge data option is returned. If an argument is given, it is interpreted as follows:

 

Value

Description

t

option RROPED is set

nil

option RROPED is unset (default)

edge_tags (RROPET)

This option controls output of the edge tag for those facet edges derived from face edges for entities passed to the facet function.

 

> (graphics edge_tags [ t | nil ])

If no argument is given, the current values of the edge tags are used if they have been set; otherwise defaults are used. If an argument is given, it is interpreted as follows:

 

Value

Description

t

option RROPET is set

nil

option RROPET is unset (default)

face_colour (RROPFC)

This option controls the face colour of entities passed to the shade function.

 

> (graphics face_colour [argument])

If no argument is given, the current value of the face colour option is returned. If an argument is given, it is interpreted as follows:

 

Value

Description

list of three values

option RROPFC is set with the given values (in the order below)

anything else

option RROPFC is unset (default)

If the option RROPFC is not set, the following defaults are used for face color:

 

Color

Value

Red

1.0

Green

1.0

Blue

1.0

facet_infinite (RROPFI)

This option controls the non-generation of facets for faces which can quickly be identified as back-facing in the view from infinity direction of entities passed to the facet function.

 

> (graphics facet_infinite [ t | nil ])

If no argument is given, the current state of the facet_infinite option is returned. If an argument is given, it is interpreted as follows:

 

Value

Description

t

option RROPFI is set

nil

option RROPFI is unset (default)

Note: The "facet_infinite (RROPFI)","facet_perspective (RROPFP)" and "vertex_matching (RROPVM)" options are exclusive and turning one on turns the others off.

facet_minimum_size (RROPMF)

This option controls the minimum size of the facets of entities passed to the facet function.

 

> (graphics facet_minimum_size [argument])

If no argument is given, the current value of the minimum facet size, if set, is returned. If an argument is given, it is interpreted as follows:

 

Value

Description

n

option RROPMF is set with the given value

anything else

option RROPMF is unset (default)

facet_perspective (RROPFP)

This option controls the non-generation of facets for faces which can quickly be identified as back-facing in the perspective view direction of entities passed to the facet function.

 

> (graphics facet_perspective [ t | nil ])

If no argument is given, the current state of the facet_perspective option is returned. If an argument is given, it is interpreted as follows:

 

Value

Description

t

option RROPFP is set

nil

option RROPFP is unset (default)

Note: The "facet_infinite (RROPFI)","facet_perspective (RROPFP)" and "vertex_matching (RROPVM)" options are exclusive and turning one on turns the others off.

facet_size (RROPFS)

This option controls the faceted representation of entities passed to the facet function by considering the size of the facet.

 

> (graphics facet_size [argument])

If no argument is given, the current values of the facet size tolerances are used if they have been set; otherwise defaults are used. If an argument is given, it is interpreted as follows:

 

Value

Description

list of two values

option RROPFS is set with the given values (in the order below)

anything else

option RROPFS is unset (default)

The facet size tolerances are:

facet_strips (RROPTS)

This option controls the output of faceted data of entities passed to the facet function to be in "triangle strips" which form triangle facets.

 

> (graphics facet_strips [ n | nil ])

If no argument is given, the current value of the facet_strips option is returned. If an argument is given, it is interpreted as follows:

 

Value

Description

n

option RROPTS is set with the given maximum number of facets in a strip

nil

option RROPTS is unset (default)

first_derivatives (RROPD1)

This option controls the output of first derivatives data for entities passed to the facet function.

 

> (graphics first_derivatives [ t | nil ])

If no argument is given, the current state of this option is returned. If an argument is given it is interpreted as follows:

 

Value

Description

t

option RROPD1 is set

nil

option RROPD1 is not set (default)

hierarchical (RROPHR)

This option controls the output of hierarchical data for entities passed to the hidden function by outputting the data for the invisible part of partial visible lines.

 

> (graphics hierarchical [ t | nil ])

If no argument is given, the current state of this option is returned. If an argument is given it is interpreted as follows:

 

Value

Description

t

option RROPHR is set

nil

option RROPHR is not set (default)

hierarchical_no_geom (RROPHN)

As for the hierarchical option, this option controls the output of hierarchical data for entities passed to the hidden function by outputting the data for the invisible part of partial visible lines, but omitting any geometry segments.

 

> (graphics hierarchical_no_geom [ t | nil ])

If no argument is given, the current state of this option is returned. If an argument is given it is interpreted as follows:

 

Value

Description

t

option RROPHN is set

nil

option RROPHN is not set (default)

hierarchical_parametrised (RROPHP)

As for the hierarchical option, this option controls the output of hierarchical data for entities passed to the hidden function by outputting curve parameters with visibility segments.

 

> (graphics hierarchical_parametrised [ t | nil ])

If no argument is given, the current state of this option is returned. If an argument is given it is interpreted as follows:

 

Value

Description

t

option RROPHP is set

nil

option RROPHP is not set (default)

holes_permitted (RROPHO)

This option controls whether or not facets passed to the facet function are represented with holes in their interiors.

 

> (graphics holes_permitted [ t | nil ])

If no argument is given, the current values of the holes permitted are used if they have been set; otherwise defaults are used. If an argument is given, it is interpreted as follows:

 

Value

Description

t

option RROPHO is set

nil

option RROPHO is not set (default)

ignore_loops (RROPIL)

This option specifies those loops that are to be ignored when faceting a body.

 

> (graphics ignore_loops 56)         -- ignore a specified loop
> (graphics ignore_loops ´(56 70 92)  -- or a list of loops
> (graphics ignore_loops ´loo_object) -- or a loo (loop) object

If no argument is given, the current state of this option is returned. If an argument is given it is interpreted as follows:

 

Value

Description

tag/list of tags

faceting ignores the specified loop/s

tag of loo (loop) object

faceting ignores the loops in the loo object - if the loo object is updated, the next faceting call takes note of this

nil

option RROPIL is not set (default)

Note: It may be difficult to select the loops as there are few functions available for loops in KID. The following example may help.

Selecting a loop to ignore:

 

(defun intersection (a b)
      (cond
        ((null a) nil)
        ((member (car a) b) (cons (car a) 
                            (intersection (cdr a) b)))
        (t (intersection (cdr a) b))))

(modeller start)
(graphics open_device ´x)
((define b0 p_block) create)
((define c0 p_cylinder) height 20; point ´(0 0 5); 
 direction ´(0 1 1 ); radius 2; create)
((define t0 p_torus) point ´(0 5 10); 
 direction ´(1 0 0 ); minrad 1; majrad 6; create)

(b0 subtract ´c0)
(b0 subtract ´t0)
(graphics silhouette t; sketch ´b0;ar)
((define f0 face) pick_from b0;
     pick_using ´(eq (f0 enquire ´type) ´cylindrical))

((define e0 edge) pick
    ´(( 222.09889296390998 128.22734466248986
        155.80355543323157 )
    ( -0.75000326975537235 -0.43300948728521493 
      -0.49999787927274819 )))
((define loop_0 loo) tag (intersection
        ((define loop_1 loo) pick_from f0)
        ((define loop_2 loo) pick_from e0)))

(graphics ignore_loops ´loop_0; clear; facet ´f0; ar)

image_smoothness (RROPIS)

This option controls whether the hidden function calculates the smoothness of edges in the image, i.e. whether the faces either side of the edge are tangent. If an edge is smooth, the hidden function also calculates whether or not it is coincident with a silhouette. The example KID Frustrum does not draw smooth edges which are not coincident with silhouettes if (graphics smooth t) is selected, so for example mergeable edges are omitted from hidden line pictures.

 

> (graphics smooth [ t|nil ])

If no argument is given, the current state of this option is returned. If an argument is given it is interpreted as follows:

 

Value

Description

t

options RROPIS and RROPDS are set

nil

options RROPIS and RROPDS are not set (default)

internal_edges (RROPIE/N)

This option controls the output data for an edge that is passed to the hidden and sketch functions by specifying whether or not it is an internal edge.

 

> (graphics internal_edges [ t | nil ])

If no argument is given, the current state of this option is returned. If an argument is given it is interpreted as follows:

 

Value

Description

t

option RROPIE/N is set

nil

option RROPIE/N is not set (default)

Note: This turns both RROPIN and RROPIE on for the hidden and sketch relevant functions. To switch the options individually use (graphics rropie) and (graphics rropin).

invisible (RROPIV)

This option controls the output for hidden lines passed to the hidden function, so that hidden lines can be rendered in a dotted line-style.

 

> (graphics invisible [ t | nil ])

If no argument is given, the current state of this option is returned. If an argument is given it is interpreted as follows:

 

Value

Description

t

option RROPIV is set

nil

option RROPIV is not set (default)

lights function

This function controls the light sources that are passed to the shade function.

 

> (graphics lights [<list of lists each containing seven values>])

The argument given is a list containing a number of lists, each defining a light source. If no argument is given, the current list of light sources is returned. If an argument is given, the current list of light sources is set to the value of the argument.

A number of pre-defined light sources are available as follows:

 

Value

Description

ambient_high

(3 0.75 0.75 0.75 1 1 1)

ambient_med

(3 0.50 0.50 0.50 1 1 1)

ambient_low

(3 0.25 0.25 0.25 1 1 1)

lightx_high

(1 0.75 0.75 0.75 1 0 0)

lightx_med

(1 0.50 0.50 0.50 1 0 0)

lightx_low

(1 0.25 0.25 0.25 1 0 0)

lighty_high

(1 0.75 0.75 0.75 0 1 0)

lighty_med

(1 0.50 0.50 0.50 0 1 0)

lighty_low

(1 0.25 0.25 0.25 0 1 0)

lightz_high

(1 0.75 0.75 0.75 0 0 1)

lightz_med

(1 0.50 0.50 0.50 0 0 1)

lightz_low

(1 0.25 0.25 0.25 0 0 1)

lightxy_high

(1 0.75 0.75 0.75 1 1 0)

lightxy_med

(1 0.50 0.50 0.50 1 1 0)

lightxy_low

(1 0.25 0.25 0.25 1 1 0)

lightxz_high

(1 0.75 0.75 0.75 1 0 1)

lightxz_med

(1 0.50 0.50 0.50 1 0 1)

lightxz_low

(1 0.25 0.25 0.25 1 0 1)

lightyz_high

(1 0.75 0.75 0.75 0 1 1)

lightyz_med

(1 0.50 0.50 0.50 0 1 1)

lightyz_low

(1 0.25 0.25 0.25 0 1 1)

lightxyz_high

(1 0.75 0.75 0.75 1 1 1)

lightxyz_med

(1 0.50 0.50 0.50 1 1 1)

lightxyz_low

(1 0.25 0.25 0.25 1 1 1)

The default lights are ambient_high, lightxz_med and lightyz_low

no_fitting (RROPNF)

This option controls the way facets fit together at the edges of adjacent faces when they are passed to the facet function.

 

> (graphics no_fitting [ t | nil ])

If no argument is given, the current values of no fitting are used if they have been set; otherwise defaults are used. If an argument is given, it is interpreted as follows:

 

Value

Description

t

option RROPNF is set

nil

option RROPNF is unset (default)

nurbs_curves (RROPNC)

This option controls the output of NURBs curves passed to the sketch and hidden functions by allowing the NURB curve data to be presented to the Graphical Output in B-spline form.

 

> (graphics nurbs_curves [argument])

If no argument is given, the current setting is returned. If an argument is given, it is interpreted as follows:

 

Value

Description

anything but nil

option RROPNC is set

nil

option RROPNC is unset (default)

Note: The "nurbs_curves (RROPNC)" and "parametric_curves (RROPPC)" options are mutually exclusive and turn each other off.

para_hatch (RROPPA)

This option controls the hatching of composite B-surfaces passed to the sketch and hidden functions. Two parameters are given to the option that specify the spacing between hatchlines in both the u and v directions.

 

> ( f0 para_hatch )            -- enquire face hatching
> ( f0 para_hatch <space> )    -- set both u and v para spacing
> ( f0 para_hatch <u> <v> )    -- set both independently

The faces are not actually hatched by this command. They appear hatched in the next graphics command providing the global graphics rendering switches are set:

 

> ( graphics para_hatch t )

Hatching is disabled by using the argument nil.

 

> (graphics para_hatch nil )

parameter_information (RROPPI)

This option controls the output of parameter information for entities passed to the facet function.

 

> (graphics parameter_information [ t | nil ])

If no argument is given, the current state of this option is returned. If an argument is given it is interpreted as follows:

 

Value

Description

t

option RROPPI is set

nil

option RROPPI is not set (default)

parametric_curves (RROPPC)

This option controls the output of B-curves (Bezier curves) passed to the sketch and hidden functions by allowing the B-curve data to be presented to the Graphical Output in Bezier form or as poly lines.

 

> (graphics parametric_curves [argument])

If an argument is given, it is interpreted as follows:

 

Value

Description

anything but nil

option RROPPC is set

nil

option RROPPC is unset (default)

Note: The "nurbs_curves (RROPNC)" and "parametric_curves (RROPPC)" options are mutually exclusive and turn each other off.

perspective (RROPPS)

This option controls the whether or not the entities passed to the sketch, hidden, sketch and shade functions are created in a perspective view.

 

> (graphics perspective [ t | nil ])

If no argument is given, the current state of this option is returned. If an argument is supplied, it is interpreted as follows:

 

Value

Description

t

option RROPPS is set

nil

option RROPPS is not set (default)

Note: The "drafting (RROPDR)" and "perspective (RROPPS)" options are mutually exclusive and turn each other off.

planar_hatch (RROPPH)

This option controls the hatching of planar surfaces passed to the sketch and hidden functions. It takes an argument, which if set to nil, disables planar hatching, otherwise a list of 4 parameters is required:

 

> ( f0 planar_hatch )        -- enquire face hatching
> ( f0 planar_hatch <gap>)-- set hatching space (default Z dir)
> ( f0 planar_hatch <gap> <direction> ) 

The faces are not actually hatched by this command. They appear hatched in the next graphics command providing the global graphics rendering switches are set:

 

> ( graphics planar_hatch t )

Planar hatching is disabled by using the argument nil:

 

> ( graphics planar_hatch nil )

planarity_tolerance (RROPPT)

This option controls the planarity tolerance of facets passed to the facet function.

 

> (graphics planarity_tolerance [argument])

If no argument is given, the current values of the surface tolerances are used if they have been set; otherwise defaults are used. If an argument is given, it is interpreted as follows:

 

Value

Description

list of two values

option RROPPT is set with the given values (in the order below)

anything else

option RROPPT is unset (default)

The planarity tolerances are:

radial_hatch (RROPRH)

This option controls the radial hatching of entities passed to the sketch and hidden functions.

The argument set to nil disables radial hatching. For hatching on, a list of three parameters is required:

 

> ( f0 radial_hatch )             -- enquire face hatching
> ( f0 radial_hatch <gap>           -- 	and angle around spine
> ( f0 radial_hatch <gap> <ang1> <ang2> )
                                    -- and angle about spine

The faces are not actually hatched by this command. They appear hatched in the next graphics command providing the global graphics rendering switches are set:

 

> ( graphics radial_hatch t )

Radial hatching is disabled by using the argument nil:

 

> ( graphics radial_hatch nil )

regional (RROPRG)

This option controls the production of regional data for all visible edges and silhouettes passed to the hidden function.

 

> (graphics regional [ t | nil ])

If no argument is given, the current state of this option is returned. If an argument is supplied, it is interpreted as follows:

 

Value

Description

t

option RROPRG is set

nil

option RROPRG is not set (default)

regional_attribute (RROPRA)

This option controls the controls the creation of regional data for all visible edges and silhouettes adjacent to any face with regional-data that are passed to the hidden function.

 

> (graphics regional_attribute [ t | nil ])

If no argument is given, the current state of this option is returned. If an argument is supplied, it is interpreted as follows:

 

Value

Description

t

option RROPRA is set

nil

option RROPRA is not set (default)

resolution

This function controls the pixel map that is passed to the shade function.

 

> (graphics resolution [argument])

If no argument is given, the current resolution value is returned. If an argument is given, the pixel map is set with values according to the argument as follows:

 

Value

Description

very high

512 512 pixel_size_x pixel_size_y 256 256

high

256 256 pixel_size_x pixel_size_y 128 128 (default)

medium

128 128 pixel_size_x pixel_size_y 64 64

low

64 64 pixel_size_x pixel_size_y 32 32

list of six values

the pixel map is set with the given values

anything else

64 64 pixel_size_x pixel_size_y 32 32

The pixel sizes are calculated automatically according to the resolution (e.g. 256 x 256) and the current window size. It is therefore best to sketch the object(s), autowindow, redraw and then shade.

second_derivatives (RROPD2)

This option controls the output of first derivatives data for entities passed to the facet function.

 

> (graphics second_derivatives [ t | nil ])

If no argument is given, the current state of this option is returned. If an argument is given it is interpreted as follows:

 

Value

Description

t

option RROPD2 is set

nil

option RROPD2 is not set (default)

shade_file

This function controls the name of shade file output by the shade function.

 

> (graphics shade_file [ <´file_name> ])

If no argument is given, the name of the current shade file is returned. If an argument is given, the shade file is set to the value of the argument.

The default shade file "graphics.sig" is a binary file which consists of header information, of which the first four arguments detail the offset of the pixel image, followed by the run-length encoded RGB pixel intensities.

When required the following C program can be used to decode .sig files:

 

#include <stdio.h>

typedef struct   {  int a;
                    int b;
                    int x;
                    int y;
                 }  header_t;

typedef struct   {  double red;
                    double green;
                    double blue;
                    int count;
                  }  run_t;

main ( argc, argv )
int argc;
char * argv[];
{
run_t run;
header_t header;

/*Read header*/

fread( &a, sizeof( int ), 1, stdin );
fread( &b, sizeof( int ), 1, stdin );
fread( &x, sizeof( int ), 1, stdin );
fread( &y, sizeof( int ), 1, stdin );
printf( "HEADER %d %d x=%d, y=%d\n",
header.a,header.b,header.x,header.y);
printf("COUNT RED GREEN BLUE\n" );
while (fread( &run, sizeof( run_t ), 1, stdin) > 0)
{
printf( "%-6d %-8g %-8g %-8g\n",
run.count, run.red, run.green, run.blue );
}
}

Assume b0 to be a sphere with a transparency attribute attached to its face, and b1 to be a large cube. b0 lies in front of b1:

 

> (graphics select)
> (graphics anti_aliasing t)
> (graphics surface_reflection ´(0.99 0.00 0.01 0.10 20))
> (graphics depth_modulation ´(0.75))
> (graphics face_colour ´(1 0 0))
> (graphics background_colour ´(0 0 1))
> (graphics translucence t)
> (graphics resolution ´very_high)
> (setq lightxz_red ´(1 0.75 0.00 0.00 1 0 1))
> (setq lightyz_blue ´(1 0.00 0.00 0.50 0 1 1))
> (graphics lights 
     (list ambient_high lightxz_red lightyz_blue))
> (graphics shade_file "shade_file.pix")
> (graphics shade ´(b0 b1))

silhouette (RROPSI)

This option controls the creation and labelling of silhouette lines for entities passed to the sketch function.

If the optional argument is not given, silhouette curves are drawn in the current drawing list only. If the optional argument is set to t , silhouettes are drawn in every rendering operation.

 

> (graphics silhouette [ t | nil ])

The blend option controls unfixed blend surfaces rendering. If set to t, they are included in the next draw. Integers given as arguments can be used in several ways:

 

> (graphics blend 1)        -- draw as attributes specify

    OR

> (graphics blend t)      -- exactly equivalent
> (graphics blend 2)      -- only draw blend boundaries
> (graphics blend ´(3 n ))
  -- where n is set to rib spacing draw boundaries and
     overwrite rib attribute if different

silhouette_density (RROPSD)

This option controls the silhouette density output for entities passed to the facet function.

 

> (graphics silhouette_density [argument])

If no argument is given, the current value of the silhouette density option is returned. If an argument is given, it is interpreted as follows:

 

Value

Description

list of five values

option RROPSD is set with the given values

nil

option RROPSD is unset (default)

The five values represent the following properties:

smooth_edges (RROPSM)

This option controls whether the sketch function calculates the smoothness of edges in the image, i.e. whether the faces either side of the edge are tangent.

 

> (graphics smooth_edges [ t | nil ])

If no argument is given, the current state of this option is returned. If an argument is given it is interpreted as follows:

 

Value

Description

t

option RROPSM is set

nil

option RROPSM is not set (default)

smooth_edges_do_not_block (RROPDS)

This option controls whether or not the hidden function allows smooth edges which are not coincident with silhouettes to occlude other lines in drafting mode. As the KID Example Frustrum does not draw smooth edges if (graphics smooth) is selected, then this option should also be selected with it. The option ensures that the situation where a smooth edge occludes another but then does not itself get drawn cannot occur.

 

> (graphics smooth_edges_do_not_block [ t | nil ])

The option is automatically selected when (graphics smooth) is selected. You probably only need to control it independently of (graphics smooth) when the frustrum is designed to draw smooth edges in a different line style rather than omitting them completely, for example.

 

Value

Description

t

option RROPDS is set

nil

option RROPDS is not set (default)

surface_reflection (RROPSF)

This option controls the surface reflectivity of entities passed to the shade function.

 

> (graphics surface_reflection [argument])

If no argument is given, the current value of the surface reflectivity option is returned. If an argument is given, it is interpreted as follows:

 

Value

Description

list of five values

option RROPSF is set with the given values (in the order below)

anything else

option RROPSF is unset (default)

The five values represent the following properties, if the option is not set, the defaults shown are used.

 

Property

Default

Coefficient of specular reflection

0.90

Proportion of colour in highlights

0.00

Coefficient of diffuse reflection

0.60

Coefficient of ambient reflection

0.25

Reflection power

20

surface_tolerance (RROPST)

This option controls the surface tolerance of entities passed to the facet function by considering the approximation to the surface.

 

> (graphics surface_tolerance [argument])

If no argument is given, the current values of the surface tolerances are used if they have been set; otherwise defaults are used. If an argument is given, it is interpreted as follows:

 

Value

Description

list of two values

option RROPST is set with the given values (in the order below)

anything else

option RROPST is unset (default)

The surface tolerances are:

transform (RROPTR)

This option controls the transformed positions of all entities passed to the sketch, hidden, shade and facet functions.

 

> (graphics transform [argument])

An example of applying a transform when rendering:

 

> ( (define t0 p_translation) direction ´(0 0 1); 
    distance 2; create )
> ( (define b0 p_block) create )
> ( graphics ske ´b0; ar; transform ´t0; sketch; ar )

When using the above sequence of commands, if there are many entities in the drawing list, but only one transform is supplied, then the transform list is replicated to ensure that there are an equal number of transforms as entities. At all times the list of transforms must match the list of entities.

translucence (RROPTL)

This option controls the translucent rendering of those faces passed to the shade function that have a specifying attribute attached.

 

> (graphics translucence [ t | nil ])

If no argument is given, the current value of the translucence option is returned. If an argument is given, it is interpreted as follows:

 

Value

Description

t

option RROPTL is set

nil

option RROPTL is not set (default)

vertex_matching (RROPVM)

This option ensures that there are no gaps along the model edges and that along these edges there are no facet vertices which are interior to an adjacent facet edge in the entity that is passed to the facet function.

 

> (graphics vertex_matching [ t | nil ])

If no argument is given, the current value of the vertex_matching option is returned. If an argument is given, it is interpreted as follows:

 

Value

Description

t

option RROPVM is set

nil

option RROPVM is unset (default)

Note: The "facet_infinite (RROPFI)","facet_perspective (RROPFP)" and "vertex_matching (RROPVM)" options are exclusive and turning one on turns the others off.

vertex_normals (RROPVN)

This option allows the surface normal to be output at every facet vertex in the entity passed to the facet function.

 

> (graphics vertex_normals [ t | nil ])

If no argument is given, the current value of the vertex_normals option is returned. If an argument is given, it is interpreted as follows:

 

Value

Description

t

option RROPVN is set

nil

option RROPVN is unset (default)

viewport (RROPVP)

This option attempts to render those bodies/faces which are inside or partly inside the supplied viewport.

 

> (graphics viewport [argument])
> (graphics viewport)          --- returns the current viewport

If no argument is given, the default viewport is used in which the full image is rendered. If an argument is given, it is interpreted as follows:

 

Value

Description

t

option RROPVP is set

nil

option RROPVP is unset (default)

list of 15 doubles

sets the viewport

'box

create a viewport for the boxes of all the items in the current drawing list

Whenever the viewport is turned ON (by either of the three relevant options), the view is recalculated after each "zoom" or "autowindow".

 

[back to top]

<<< Viewing Environment and Definition Chapters Picking >>>