From f7b4cc602b9a646fbc66f3f17d6bb9c20efc3ead Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 24 Jan 2021 18:44:56 +0100 Subject: Initial commit --- .../Docs/Units/ClipperLib/Types/CInt.htm | 70 +++++++++++++++ .../Docs/Units/ClipperLib/Types/ClipType.htm | 100 +++++++++++++++++++++ .../Docs/Units/ClipperLib/Types/EndType.htm | 88 ++++++++++++++++++ .../Docs/Units/ClipperLib/Types/InitOptions.htm | 75 ++++++++++++++++ .../Docs/Units/ClipperLib/Types/IntPoint.htm | 73 +++++++++++++++ .../Docs/Units/ClipperLib/Types/IntRect.htm | 69 ++++++++++++++ .../Docs/Units/ClipperLib/Types/JoinType.htm | 78 ++++++++++++++++ .../Docs/Units/ClipperLib/Types/Path.htm | 69 ++++++++++++++ .../Docs/Units/ClipperLib/Types/Paths.htm | 76 ++++++++++++++++ .../Docs/Units/ClipperLib/Types/PolyFillType.htm | 83 +++++++++++++++++ .../Docs/Units/ClipperLib/Types/PolyType.htm | 73 +++++++++++++++ .../Docs/Units/ClipperLib/Types/ZFillCallback.htm | 71 +++++++++++++++ 12 files changed, 925 insertions(+) create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/CInt.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/ClipType.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/EndType.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/InitOptions.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/IntPoint.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/IntRect.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/JoinType.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/Path.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/Paths.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/PolyFillType.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/PolyType.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/ZFillCallback.htm (limited to 'upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types') diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/CInt.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/CInt.htm new file mode 100644 index 0000000..1af7f15 --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/CInt.htm @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + CInt + + + + + + + + + + + + + + + + + + + + + +

CInt

+ + +

Del.»
{$IFDEF use_int32}
 cInt = Int32;
{$ELSE}
  cInt = Int64;
{$ENDIF}

+ +

C++ »
#ifdef use_int32
  typedef int cInt;
#else
  typedef signed long long cInt;
#endif

+ +

C#  »
#if use_int32
  using cInt = Int32;
#else
  using cInt = Int64;
#endif

+ + +

cInt is the integer type used by the Clipper Library to represent vertex coordinate values. (See also IntPoint.)

The library uses integers instead of floating point values to preserve numerical robustness. (Very early versions of the library used floating point coordinates, but it became apparent that floating point imprecision was always going to cause occasional errors.)

By default cInt represents a signed 64bit integer and polygon coordinates can have any value in the range ± 9.2e+18. This accommodates the scaling of floating point coordinate values to very large integers so that very high degrees of precision can be retained during clipping. However, if coordinate values can be kept within the range ± 3.0e+9, then by avoiding large integer math, a modest ~10% improvement in clipping performance is achieved.

If the preprocessor directive use_int32 is defined, cInt will represent a signed 32bit integer. This improves clipping performance by 20-30% but the trade-off is that coordinate values are restricted to the much narrower range of ± 46340.

+ +

See Also

+

Defines, IntPoint

+ + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/ClipType.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/ClipType.htm new file mode 100644 index 0000000..aabc455 --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/ClipType.htm @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + ClipType + + + + + + + + + + + + + + + + + + + + + +

ClipType

+ + +

Del.» type TClipType = (ctIntersection, ctUnion, ctDifference, ctXor);

+ +

C++ » enum ClipType { ctIntersection, ctUnion, ctDifference, ctXor };

+ +

C#  » public enum ClipType { ctIntersection, ctUnion, ctDifference, ctXor };

+
+ + +

There are four boolean operations - AND, OR, NOT & XOR.

Given that subject and clip polygon brush 'filling' is defined both by their vertices and their respective filling rules, the four boolean operations can be applied to polygons to define new filling regions: +


+ + +


     

All polygon clipping is performed with a Clipper object with the specific boolean operation indicated by the ClipType parameter passed in its Execute method.


+ + +

With regard to open paths (polylines), clipping rules generally match those of closed paths (polygons).
However, when there are both polyline and polygon subjects, the following clipping rules apply: +


+ + +

Example of clipping behaviour when mixing polyline and polygon subjects:

+ + + +

See Also

+

