The Clipper library performs line & polygon clipping - intersection, union, difference & exclusive-or, and line & polygon offsetting. The library is based on Vatti's clipping algorithm.
Documentation: http://www.angusj.com/delphi/clipper.php
- Several minor bugfixes: #152 #160 #161 #162
- Numerous generally minor bugfixes
- Bugfix in ClipperOffset.Execute where the Polytree.IsHole property was returning incorrect values with negative offsets
- Very minor improvement to join rounding in ClipperOffset
- Fixed CPP OpenGL demo.
- Numerous minor bugfixes, too many to list. (See revisions 454-475 in Sourceforge Repository)
- The ZFillFunction (custom callback function) has had its parameters changed.
- Curves demo removed (temporarily).
- Deprecated functions have been removed.
- Improved the joining of output polygons sharing a common edge when those common edges are horizontal.
- Fixed a bug in ClipperOffset.AddPath() which would produce incorrect solutions when open paths were added before closed paths.
- Minor code tidy and performance improvement
- Fixed bugs in MinkowskiSum
- Fixed minor bug when using Clipper.ForceSimplify.
- Modified use_xyz callback so that all 4 vertices around an intersection point are now passed to the callback function.
- Fixed buggy PointInPolygon function (C++ and C# only). Note this bug only affected the newly exported function, the internal PointInPolygon function used by Clipper was OK.
- Fixed potential endless loop condition when adding open paths to Clipper.
- Fixed missing implementation of SimplifyPolygon function in C++ code.
- Fixed incorrect upper range constant for polygon coordinates in Delphi code.
- Added PointInPolygon function.
- Overloaded MinkowskiSum function to accommodate multi-contour paths.
- Fixed broken C++ header file.
- Minor improvement to joining polygons.
- Fixed a couple of bugs affecting open paths that could raise unhandled exceptions.
- Deleted: Previously deprecated code has been removed.
- Modified: The OffsetPaths function is now deprecated as it has been replaced by the ClipperOffset class which is much more flexible.
- Bugfixes: Several minor bugs have been fixed including occasionally an incorrect nesting within the PolyTree structure.
- Added: Open path (polyline) clipping. A new 'Curves' demo application showcases this (see the 'Curves' directory).
- Update: Major improvement in the merging of shared/collinear edges in clip solutions (see Execute).
- Added: The IntPoint structure now has an optional 'Z' member. (See the precompiler directive use_xyz.)
- Added: Users can now force Clipper to use 32bit integers (via the precompiler directive use_int32) instead of using 64bit integers.
- Modified: To accommodate open paths, the Polygon and Polygons structures have been renamed Path and Paths respectively. The AddPolygon and AddPolygons methods of the ClipperBase class have been renamed AddPath and AddPaths respectively. Several other functions have been similarly renamed.
- Modified: The PolyNode Class has a new IsOpen property.
- Modified: The Clipper class has a new ZFillFunction property.
- Added: MinkowskiSum and MinkowskiDiff functions added.
- Added: Several other new functions have been added including PolyTreeToPaths, OpenPathsFromPolyTree and ClosedPathsFromPolyTree.
- Added: The Clipper constructor now accepts an optional InitOptions parameter to simplify setting properties.
- Bugfixes: Numerous minor bugs have been fixed.
- Deprecated: Version 6 is a major upgrade from previous versions and quite a number of changes have been made to exposed structures and functions. To minimize inconvenience to existing library users, some code has been retained and some added to maintain backward compatibility. However, because this code will be removed in a future update, it has been marked as deprecated and a precompiler directive use_deprecated has been defined.
- BugFix: CleanPolygon function was buggy.
- Changed: The behaviour of the 'miter' JoinType has been changed so that when squaring occurs, it's no longer extended up to the miter limit but is squared off at exactly 'delta' units. (This improves the look of mitering with larger limits at acute angles.)
- Added: New OffsetPolyLines function
- Update: Minor code refactoring and optimisations
- Added: ForceSimple property to Clipper class
- Update: Improved documentation
- Update: CleanPolygon function enhanced.
- Update: Documentation improved.
- Bugfix: Minor bugfixes.
- Update: Documentation significantly improved.
- Bugfix: PolyNode class was missing a constructor.
- Update: The MiterLimit parameter in the OffsetPolygons function has been renamed Limit and can now also be used to limit the number of vertices used to construct arcs when JoinType is set to jtRound.
- Update: ExPolygons has been replaced with the PolyTree & PolyNode classes to more fully represent the parent-child relationships of the polygons returned by Clipper.
- Added: New CleanPolygon and CleanPolygons functions.
- Bugfix: Another orientation bug fixed.
- Bugfix: Significant fixes in and tidy of the internal Int128 class (which is used only when polygon coordinate values are greater than ±0x3FFFFFFF (~1.07e9)).
- Update: The Area algorithm has been updated and is faster.
- Update: Documentation updates. The newish but undocumented 'CheckInputs' parameter of the OffsetPolygons function has been renamed 'AutoFix' and documented too. The comments on rounding have also been improved (ie clearer and expanded).
- Bugfix: Orientation bugs should now be resolved (finally!).
- Bugfix: Bug in Int128 class
- Bugfix: Further fixes to rare Orientation bug.
- Bugfix: Bug that very rarely returned the wrong polygon orientation.
- Bugfix: Obscure bug affecting OffsetPolygons when using jtRound for the JoinType parameter and when polygons also contain very large coordinate values (> +/-100000000000).
- Bugfix: Another obscure bug related to joining polygons.
- Bugfix: Bugs in Int128 class occasionally causing wrong orientations.
- Bugfix: Further fixes related to joining polygons.
- Bugfix: Obscure bug related to joining polygons.
- Bugfix: Obscure bug related to precision of intersections.
- Bugfix: Fixed bug in OffsetPolygons function introduced in version 4.8.5.
- Bugfix: ReversePolygon function in C++ translation was broken.
- Bugfix: Two obscure bugs affecting orientation fixed too.
- Bugfix: Potential for memory overflow errors when using ExPolygons structure.
- Bugfix: The polygon coordinate range has been reduced to +/- 0x3FFFFFFFFFFFFFFF (4.6e18).
- Update: ReversePolygons function was misnamed ReversePoints in C++.
- Update: SimplifyPolygon function now takes a PolyFillType parameter.
- Bugfix: Potential for memory overflow errors in OffsetPolygons().
- Bugfix: Another obscure bug affecting ExPolygons structure.
- Bugfix: Obscure bug causing incorrect removal of a vertex.
- Bugfix: Obscure bug could cause an exception when using ExPolygon structure.
- Update: Cody tidy and minor bug fixes.
- Bugfix: Occasional errors in orientation fixed.
- Update: Added notes on rounding to the documentation.
- Fixed a bug in Orientation function (affecting C# translations only).
- Minor documentation update.
- Bugfix: Fixed a recently introduced bug that occasionally caused an unhandled exception in C++ and C# translations.
- Bugfix: Another minor bugfix.
- Bugfix: Fixed bug introduced in ver 4.7 which sometimes caused an exception if ExPolygon structure was passed to Clipper's Execute method.
- Bugfix: Rare crash when JoinCommonEdges joined polygons that 'cancelled' each other.
- Bugfix: Clipper's internal Orientation method occasionally returned wrong result.
- Update: Improved C# code (thanks to numerous excellent suggestions from David Piepgrass)
- Improved the joining of output polygons sharing a common edge.
- Bugfix: Another obscure bug occasionally causing incorrect polygon orientation.
- Bugfix: Obscure bug occasionally causing incorrect hole assignment in ExPolygon structure.
- Added: SimplifyPolygon and SimplifyPolygons functions.
- Bugfix: Fixed another minor mitering bug in OffsetPolygons.
- Bugfix: Fixed a rare bug in the orientation of polygons returned by Clipper's Execute() method.
- Bugfix: Previous update introduced a mitering bug in the OffsetPolygons function.
- Added: Support for Positive and Negative polygon fill types (in addition to the EvenOdd and NonZero fill types).
- Bugfix: The OffsetPolygons function was generating the occasional artefact when 'shrinking' polygons.
- Bugfix: Fixed an obscure bug in Clipper's JoinCommonEdges method.
- Update: Replaced IsClockwise function with Orientation function. The orientation issues affecting OffsetPolygons should now be finally resolved.
- Change: The Area function once again returns a signed value.
- Deleted: The UseFullCoordinateRange property has been deleted since integer range is now managed implicitly.
- BugFix: Minor bug in OffsetPolygon mitering.
- Change: C# JoinType enum moved from Clipper class to ClipperLib namespace.
- Change: The Area function now returns the absolute area (irrespective of orientation).
- Change: The IsClockwise function now requires a second parameter - YAxisPositiveUpward - to accommodate displays with Y-axis oriented in either direction
- Change: Deleted jtButt from JoinType (used by the OffsetPolygons function).
- BugFix: Fixed another minor bug in OffsetPolygons function.
- Update: Further improvements to the help file
- BugFix: fixed a minor rounding issue in OffsetPolygons function (affected C++ & C# translations).
- BugFix: fixed a minor bug in OffsetPolygons' function declaration (affected C++ translation only).
- Change: 'clipper' namespace changed to 'ClipperLib' namespace in both C++ and C# code to remove the ambiguity between the Clipper class and the namespace. (This also required numerous updates to the accompanying demos.)
- BugFix: minor bugfixes in Clipper.
- Update: the OffsetPolygons function has been significantly improved by offering 4 different join styles.
- BugFix: A number of minor bugs have been fixed that mostly affected the new ExPolygons structure.
- New: ExPolygons structure that explicitly associates 'hole' polygons with their 'outer' container polygons.
- New: Execute method overloaded so the solution parameter can now be either Polygons or ExPolygons.
- BugFix: Fixed a rare bug in solution polygons orientation.
- Update: JoinCommonEdges() improved once more.
- BugFix: Several minor bugs fixed.
- Bugfix: minor bug in SlopesEqual function.
- Update: Merging of output polygons sharing common edges has been significantly inproved
Input polygon coordinates can now contain the full range of
signed 64bit integers (ie +/-9,223,372,036,854,775,807). This
means that floating point values can be converted to and from
Clipper's 64bit integer coordinates structure (IntPoint) and
still retain a precision of up to 18 decimal places. However,
since the large-integer math that supports this expanded range
imposes a small cost on performance (~15%), a new property
UseFullCoordinateRange has been added to the Clipper class to
allow users the choice of whether or not to use this expanded
coordinate range. If this property is disabled, coordinate values
are restricted to +/-1,500,000,000.
JoinCommonEdges() code significantly improved plus other minor improvements.
- Update: Minor code tidy.
- Bugfix: Possible endless loop in JoinCommonEdges() in clipper.pas.
- Update: All polygon coordinates are now stored as 64bit integers (though they're still restricted to range -1.5e9 to +1.5e9 pending the inclusion of code supporting 64bit math).
- Change: AddPolygon and AddPolygons methods now return boolean values.
- Bugfix: Bug in JoinCommonEdges() caused potential endless loop.
- Bugfix: Bug in IsClockwise(). (C++ code only)
- Clipper 4 is a major rewrite of earlier versions. The biggest change is that floating point values are no longer used, except for the storing of edge slope values. The main benefit of this is the issue of numerical robustness has been addressed. Due to other major code improvements Clipper v4 is approximately 40% faster than Clipper v3.
- The AddPolyPolygon method has been renamed to AddPolygons.
- The IgnoreOrientation property has been removed.
- The clipper_misc library has been merged back into the main clipper library.
- Bugfix: Obscure bug in TClipperBase.SetDx method that caused problems with very small edges ( edges <1/1000th pixel in size).
- Bugfix: Significant bug, but only in C# code.
- Update: Minor refactoring.
- Update: Major rewrite of the portion of code that calculates the output polygons' orientation.
- Update: Help file significantly improved.
- Change: Renamed ForceOrientation property to IgnoreOrientation. If the orientation of output polygons is not important, or can be managed separately, clipping routines can be sped up by about 60% by setting IgnoreOrientation to true. Defaults to false.
- Change: The OffsetPolygon and Area functions have been moved to the new unit - clipper_misc.
- Bugfix: Obscure bug in AddPolygon method could cause an endless loop.
- Updated: Output polygons which previously shared a common edge are now merged.
- Changed: The orientation of outer polygons is now clockwise when the display's Y axis is positive downwards (as is typical for most Windows applications). Inner polygons (holes) have the opposite orientation.
- Added: Support module for Cairo Graphics Library (with demo).
- Updated: C# and C++ demos.
- Added C# translation (thanks to Olivier Lejeune) and a link to Ruby bindings (thanks to Mike Owens).
- Clipper now clips using both the Even-Odd (alternate) and Non-Zero (winding) polygon filling rules. (Previously Clipper assumed the Even-Odd rule for polygon filling.)
- Added C++ support for AGG graphics library
- Added C++ translation of clipper.pas