JoinType
Delphi type TJoinType = (jtMiter, jtBevel, jtSquare, jtRound);
C++ enum JoinType {Miter, Bevel, Square, Round};
C# public enum JoinType {Miter, Bevel, Square, Round};
The JoinType enumeration is only needed when offsetting (inflating/shrinking). It isn't needed for polygon clipping. It specifies how to manage offsetting at convex angled joins. Concave joins will always be offset with a mitered join.
When adding paths to a ClipperOffset object via the AddPaths method, the JoinType parameter must specify one of the following types - Miter, Square, Bevel or Round.
Note: the inner angle at vertex A is more acute than the one at B and the mitered offset would exceed the specified 'miter limit' (default = 2).
- JoinType.Miter: Edges are first offset a specified distance away from and parallel to their original (ie starting) edge positions. These offset edges are then extended to points where they intersect with adjacent edge offsets. However a limit must be imposed on how far mitered vertices can be from their original positions to avoid very convex joins producing unreasonably long and narrow spikes). To avoid unsightly spikes, joins will be 'squared' wherever distances between original vertices and their calculated offsets exceeds a specified value (expressed as a ratio relative to the offset distance).
- JoinType.Square: Convex joins will be truncated using a 'squaring' edge. And the mid-points of these squaring edges will be exactly the offset distance away from their original (or starting) vertices.
- JoinType.Bevel: Bevelled joins are similar to 'squared' joins except that squaring won't occur at a fixed distance. While bevelled joins may not be as pretty as squared joins, bevelling is much easier (ie faster) than squaring. And perhaps this is why bevelling rather than squaring is preferred in numerous graphics display formats (including SVG and PDF document formats).
- JoinType.Round: Rounding is applied to all convex joins with the arc radius being the offset distance, and the original join vertex the arc center.
See Also
Clipper.Offset, ClipperOffset, ClipperOffset.AddPaths, ClipperOffset.MiterLimit
Copyright © 2010-2024 Angus Johnson - Clipper2 1.3.0 - Help file built on 14 Jan 2024