<<< Viewing Environment and Definition | Chapters | Picking >>> |
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.
Using the function "sketch", bodies, faces, edges and B-surfaces can be sketched.
> (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.
> (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.
> (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.
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 |
> (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. |
> (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.
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) > (graphics rropdr t) |
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:
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:
option RROPBK is set with the given values (in the order below) |
|
If the option RROPBK is not set, the following defaults are used for background color:
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:
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:
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:
option RROPCT is set with the given values (in the order below) |
|
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:
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:
Note: The "drafting (RROPDR)" and "perspective (RROPPS)" options are mutually exclusive and turn each other off. |
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:
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:
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:
option RROPFC is set with the given values (in the order below) |
|
If the option RROPFC is not set, the following defaults are used for face color:
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:
Note: The "facet_infinite (RROPFI)","facet_perspective (RROPFP)" and "vertex_matching (RROPVM)" options are exclusive and turning one on turns the others off. |
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:
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:
Note: The "facet_infinite (RROPFI)","facet_perspective (RROPFP)" and "vertex_matching (RROPVM)" options are exclusive and turning one on turns the others off. |
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:
option RROPFS is set with the given values (in the order below) |
|
The facet size tolerances are:
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:
option RROPTS is set with the given maximum number of facets in a strip |
|
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:
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:
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:
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:
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:
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:
faceting ignores the loops in the loo object - if the loo object is updated, the next faceting call takes note of this |
|
Note: It may be difficult to select the loops as there are few functions available for loops in KID. The following example may help. |
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:
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:
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). |
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:
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:
The default lights are ambient_high, lightxz_med and lightyz_low
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:
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:
Note: The "nurbs_curves (RROPNC)" and "parametric_curves (RROPPC)" options are mutually exclusive and turn each other off. |
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 ) |
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:
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:
Note: The "nurbs_curves (RROPNC)" and "parametric_curves (RROPPC)" options are mutually exclusive and turn each other off. |
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:
Note: The "drafting (RROPDR)" and "perspective (RROPPS)" options are mutually exclusive and turn each other off. |
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 ) |
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:
option RROPPT is set with the given values (in the order below) |
|
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 ) |
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:
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:
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:
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.
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:
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:
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:
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:
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:
The five values represent the following properties:
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:
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.
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:
option RROPSF is set with the given values (in the order below) |
|
The five values represent the following properties, if the option is not set, the defaults shown are used.
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:
option RROPST is set with the given values (in the order below) |
|
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.
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:
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:
Note: The "facet_infinite (RROPFI)","facet_perspective (RROPFP)" and "vertex_matching (RROPVM)" options are exclusive and turning one on turns the others off. |
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:
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:
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".
<<< Viewing Environment and Definition | Chapters | Picking >>> |