From f7b4cc602b9a646fbc66f3f17d6bb9c20efc3ead Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 24 Jan 2021 18:44:56 +0100 Subject: Initial commit --- .../Classes/ClipperOffset/Methods/AddPath.htm | 73 +++++++++++ .../Classes/ClipperOffset/Methods/AddPaths.htm | 74 +++++++++++ .../Classes/ClipperOffset/Methods/Clear.htm | 72 +++++++++++ .../Classes/ClipperOffset/Methods/Constructor.htm | 74 +++++++++++ .../Classes/ClipperOffset/Methods/Execute.htm | 111 +++++++++++++++++ .../ClipperOffset/Properties/ArcTolerance.htm | 74 +++++++++++ .../ClipperOffset/Properties/MiterLimit.htm | 75 ++++++++++++ .../ClipperLib/Classes/ClipperOffset/_Body.htm | 136 +++++++++++++++++++++ 8 files changed, 689 insertions(+) create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/AddPath.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/AddPaths.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Clear.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Constructor.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Execute.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Properties/ArcTolerance.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Properties/MiterLimit.htm create mode 100644 upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/_Body.htm (limited to 'upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset') diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/AddPath.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/AddPath.htm new file mode 100644 index 0000000..6aa26b8 --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/AddPath.htm @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + AddPath + + + + + + + + + + + + + + + + + + + + + + +

ClipperOffset.AddPath

+ + +

Del.» procedure AddPath(const Path: TPath; JoinType: TJoinType; EndType: TEndType);

+ +

C++ » void AddPath(const Path& path, JoinType jointype, EndType endtype);

+ +

C#  » public void AddPath(Path path, JoinType jointype, EndType endtype);

+
+ + +

Adds a Path to a ClipperOffset object in preparation for offsetting.

Any number of paths can be added, and each has its own JoinType and EndType. All 'outer' Paths must have the same orientation, and any 'hole' paths must have reverse orientation. Closed paths must have at least 3 vertices. Open paths may have as few as one vertex. Open paths can only be offset with positive deltas.

+ +

See Also

+

EndType, JoinType, Path

+ + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/AddPaths.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/AddPaths.htm new file mode 100644 index 0000000..b0fe3bc --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/AddPaths.htm @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + AddPaths + + + + + + + + + + + + + + + + + + + + + + +

ClipperOffset.AddPaths

+ + +

Del.» procedure AddPaths(const Paths: TPaths; JoinType: TJoinType; EndType: TEndType);

+ +

C++ » void AddPaths(const Paths& paths, JoinType jointype, EndType endtype);

+ +

C#  » public void AddPaths(Paths paths, JoinType jointype, EndType endtype);

+
+ + +

Adds Paths to a ClipperOffset object in preparation for offsetting.

Any number of paths can be added, and each path has its own JoinType and EndType. All 'outer' Paths must have the same orientation, and any 'hole' paths must have reverse orientation. Closed paths must have at least 3 vertices. Open paths may have as few as one vertex. Open paths can only be offset with positive deltas.

+ + +

See Also

+

EndType, JoinType, Paths

+ + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Clear.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Clear.htm new file mode 100644 index 0000000..7df15a6 --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Clear.htm @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + Clear + + + + + + + + + + + + + + + + + + + + + + +

ClipperOffset.Clear

+ + +

Del.» procedure Clear;

+ +

C++ » void Clear();

+ +

C#  » public void Clear();

+
+ + +

This method clears all paths from the ClipperOffset object, allowing new paths to be assigned.

+ + + + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Constructor.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Constructor.htm new file mode 100644 index 0000000..59eed6e --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Constructor.htm @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + Constructor + + + + + + + + + + + + + + + + + + + + + + +

ClipperOffset.Constructor

+ + +

Del.» constructor Create(MiterLimit: Double = 2; RoundPrecision: Double = 0.25);

+ +

C++ » ClipperOffset( double miterLimit = 2.0, double roundPrecision = 0.25);

