ZFillFunction

Home | ClipperLib | Clipper |

# Clipper.ZFillFunction

Del.» property ZFillFunction: TZFillCallback read FZFillCallback write FZFillCallback;

C++ » void ZFillFunction(ZFillCallback zFillFunc);

C# » public ZFillCallback ZFillFunction { get; set; };

This property is only exposed if the Preprocessor directive use_xyz has been defined. (If it is defined, a Z member will be added to the IntPoint structure.) When a custom callback function is assigned it will be called during clipping operations so custom Z values can be assigned intersection vertices.
Vertices in the solution of clipping operations more often than not correspond to input (subject or clip) vertices, but those vertices created at edge intersections do not. While the X and Y coordinates for these 'intersection' vertices are obviously defined by the points of intersection, there's no obvious way to assign their Z values. It really depends on the needs of the library user. While there are 4 vertices directly influencing an intersection vertex (ie the vertices on each end of the 2 intersecting edges), in an attempt to keep things simple only the vertices bounding one edge will be passed to the callback function.
The CurvesDemo application in the Curves directory in the distrubution zip package shows how the Z member together with the callback function can be used to flatten curved paths (defined by control points) and after clipping, to 'de-flatten' or reconstruct curved paths in the clipping solution.

    Del. » procedure MyCallback(const Vert1, Vert2: TIntPoint; var IntersectPt: TIntPoint);
    C++  » void MyCallback(const IntPoint& vert1, const IntPoint& vert2, IntPoint& intersectPt){...}
    C#   » public static void MyCallback(IntPoint vert1, IntPoint vert2, ref IntPoint intersectPt){...}

## See Also

Defines, IntPoint, ZFillCallback

Copyright ©2010-2014 Angus Johnson - Clipper Ver 6.1.3 - Help file built on 20-January-2014