Overview, Clipper, Clipper.Execute, PolyFillType

+ + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/EndType.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/EndType.htm new file mode 100644 index 0000000..3c1f21d --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/EndType.htm @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + EndType + + + + + + + + + + + + + + + + + + + + + +

EndType

+ +

Del.» type TEndType = (etClosedPolygon, etClosedLine, etOpenSquare, etOpenRound, etOpenButt);

+ +

C++ » enum EndType {etClosedPolygon, etClosedLine, etOpenSquare, etOpenRound, etOpenButt};

+ +

C#  » public enum EndType {etClosedPolygon, etClosedLine, etOpenSquare, etOpenRound, etOpenButt};

+
+ +

The EndType enumerator has 5 values: +

+ + +

Note: With etClosedPolygon and etClosedLine types, the path closure will be the same regardless of whether or not the first and last vertices in the path match.




+ + +

See Also

+

ClipperOffset.AddPath, ClipperOffset.AddPaths

+ + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/InitOptions.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/InitOptions.htm new file mode 100644 index 0000000..0c41d2a --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/InitOptions.htm @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + InitOptions + + + + + + + + + + + + + + + + + + + + + +

InitOptions

+ + +

Del.» type TInitOption = (ioReverseSolution, ioStrictlySimple, ioPreserveCollinear);

+ +

C++ » enum InitOptions {
        ioReverseSolution  = 1,
        ioStrictlySimple   = 2,
        ioPreserveCollinear = 4};

+ +

C#  » public const int ioReverseSolution  = 1;
      public const int ioStrictlySimple   = 2;
      public const int ioPreserveCollinear = 4;

+
+ + +

+ + + + + +

See Also

+

Clipper.Constructor, Clipper.PreserveCollinear, Clipper.ReverseSolution, Clipper.StrictlySimple

+ + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/IntPoint.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/IntPoint.htm new file mode 100644 index 0000000..7fbb7ff --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/IntPoint.htm @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + IntPoint + + + + + + + + + + + + + + + + + + + + + +

IntPoint

+ +

Del.» TIntPoint = record X, Y: cInt; end;

+ +

C++ » struct IntPoint { cInt X; cInt Y; ... };

+ +

C#  » public class IntPoint { public cInt X; { get; set; } public cInt Y; { get; set; } ... };

+
+ + +

The IntPoint structure is used to represent all vertices in the Clipper Library. An integer storage type has been deliberately chosen to preserve numerical robustness. (Early versions of the library used floating point coordinates, but it became apparent that floating point imprecision would always cause occasional errors.)

A sequence of IntPoints are contained within a Path structure to represent a single contour.

As of version 6, IntPoint now has an optional third member 'Z'. This can be enabled by exposing (ie uncommenting) the PreProcessor define 'use_xyz'. When the Z member is used, its values will be copied to corresponding verticies in solutions to clipping operations. However, at points of intersection where there's no corresponding Z value, the value will be assigned zero unless a new value is provided by a user supplied callback function.

Users wishing to clip or offset polygons containing floating point coordinates need to use appropriate scaling when converting these values to and from IntPoints.

See also the notes on rounding.

+ + + + +

See Also

+

Rounding, Clipper.ZFillFunction, Defines, CInt, Path, Paths

+ + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/IntRect.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/IntRect.htm new file mode 100644 index 0000000..baaa12b --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/IntRect.htm @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + IntRect + + + + + + + + + + + + + + + + + + + + + +

IntRect

+ +

Del.»
TIntRect = record left, top, right, bottom: cInt; end;

+ +

C++ »
struct IntRect { cInt left; cInt top; cInt right; cInt bottom; ... };

+ +

C#  »
public class IntRect {
  public cInt left; { get; set; }
  public cInt top; { get; set; }
  public cInt right; { get; set; }
  public cInt bottom; { get; set; } ... };

+ +

Structure returned by Clipper's GetBounds method.


+ + +

See Also

+

ClipperBase.GetBounds, CInt

+ + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/JoinType.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/JoinType.htm new file mode 100644 index 0000000..1820138 --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/JoinType.htm @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + JoinType + + + + + + + + + + + + + + + + + + + + + +

JoinType

+ +

Del.» type TJoinType = (jtSquare, jtRound, jtMiter);

+ +