+ +

C#  » public ClipperOffset( double miterLimit = 2.0, double roundPrecision = 0.25);

+
+ + +

The ClipperOffset constructor takes 2 optional parameters: MiterLimit and ArcTolerance. Thes two parameters corresponds to properties of the same name. MiterLimit is only relevant when JoinType is jtMiter, and ArcTolerance is only relevant when JoinType is jtRound or when EndType is etOpenRound.

+ + +

See Also

+

ArcTolerance, MiterLimit

+ + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Execute.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Execute.htm new file mode 100644 index 0000000..5ac748d --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Execute.htm @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + Execute + + + + + + + + + + + + + + + + + + + + + + +

ClipperOffset.Execute

+ + +

Del.» procedure Execute(out solution: TPaths; Delta: Double); overload;

+ +

C++ » void Execute(Paths& solution, double delta);

+ +

C#  » public void Execute(ref Paths solution, double delta);

+
+ +

Del.» procedure Execute(out PolyTree: TPolyTree; Delta: Double); overload;

+ +

C++ » void Execute(PolyTree& polytree, double delta);

+ +

C#  » public void Execute(ref PolyTree polytree, double delta);

+
+ + +

This method takes two parameters. The first is the structure that receives the result of the offset operation (either a PolyTree or a Paths structure). The second parameter is the amount to which the supplied paths will be offset. Negative delta values shrink polygons and positive delta expand them.

This method can be called multiple times, offsetting the same paths by different amounts (ie using different deltas).

+ + + + + + +
+ +
+#include "clipper.hpp"  
+...
+using namespace ClipperLib;
+
+int main()
+{
+  Path subj;
+  Paths solution;
+  subj << 
+    IntPoint(348,257) << IntPoint(364,148) << IntPoint(362,148) << 
+    IntPoint(326,241) << IntPoint(295,219) << IntPoint(258,88) << 
+    IntPoint(440,129) << IntPoint(370,196) << IntPoint(372,275);
+  ClipperOffset co;
+  co.AddPath(subj, jtRound, etClosedPolygon);
+  co.Execute(solution, -7.0);
+  
+  //draw solution ...
+  DrawPolygons(solution, 0x4000FF00, 0xFF009900);
+}
+          
+ + +

 

+ + + + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Properties/ArcTolerance.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Properties/ArcTolerance.htm new file mode 100644 index 0000000..9cfc79c --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Properties/ArcTolerance.htm @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + ArcTolerance + + + + + + + + + + + + + + + + + + + + + + +

ClipperOffset.ArcTolerance

+ +

Del.» property ArcTolerance: double; //read and write

+ +

C++ » double ArcTolerance;

+ +

C#  » public double ArcTolerance {get; set;}

+
+ +

Firstly, this field/property is only relevant when JoinType = jtRound and/or EndType = etRound.

Since flattened paths can never perfectly represent arcs, this field/property specifies a maximum acceptable imprecision ('tolerance') when arcs are approximated in an offsetting operation. Smaller values will increase 'smoothness' up to a point though at a cost of performance and in creating more vertices to construct the arc.

The default ArcTolerance is 0.25 units. This means that the maximum distance the flattened path will deviate from the 'true' arc will be no more than 0.25 units (before rounding).

Reducing tolerances below 0.25 will not improve smoothness since vertex coordinates will still be rounded to integer values. The only way to achieve sub-integer precision is through coordinate scaling before and after offsetting (see example below).

It's important to make ArcTolerance a sensible fraction of the offset delta (arc radius). Large tolerances relative to the offset delta will produce poor arc approximations but, just as importantly, very small tolerances will substantially slow offsetting performance while providing unnecessary degrees of precision. This is most likely to be an issue when offsetting polygons whose coordinates have been scaled to preserve floating point precision.

