A fillet is tangential to two lines. The curve of the fillet is always tangential to a line drawn between its start and control points and a line drawn between its end and control points.

The following figure shows an example of how to draw a single curve, using the current position and two control points.

#include <os2.h>
    HPS hps;                                 /* Presentation-space handle    */

MRESULT EXPENTRY wpClient(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2){
    POINTL aptl[2];                /* Structure for control points           */

        aptl[0].x = 50;            /* Loads x-coord. of first control point  */
        aptl[0].y = 50;            /* Loads y-coord. of first control point  */
        GpiMove(hps, aptl);                  /* Sets current position        */
        aptl[0].x = 75;            /* Loads x-coord. of second control point */
        aptl[0].y = 75;            /* Loads y-coord. of second control point */
        aptl[1].x = 100;           /* Loads x-coord. of third control point  */
        aptl[1].y = 50;            /* Loads y-coord. of third control point  */
        GpiPolyFillet(hps, 2, aptl); /* Draws fillet                         */
} /* wpClient */

When you draw a sharp fillet, the sharpness value controls the shape of the curve, as shown in a previous table.

The following figure shows an example of using a sharpness value of 3, which creates a hyperbolic curve.

#include <os2.h>
    HPS hps;                        /* Presentation-space handle             */

MRESULT EXPENTRY wpClient(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2){
        POINTL aptl[2];            /* Structure for control points           */
        FIXED fxSharpness;         /* Sharpness value                        */

        aptl[0].x = 50;            /* Loads x-coord. of first control point  */
        aptl[0].y = 50;            /* Loads y-coord. of first control point  */
        GpiMove(hps, aptl);        /* Sets current position                  */
        aptl[0].x = 75;            /* Loads x-coord. of second control point */
        aptl[0].y = 75;            /* Loads y-coord. of second control point */
        aptl[1].x = 100;           /* Loads x-coord. of third control point  */
        aptl[1].y = 50;            /* Loads y-coord. of third control point  */
        fxSharpness = MAKEFIXED(3, 0);   /* Sets sharpness value             */
        GpiPolyFilletSharp(hps,    /* Draws fillet                           */
            2L, aptl, &fxSharpness);
} /* wpClient */


[Back] [Next]