C++ » enum JoinType {jtSquare, jtRound, jtMiter};

+ +

C#  » public enum JoinType {jtSquare, jtRound, jtMiter};

+
+ +

When adding paths to a ClipperOffset object via the AddPaths method, the joinType parameter may be one of three types - jtMiter, jtSquare or jtRound.



+

+ +

See Also

+

ClipperOffset, ClipperOffset.AddPaths, ClipperOffset.ArcTolerance, ClipperOffset.MiterLimit

+ + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/Path.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/Path.htm new file mode 100644 index 0000000..f4d8748 --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/Path.htm @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + Path + + + + + + + + + + + + + + + + + + + + + +

Path

+ +

Del.» TPath = array of TIntPoint;

+ +

C++ » typedef std::vector<IntPoint> Path;

+ +

C#  » using Path = List<IntPoint>;

+
+ +

This structure contains a sequence of IntPoint vertices defining a single contour (see also terminology). Paths may be open and represent a series of line segments bounded by 2 or more vertices, or they may be closed and represent polygons. Whether or not a path is open depends on context. Closed paths may be 'outer' contours or 'hole' contours. Which they are depends on orientation.

Multiple paths can be grouped into a Paths structure.

+ +

See Also

+

Overview, Example, ClipperBase.AddPath, PolyTree, Orientation, IntPoint, Paths

+ + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/Paths.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/Paths.htm new file mode 100644 index 0000000..417b069 --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/Paths.htm @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + Paths + + + + + + + + + + + + + + + + + + + + + +

Paths

+ + +

Del.» TPaths = array of TPath;

+ +

C++ » typedef std::vector< Path > Paths;

+ +

C#  » using Paths = List<List< IntPoint >>;

+
+ +

This structure is fundamental to the Clipper Library. It's a list or array of one or more Path structures. (The Path structure contains an ordered list of vertices that make a single contour.)

Paths may open (a series of line segments), or they may closed (polygons). Whether or not a path is open depends on context. Closed paths may be 'outer' contours or 'hole' contours. Which they are depends on orientation.

+
+ + + + + + +

See Also

+

Clipper.Execute, ClipperBase.AddPath, ClipperBase.AddPaths, OffsetPaths, IntPoint, Path

+ + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/PolyFillType.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/PolyFillType.htm new file mode 100644 index 0000000..7a2f93d --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/PolyFillType.htm @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + PolyFillType + + + + + + + + + + + + + + + + + + + + + +

PolyFillType

+ + +

Del.» type TPolyFillType = (pftEvenOdd, pftNonZero, pftPositive, pftNegative);

+ +

C++ » enum PolyFillType {pftEvenOdd, pftNonZero, pftPositive, pftNegative};

+ +

C#  » public enum PolyFillType {pftEvenOdd, pftNonZero, pftPositive, pftNegative};

+
+ + +

Filling indicates those regions that are inside a closed path (ie 'filled' with a brush color or pattern in a graphical display) and those regions that are outside. The Clipper Library supports 4 filling rules: Even-Odd, Non-Zero, Positive and Negative.

The simplest filling rule is Even-Odd filling (sometimes called alternate filling). Given a group of closed paths start from a point outside the paths and progress along an imaginary line through the paths. When the first path is crossed the encountered region is filled. When the next path is crossed the encountered region is not filled. Likewise, each time a path is crossed, filling starts if it had stopped and stops if it had started.

With the exception of Even-Odd filling, all other filling rules rely on edge direction and winding numbers to determine filling. Edge direction is determined by the order in which vertices are declared when constructing a path. Edge direction is used to determine the winding number of each polygon subregion.

The winding number for each polygon sub-region can be derived by:

    + +
  1. starting with a winding number of zero and
  2. + +
  3. from a point (P1) that's outside all polygons, draw an imaginary line to a point that's inside a given sub-region (P2)
  4. + +
  5. while traversing the line from P1 to P2, for each path that crosses the imaginary line from right to left increment the winding number, and for each path that crosses the line from left to right decrement the winding number.
  6. + +
  7. Once you arrive at the given sub-region you have its winding number.
  8. + +

+ +


Even-Odd (Alternate): Odd numbered sub-regions are filled, while even numbered sub-regions are not.
Non-Zero (Winding): All non-zero sub-regions are filled.
Positive: All sub-regions with winding counts > 0 are filled.
Negative: All sub-regions with winding counts < 0 are filled.