Example: Imagine a set of polygons (defined in floating point coordinates) that is to be offset by 10 units using round joins, and the solution is to retain floating point precision up to at least 6 decimal places.
To preserve this degree of floating point precision, and given that Clipper and ClipperOffset both operate on integer coordinates, the polygon coordinates will be scaled up by 108 + (and rounded to integers) prior to offsetting. Both offset delta and ArcTolerance will also need to be scaled by this same factor. If ArcTolerance was left unscaled at the default 0.25 units, every arc in the solution would contain a fraction of 44 THOUSAND vertices while the final arc imprecision would be 0.25 × 10-8 + units (ie once scaling was reversed). However, if 0.1 units was an acceptable imprecision in the final unscaled solution, then ArcTolerance should be set to 0.1 × scaling_factor (0.1 × 108 + ). Now if scaling is applied equally to both ArcTolerance and to Delta Offset, then in this example the number of vertices (steps) defining each arc would be a fraction of 23.

The formula for the number of steps in a full circular arc is ... Pi / acos(1 - arc_tolerance / abs(delta))

+ +

See Also

+

offset_triginometry2

+ + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Properties/MiterLimit.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Properties/MiterLimit.htm new file mode 100644 index 0000000..3bdf826 --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Properties/MiterLimit.htm @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + MiterLimit + + + + + + + + + + + + + + + + + + + + + + +

ClipperOffset.MiterLimit

+ + +

Del.» property MiterLimit: double; //read and write

+ +

C++ » double MiterLimit;

+ +

C#  » public double MiterLimit {get; set;}

+
+ + +

This property sets the maximum distance in multiples of delta that vertices can be offset from their original positions before squaring is applied. (Squaring truncates a miter by 'cutting it off' at 1 × delta distance from the original vertex.)

The default value for MiterLimit is 2 (ie twice delta). This is also the smallest MiterLimit that's allowed. If mitering was unrestricted (ie without any squaring), then offsets at very acute angles would generate unacceptably long 'spikes'.

An example of an offsetting 'spike' at a narrow angle that's a consequence of using a large MiterLimit (25) ...

+ + + +

See Also

+

JoinType

+ + + + + + \ No newline at end of file diff --git a/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/_Body.htm b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/_Body.htm new file mode 100644 index 0000000..337ed71 --- /dev/null +++ b/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/_Body.htm @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + ClipperOffset + + + + + + + + + + + + + + + + + + + + + + + +

ClipperOffset

+
+ +

The ClipperOffset class encapsulates the process of offsetting (inflating/deflating) both open and closed paths using a number of different join types and end types.

(This class replaces the now deprecated OffsetPaths function which was less flexible.)

Preconditions for offsetting:
1. The orientations of closed paths must be consistent such that outer polygons share the same orientation, and any holes have the opposite orientation (ie non-zero filling). Open paths must be oriented with closed outer polygons.
2. Polygons must not self-intersect.

Limitations:
When offsetting, small artefacts may appear where polygons overlap. To avoid these artefacts, offset overlapping polygons separately.


+ + + + + + +
+ +
+#include "clipper.hpp"  
+...
+using namespace ClipperLib;
+
+int main()
+{
+  Path subj;
+  Paths solution;
+  subj << 
+    IntPoint(348,257) << IntPoint(364,148) << IntPoint(362,148) << 
+    IntPoint(326,241) << IntPoint(295,219) << IntPoint(258,88) << 
+    IntPoint(440,129) << IntPoint(370,196) << IntPoint(372,275);
+  ClipperOffset co;
+  co.AddPath(subj, jtRound, etClosedPolygon);
+  co.Execute(solution, -7.0);
+  
+  //draw solution ...
+  DrawPolygons(solution, 0x4000FF00, 0xFF009900);
+}
+          
+ + +

 

+ +

Reference

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Methods + Properties +
In ClipperOffset: +
AddPath + ArcTolerance +
AddPaths + MiterLimit +
Clear + +
Constructor + +
Execute + +
+ + + + + + \ No newline at end of file -- cgit