HATCH_FACE

Syntax

int_val = HATCH_FACE ( [style, o_x, o_y, ang, spc] );
Input arguments
int style Not currently used. The only style is solid lines.
float o_x,o_y These variables have no effect.
float ang Defines the direction angle (degrees) of the hatching lines relative to the local x-axis.
float spc The distance between two adjacent hatch lines.

Return Values

Success:
int 0 Hatch lines drawn successfully.

Description

This function draws a hatch pattern in the area defined by the polylines that have been sent since calling START_FACE. The appearance of the boundary is controlled by the attributes in effect during the polyline calls. There are two ways to use this function:

  • Use START_FACE with arguments and HATCH_FACE without arguments to apply a real hatch pattern to the given area.

  • Use START_FACE without arguments and HATCH_FACE with arguments to apply a simple line pattern to the given area. You can use START_HOLE to define a blank area that does not receive the line hatch.

Note: It is usually a good idea to build symbols so that they are not hatched during animation.

Functions ARC and CIRCLE can also be used to hatch faces, not only polylines, provided that the lines touch each other to complete the face.

Examples

The code below shows how to build this hatched figure:

Copy
/* Hatching */
htc_exa()
{
    START_FACE();

    POLY( -10.0, -10.0,
        10.0, -10.0,
        10.0, 10.0,
        -10.0, 10.0,
        -10.0, -10.0);

    START_HOLE();

    POLY( 0.0, 5.0,
        -6.0, -5.0,
        6.0, -5.0,
        0.0, 5.0);
 
    style = 0;    /* not used currently */
    o_x = 0.0;    /* not used currently */
    o_y = 0.0;    /* not used currently */
    ang = 45.0;
    spc = 2.0;
 
    HATCH_FACE( style, o_x, o_y, ang, spc );
}

Another example:

Copy
hatch_test( )
{
    START_FACE( );
    POLY( -20, 0,
        -50, 0,
        -50, 50,
        50, 50,
        50, 0,
        20, 0);

    ARC( 20, 0,
        0, 0, 180);

    START_HOLE( );
    CIRCLE( 0, 40, 5);

    style = 0;        /* not used currently */
    o_x = 0.0;        /* not used currently */
    o_y = 0.0;        /* not used currently */
    ang = 45.0;
    spc = 2.0;
    HATCH_FACE( style, o_x, o_y, ang, spc );
}

Function Set

Miscellaneous Functions

Related Functions

START_FACE

START_HOLE