Paths are added to a Clipper object using the AddPath or AddPaths methods and the filling rules (for subject and clip polygons separately) are specified in the Execute method.

Polygon regions are defined by one or more closed paths which may or may not intersect. A single polygon region can be defined by a single non-intersecting path or by multiple non-intersecting paths where there's typically an 'outer' path and one or more inner 'hole' paths. Looking at the three shapes in the image above, the middle shape consists of two concentric rectangles sharing the same clockwise orientation. With even-odd filling, where orientation can be disregarded, the inner rectangle would create a hole in the outer rectangular polygon. There would be no hole with non-zero filling. In the concentric rectangles on the right, where the inner rectangle is orientated opposite to the outer, a hole will be rendered with either even-odd or non-zero filling. A single path can also define multiple subregions if it self-intersects as in the example of the 5 pointed star shape below.

        

By far the most widely used fill rules are Even-Odd (aka Alternate) and Non-Zero (aka Winding). Most graphics rendering libraries (AGG, Android Graphics, Cairo, GDI+, OpenGL, Quartz 2D etc) and vector graphics storage formats (SVG, Postscript, Photoshop etc) support both these rules. However some libraries (eg Java's Graphics2D) only support one fill rule. Android Graphics and OpenGL are the only libraries (that I'm aware of) that support multiple filling rules.

It's useful to note that edge direction has no affect on a winding number's odd-ness or even-ness. (This is why orientation is ignored when the Even-Odd rule is employed.)

The direction of the Y-axis does affect polygon orientation and edge direction. However, changing Y-axis orientation will only change the sign of winding numbers, not their magnitudes, and has no effect on either Even-Odd or Non-Zero filling.

+ +

See Also

+

Clipper.Execute, ClipperBase.AddPath, ClipperBase.AddPaths, Orientation

+ + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/PolyType.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/PolyType.htm new file mode 100644 index 0000000..48fc46c --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/PolyType.htm @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + PolyType + + + + + + + + + + + + + + + + + + + + + +

PolyType

+ + +

Del.» type TPolyType = (ptSubject, ptClip);

+ +

C++ » enum PolyType { ptSubject, ptClip };

+ +

C#  » public enum PolyType { ptSubject, ptClip };

+
+ +

Boolean (clipping) operations are mostly applied to two sets of Polygons, represented in this library as subject and clip polygons. Whenever Polygons are added to the Clipper object, they must be assigned to either subject or clip polygons.

UNION operations can be performed on one set or both sets of polygons, but all other boolean operations require both sets of polygons to derive meaningful solutions.

+ + + + +

See Also

+

ClipperBase.AddPath, ClipperBase.AddPaths, ClipType

+ + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/ZFillCallback.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/ZFillCallback.htm new file mode 100644 index 0000000..95862c2 --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/ZFillCallback.htm @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + ZFillCallback + + + + + + + + + + + + + + + + + + + + + +

ZFillCallback

+ + +

Del.» type TZFillCallback = procedure (const E1Bot, E1Top, E2Bot, E2Top: TIntPoint; var Pt: TIntPoint);

+ +

C++ » typedef void (*ZFillCallback)(const IntPoint& e1bot, IntPoint& e1top, IntPoint& e2bot, IntPoint& e2top, IntPoint& pt);

+ +

C#  » public delegate void ZFillCallback(IntPoint bot1, IntPoint top1, IntPoint bot2, IntPoint top2, ref IntPoint pt);

+
+ +

If the use_xyz pre-processor directive is enabled, then the IntPoint class will have an extra 'Z' member and the Clipper class's ZFillFunction property will be exposed so it can be assigned a custom callback function.

This custom callback procedure requires five IntPoint parameters: the first 2 parameters are the vertices that define one line segment involved in the intersection and the next two parameters the other line segment. (Since the Clipper library has been developed in an environment that uses an inverted Y axis display, e1bot and e2bot will always have Y values greater than or equal to their corresponding e1top and e2top Y values.) The last IntPoint parameter contain the actual coordinates at the intersection. This last parameter is passed by reference so that its Z member can be assigned with a custom value.

+ + +

See Also

+

Clipper.ZFillFunction, Defines

+ + + + + + \ No newline at end of file -- cgit