the clipper library - version 6 · ver 6 is a major update that adds support for open path...
TRANSCRIPT
-
TheClipperLibrary-Version6LibraryOverview Changes Example FAQ Rounding Deprecated License
-
Classes(Hierarchy)
ClipperBaseClipper
ClipperOffsetPolyNodePolyTree
-
TypesCInt InitOptions JoinType PolyFillTypeClipType IntPoint Path PolyTypeEndType IntRect Paths ZFillCallback
-
FunctionsArea ClosedPathsFromPolyTree OffsetPaths PointInPolygonCleanPolygon MinkowskiDiff OpenPathsFromPolyTree PolyTreeToPathsCleanPolygons MinkowskiSum Orientation ReversePath
-
UnitsClipperLib
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home Overview
-
Changes
-
v6.2.1(31October2014)
-
Bugfix:BugfixinClipperOffset.ExecutewherethePolytree.IsHolepropertywasreturningincorrectvalueswithnegativeoffsets
-
Modified:VeryminorimprovementtojoinroundinginClipperOffset
-
Bugfix:FixedCPPOpenGLdemo
-
v6.2.0(26September2014)
-
Bugfix:Numerousminorbugfixes-toomanytolist.(Seerevisions454-475inSourceforgeRepository.)
-
Modified:ParametershavechangedinthecustomcallbackfunctionthatcanbeassignedtoZFillFunction.
-
Modified:Deprecatedfunctionshavebeenremoved.
-
Modified:TheCurvesdemohasbeentemporarilyremoved.(ItneedstobeupdatedbutthatwasholdingupthislatestreleaseoftheClipperlibrary.)
-
v6.1.3(18January2014)
-
Bugfix:FixedpotentialendlessloopconditionwhenaddingopenpathstoClipper.
-
Bugfix:FixedmissingimplementationofSimplifyPolygonfunctioninC++code.
-
Bugfix:FixedincorrectupperrangeconstantforpolygoncoordinatesinDelphicode.
-
Added:AddedPointInPolygonfunction.
-
Added:OverloadedMinkowskiSumfunctiontoaccommodatemulti-contourpaths.
-
Modified:Documentationupdated.
-
v6.1.2(15December2013)
-
Bugfix:FixedbrokenC++headerfile.
-
Modified:Minorimprovementtojoiningpolygons.
-
v6.1.1(13December2013)
-
Bugfix:Fixedacoupleofbugsaffectingopenpathsthatcouldraiseunhandledexceptions.
-
v6.1.0(2December2013)
-
Deleted:Previouslydeprecatedcodehasbeenremoved.
-
Modified:TheOffsetPathsfunctionisnowdeprecatedasithasbeenreplacedbytheClipperOffsetclasswhichismuchmoreflexible.
-
Bugfix:SeveralminorbugshavebeenfixedincludingoccasionallyanincorrectnestingwithinthePolyTreestructure.
-
v6.0.0(30October2013)Ver6isaMAJORupdatethataddssupportforopenpathclipping.
-
Added:Openpath(polyline)clipping.Anew'Curves'demoapplicationshowcasesthis(seethe'Curves'directory).
-
Update:Majorimprovementinthemergingofshared/collinearedgesinclipsolutions(seeExecute).
-
Added:TheIntPointstructurenowhasanoptional'Z'member.(Seetheprecompilerdirectiveuse_xyz.)
-
Added:UserscannowforceClippertouse32bitintegers(viatheprecompilerdirectiveuse_int32)insteadofusing64bitintegers.Using32bitintegersimprovesclippingperformancebyabout20-30%.(ThishasrequiredtheintroductionofanewcIntintegertype.)Thetrade-offtothisspeedupinperformanceisaveryrestrictedvertexcoordinaterangeof±46340.
-
Modified:Toaccommodateopenpaths,thePolygonandPolygonsstructureshavebeenrenamedPathandPathsrespectively.TheAddPolygonandAddPolygonsmethodsoftheClipperBaseclasshavebeenrenamedAddPathandAddPathsrespectively.Severalotherfunctionshavebeensimilarlyrenamed.
-
Modified:ThePolyNodeClasshasanewIsOpenproperty(tosupportopenpaths).
-
Modified:TheClipperclasshasanewZFillFunctionproperty.
-
Added:MinkowskiSumandMinkowskiDifffunctionsadded.
-
Added:SeveralothernewfunctionshavebeenaddedincludingPolyTreeToPaths,OpenPathsFromPolyTreeandClosedPathsFromPolyTree.
-
Added:TheClipperconstructornowacceptsanoptionalInitOptionsparametertosimplifysettingproperties.
-
Bugfix:Numerousminorbugshavebeenfixed.
-
Deprecated:Version6isamajorupgradefrompreviousversionsandquiteanumberofchangeshavebeenmadetoexposedstructuresandfunctions.Tominimizeinconveniencetoexistinglibraryusers,somecodehasbeenretainedandsomeaddedtomaintainbackwardcompatibility.However,becausethiscodewillberemovedinafutureupdate,ithasbeenmarkedasdeprecatedandaprecompilerdirectiveuse_deprecatedhasbeendefined.
-
v5.1.6(23May2013)
-
BugFix:TheCleanPolygonfunctionwasbuggy.
-
Added:NewOffsetPolyLinesfunction.(ReplacedwithOffsetPathsfunctioninver6.)
-
Changed:Thebehaviourofthe'miter'JoinTypehasbeenchangedsothatwhensquaringoccurs,it'snolongerextendeduptothemiterlimitbutissquaredoffatexactly'delta'units.(Thisimprovesthelookofmiteringwithlargerlimitsatacuteangles.)
-
Update:Minorcoderefactoringandoptimisations.
-
v5.1.5(5May2013)
-
Update:ForceSimplepropertyaddedtotheClipperClass.(RenamedStrictlySimpleinver6.)
-
Update:Furtherimprovementstothisdocumentation.
-
Update:Minorcodeoptimisationsandtrivialbugfixes.
-
v5.1.4(24March2013)
-
Update:CleanPolygonfunctionenhanced.
-
Update:Documentationimproved.
-
v5.1.3(12March2013)
-
Bugfix:Minorbugfixes.
-
Update:Documentationsignificantlyimproved.
-
v5.1.2(26February2013)
-
Bugfix:PolyNodeclasswasmissingaconstructor.
-
Update:TheMiterLimitparameterintheOffsetPolygonsfunctionhasbeenrenamedLimitandcannowalsobeusedtolimitthenumberofverticesusedtoconstructarcswhenJoinTypeissettojtRound.
-
v5.1.0(17February2013)
-
Update:ExPolygonshasbeenreplacedwiththePolyTree/PolyNodeclassestomorefullyrepresenttheparent-childrelationshipsofthepolygonsreturnedbyClipper'sExecutemethod.
-
Added:NewCleanPolygonandCleanPolygonsfunctions.
-
Bugfix:Anotherorientationbugfixed.
-
v5.0.2(30December2012)
-
Bugfix:SignificantfixesinandtidyoftheinternalInt128class(whichisusedonlywhenpolygoncoordinatevaluesaregreaterthan±0x3FFFFFFF(~1.07e9)).
-
Update:TheAreafunctionhasbeenupdatedwithafasteralgorithm.
-
Update:Documentationupdates.Thenewishbutundocumented'CheckInputs'parameteroftheOffsetPolygonsfunctionhasbeenrenamed'AutoFix'anddocumentedtoo.Thecommentsonroundinghavealsobeenimproved(ieclearerandexpanded).
-
v4.10.0(25December2012)
-
Bugfix:Orientationbugsshouldnowberesolved(finally!).
-
Bugfix:BuginInt128class.
-
v4.9.8(2December2012)
-
Bugfix:FurtherfixestorareOrientationbug.
-
v4.9.7(29November2012)
-
Bugfix:Bugthatveryrarelyreturnedawrongpolygonorientation.
-
Bugfix:ObscurebugaffectingOffsetPolygonswhenusingjtRoundfortheJoinTypeparameterandwhenpolygonsalsocontainverylargecoordinatevalues.
-
v4.9.6(9November2012)
-
Bugfix:Anotherobscurebugrelatedtojoiningintersections.
-
v4.9.4(2November2012)
-
Bugfix:BugsinInt128classoccasionallycausingwrongorientations.
-
Bugfix:Furtherfixesrelatedtojoiningintersections.
-
v4.9.0(9October2012)
-
Bugfix:Obscurebugrelatedtojoiningintersections.
-
v4.8.9(25September2012)
-
Bugfix:Obscurebugrelatedtoprecisionofintersections.
-
v4.8.8(30August2012)
-
Bugfix:FixedbuginOffsetPolygonsfunctionintroducedinversion4.8.5.
-
v4.8.7(24August2012)
-
Bugfix:ReversePolygonfunctioninC++translationwasbroken.
-
Bugfix:Twoobscurebugsaffectingorientationfixedtoo.
-
v4.8.6(11August2012)
-
Bugfix:PotentialformemoryoverflowerrorswhenusingExPolygonsstructure.
-
Bugfix:Thepolygoncoordinaterangehasbeenreducedto±0x3FFFFFFFFFFFFFFF(4.6e18).
-
Update:ReversePolygonsfunctionwasmisnamedReversePointsinC++.
-
Update:SimplifyPolygonfunctionnowtakesaPolyFillTypeparameter.
-
v4.8.5(15July2012)
-
Bugfix:PotentialformemoryoverflowerrorsinOffsetPolygons().
-
v4.8.4(1June2012)
-
Bugfix:AnotherobscurebugaffectingExPolygonsstructure.
-
v4.8.3(27May2012)
-
Bugfix:Obscurebugcausingincorrectremovalofavertex.
-
v4.8.2(21May2012)
-
Bugfix:ObscurebugcouldcauseanexceptionwhenusingExPolygonstructure.
-
v4.8.1(12May2012)
-
Update:Codetidyandminorbugfixes.
-
v4.8.0(30April2012)
-
Bugfix:Occasionalerrorsinorientationfixed.
-
Update:Addednotesonroundingtothedocumentation.
-
v4.7.6(11April2012)
-
Bugfix:FixedabugintheOrientationfunction(affectingC#translationsonly).
-
Update:Minordocumentationupdate.
-
v4.7.5(28March2012)
-
Bugfix:FixedarecentlyintroducedbugthatoccasionallycausedanunhandledexceptioninC++andC#translations.
-
v4.7.1(3March2012)
-
Bugfix:RarecrashwhenJoinCommonEdgesjoinedpolygonsthat'cancelled'eachother.
-
Bugfix:Clipper'sinternalOrientationmethodoccasionallyreturnedwrongresult.
-
Update:ImprovedC#code(thankstonumeroussuggestionsfromDavidPiepgrass)
-
v4.7(10February2012)
-
Update:Improvedthejoiningofoutputpolygonssharingacommonedge.
-
v4.6.4(8December2011)
-
Added:AddedSimplifyPolygonandSimplifyPolygonsfunctions.
-
v4.6(29October2011)
-
Added:SupportforPositiveandNegativepolygonfilltypes(inadditiontotheEvenOddandNonZerofilltypes).
-
Bugfix:TheOffsetPolygonsfunctionwasgeneratingtheoccasionalartefactwhen'shrinking'polygons.
-
v4.5.5(6October2011)
-
Bugfix:FixedanobscurebuginClipper'sJoinCommonEdgesmethod.
-
Update:ReplacedIsClockwisefunctionwithOrientationfunction.TheorientationissuesaffectingOffsetPolygonsshouldfinallyberesolved.
-
Change:TheAreafunctiononceagainreturnsthesignedarea.
-
v4.4.0(6August2011)
-
BugFix:AnumberofminorbugfixesthatmostlyaffectedthenewExPolygonsstructure.
-
v4.3.0(17June2011)
-
Added:ExPolygonsstructurethatexplicitlyassociates'hole'polygonswiththeir'outer'containerpolygons.
-
Added:ExecutemethodnowoverloadedsothesolutionparametercanbeeitherPolygonsorExPolygons.
-
Bugfix:Fixedararebugintheorientationofsolutionpolygons.
-
v4.2.4(26April2011)
-
Update:Inputpolygoncoordinatescannowcontainthefullrangeofsigned64bitintegers(ie+/-9,223,372,036,854,775,807).ThismeansthatfloatingpointvaluescanbeconvertedtoandfromClipper's64bitvertexstructure(IntPoint)andstillretainaprecisionofupto18decimalplaces.However,sincethelarge-integermaththatsupportsthisexpandedrangeimposesasmallcostonperformance(~15%),anewpropertyUseFullCoordinateRangehasbeenaddedtotheClipperclasstoallowusersthechoiceofwhetherornottousethisexpandedcoordinaterange.Ifthispropertyisdisabled,coordinatevaluesarerestrictedto+/-1,500,000,000.(Bydefault,thispropertyisenabled.)
-
v4.0(4April2011)
-
Majorupdate:Clipperisamajorrewriteofearlierversions.Thebiggestchangeisthatfloatingpointvaluesarenolongerused,exceptforthestoringofedgeslopevalues.Themainbenefitofthisistheissueofnumericalrobustnesshasbeenaddressed.DuetoothermajorcodeimprovementsClipperv4isapproximately40%fasterthanClipperv3.
-
Changes:TheAddPolyPolygonmethodhasbeenrenamedtoAddPolygons,andtheIgnoreOrientationpropertyhasbeenremoved.Theclipper_misclibraryhasbeenmergedbackintotheclipperlibrary.
-
v2.8(20November2010)
-
Updated:Outputpolygonswhichpreviouslysharedacommonedgearenowmerged.
-
Added:AddedsupportmoduleforCairoGraphicsLibrary(withaccompanyingdemo).
-
Added:AddedC#andC++demos.
-
v2.522(15October2010)
-
Added:AddedC#translation(thankstoOlivierLejeune)andalinktoRubybindings(thankstoMikeOwens).
-
v2.0(31July2010)
-
Majorupdate:ClippernowprocessespolygonsusingboththeEven-Odd(alternate)andNon-Zero(winding)fillingrules.
-
v1.4c(16June2010)
-
Additions:AddedDelphiandC++unitstosupporttheAGGgraphicslibrary
-
v1.2s(2June2010)
-
Additions:C++translationofDelphicode
-
v1.0(9May2010)-Initialpublicrelease
-
SeeAlsoDeprecated,Rounding,Clipper.Constructor,Clipper.Execute,Clipper.ZFillFunction,ClipperBase.AddPath,ClipperBase.AddPaths,ClipperOffset,ClipperOffset.Execute,PolyNode,PolyTree,Area,CleanPolygon,CleanPolygons,ClosedPathsFromPolyTree,MinkowskiDiff,MinkowskiSum,OffsetPaths,OpenPathsFromPolyTree,Orientation,PointInPolygon,PolyTreeToPaths,SimplifyPolygon,SimplifyPolygons,Defines,CInt,InitOptions,IntPoint,Path,Paths,PolyFillType,ZFillCallback
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home Overview
-
Deprecated
Theprecompilerdirective'use_deprecated'allowsuserstoupdatetheClipperlibrarywithoutbeingforcedtomakeimmediatechangestocodethataccessesthelibrary.Depricatedcodewillberemovedinafutureupdate.(Enabledbydefault.)
Deprecatedtypesandfunctions:
Alldeprecatedcodehasbeenremovedfromversion6.2.0.
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home Overview
-
DelphiCodeSample:usesgraphics32,clipper;functionGetEllipsePoints(bounds:TIntRect):TPath;begin//codetocreateanellipticalpolygonhereend;procedureDrawPolygons(polys:TPaths;color:TColor32);begin//codetodisplaythepolygonshereend;varsub,clp,sol:TPaths;begin
//setupthesubjectandclippolygons...setlength(sub,3);sub[0]:=GetEllipsePoints(IntRect(100,100,300,300));sub[1]:=GetEllipsePoints(IntRect(125,130,275,180));sub[2]:=GetEllipsePoints(IntRect(125,220,275,270));setlength(clp,1);clp[0]:=GetEllipsePoints(IntRect(140,70,220,320));
//displaythesubjectandclippolygons...DrawPolygons(sub,0x8033FFFF);DrawPolygons(clp,0x80FFFF33);//gettheintersectionofthesubjectandclippolygons...withTClipper.CreatedotryAddPaths(sub,ptSubject,true);AddPaths(clp,ptClip,true);Execute(ctIntersection,sol,pftEvenOdd,pftEvenOdd);finallyfree;end;//finallydrawtheintersectionpolygons...DrawPolygons(sol,0x40808080);
C++CodeSample:#include"clipper.hpp"...
//fromclipper.hpp...//typedeflonglongcInt;//structIntPoint{cIntX;cIntY;};//typedefstd::vectorPath;//typedefstd::vectorPaths;
usingnamespaceClipperLib;
Example
-
voidGetEllipsePoints(IntRect&bounds,Path&p){/*...*/}voidDrawPolygons(Paths&p,unsignedcolor){/*...*/}intmain(){//setupthesubjectandclippolygons...Pathssub(3);GetEllipsePoints(IntRect(100,100,300,300),sub[0]);GetEllipsePoints(IntRect(125,130,275,180),sub[1]);GetEllipsePoints(IntRect(125,220,275,270),sub[2]);Pathsclp(1);GetEllipsePoints(IntRect(140,70,220,320),clp[0]);//displaythesubjectandclippolygons...DrawPolygons(sub,0x8033FFFF);DrawPolygons(clp,0x80FFFF33);//gettheintersectionofthesubjectandclippolygons...Clipperclpr;clpr.AddPaths(sub,ptSubject,true);clpr.AddPaths(clp,ptClip,true);Pathssolution;clpr.Execute(ctIntersection,solution,pftEvenOdd,pftEvenOdd);//finallydrawtheintersectionpolygons...DrawPolygons(solution,0x40808080);}
C#CodeSample:...usingClipperLib;...usingPath=List;usingPaths=List;staticPathGetEllipsePoints(IntRectbounds){/*...*/}staticvoidDrawPolygons(Pathp,uintcolor){/*...*/}staticvoidMain(string[]args){Pathssubjs=newPaths(3);subjs.Add(GetEllipsePoints(newIntRect(100,100,300,300)));subjs.Add(GetEllipsePoints(newIntRect(125,130,275,180)));subjs.Add(GetEllipsePoints(newIntRect(125,220,275,270)));Pathsclips=newPaths(1);clips.Add(GetEllipsePoints(newIntRect(140,70,220,320)));DrawPolygons(subjs,0x8033FFFF);DrawPolygons(clips,0x80FFFF33);Pathssolution=newPaths();
-
Clipperc=newClipper();c.AddPaths(subjs,PolyType.ptSubject,true);c.AddPaths(clips,PolyType.ptClip,true);c.Execute(ClipType.ctIntersection,solution);DrawPolygons(solution,0x40808080);}
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home Overview
-
FAQ
WhydoesClipperuseintegercoordinates,notfloats?Thishasbeendonetopreservenumericalrobustness.Earlyversionsofthelibrarydidusefloatingpointcoordinates,butitbecameapparentthatfloatingpointimprecisionwasalwaysgoingtocauseoccasionalerrors.
HowdoIusefloatingpointcoordinateswithClipper?It'sasimpletasktomultiplyyourfloatingpointcoordinatesbyascalingfactor(that'stypicallyapowerof10dependingonthedesiredprecision).Thenwiththesolutionpaths,dividethereturnedcoordinatesbythissamescalingfactor.Clipperacceptsintegercoordinatesaslargeas±4.6e18,soitcanaccommodateverylargescaling.
DoesClipperhandlepolygonswithholes?'Holes'aredefinedbythespecifiedpolygonfillingrule.(SeealsoClipper.Execute)
Somepolygonsinthesolutionshareacommonedge.Isthisabug?No,thoughthisshouldhappenrarelyasofversion6.(SeeClipper.Executeformoreaboutthis.)
IhavelotsofpolygonsthatIwantto'union'.CanIdothisinoneoperation?Yes.JustaddallthepolygonsassubjectpolygonstotheClipperobject.(Youdon'thavetoassignbothsubjectandclippolygons.)
ThepolygonsproducedbyClipperOffsethavetinyartefacts?Couldthisbeabug?Makesuretheinputpolygonsdon'tself-intersect.Tinyself-intersectionscansometimesbeproducedbypreviousclippingoperations.ThesecanbecleanedupusingtheCleanPolygonandCleanPolygonsfunctions.Also,makesurethesuppliedpolygonsdon'toverlap.Iftheydo,offset
http://www.mpi-inf.mpg.de/~kettner/pub/nonrobust_cgta_06.pdf
-
theseseparately.Finally,theprecisionoftheinputcoordinatesmaybeaproblem.BecausetheClipperLibraryonlyoperatesonintegercoordinates,youmayneedtoscaleyourcoordinates(egbyafactorof10)toimproveprecision.
Isthereaneasywaytoreversepolygonorientations?Yes,seeReversePaths.
Mydrawingscontainlotsofbeziers,ellipsesandarcs.HowcanIperformclippingoperationsonthese?You'llhavetoconvertthemto'flattened'paths.Foranexampleofhowthiscanbedone(andevenreconstructedbackintobeziers,arcsetc),seetheCurvesDemoapplicationincludedinthislibrary.
-
SeeAlsoClipper.Execute,ClipperOffset,CleanPolygon,CleanPolygons,ReversePaths,PolyFillType
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home Overview
-
License
TheClipperLibrary(includingDelphi,C++&C#sourcecode,otheraccompanyingcode,examplesanddocumentation),hereaftercalled"theSoftware",hasbeenreleasedunderthefollowinglicense,termsandconditions:BoostSoftwareLicense-Version1.0-August17th,2003http://www.boost.org/LICENSE_1_0.txtPermissionisherebygranted,freeofcharge,toanypersonororganizationobtainingacopyoftheSoftwarecoveredbythislicensetouse,reproduce,display,distribute,execute,andtransmittheSoftware,andtopreparederivativeworksoftheSoftware,andtopermitthird-partiestowhomtheSoftwareisfurnishedtodoso,allsubjecttothefollowing:ThecopyrightnoticesintheSoftwareandthisentirestatement,includingtheabovelicensegrant,thisrestrictionandthefollowingdisclaimer,mustbeincludedinallcopiesoftheSoftware,inwholeorinpart,andallderivativeworksoftheSoftware,unlesssuchcopiesorderivativeworksaresolelyintheformofmachine-executableobjectcodegeneratedbyasourcelanguageprocessor.THESOFTWAREISPROVIDED"ASIS",WITHOUTWARRANTYOFANYKIND,EXPRESSORIMPLIED,INCLUDINGBUTNOTLIMITEDTOTHEWARRANTIESOFMERCHANTABILITY,FITNESSFORAPARTICULARPURPOSE,TITLEANDNON-INFRINGEMENT.INNOEVENTSHALLTHECOPYRIGHTHOLDERSORANYONEDISTRIBUTINGTHESOFTWAREBELIABLEFORANYDAMAGESOROTHERLIABILITY,WHETHERINCONTRACT,TORTOROTHERWISE,ARISINGFROM,OUTOFORINCONNECTIONWITHTHESOFTWAREORTHEUSEOROTHERDEALINGSINTHESOFTWARE.
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
http://www.boost.org/LICENSE_1_0.txt
-
Home Overview
-
Rounding
Byusinganintegertypeforpolygoncoordinates,theClipperLibraryhasbeenabletoavoidproblemsofnumericalrobustnessthatcancausehavocwithgeometriccomputations.Problemsassociatedwithintegerroundingandtheirpossiblesolutionsarediscussedbelow.
It'simportanttostressattheoutsetthatroundingcausesverticestomovefractionsofaunitawayfromtheir'true'positions.
Nevertheless,theresultingimprecisioncanbeveryeffectivelymanagedbyappropriatescaling.
TheClipperLibrarysupportsscalingtoveryhighdegreesofprecisionbyacceptingintegercoordinatevaluesintherange±0x3FFFFFFFFFFFFFFF(±4.6e+18).
Anothercomplicationofusingadiscretenumbers(asopposedtorealnumbers)isthatveryoccasionallytinyself-intersectionartefactsarise.Intheunscaledimageontheleft(whereoneunitequalsonepixel),theareaofintersectionoftwopolygonshasbeenhighlightedinbrightgreen.
A30X'closeup'ofthelowerpointsofintersectionofthesesametwo
http://www.mpi-inf.mpg.de/~kettner/pub/nonrobust_cgta_06.pdfhttp://en.wikipedia.org/wiki/Real_number
-
polygonsshowsthepresenceofatinyself-intersectingartefact.Thethree'blackdots'highlighttheactualpointsofintersection(withtheirfractionalcoordinatesdisplayed).The'reddots'showwherethesepointsofintersectionarelocatedonceroundingisapplied.Withalittlecareyoucanseethatroundingreversestheorientationoftheseverticesandcausesatinyself-intersectingartefact.
Althoughthesetinyself-intersectionsareuncommon,ifit'sdeemednecessary,theyarebestremovedwithCleanPolygons.(SettingClipper'sStrictlySimplepropertytotruewouldalsoaddressthisself-intersectionbutthetiny(sub-unit)polygon'artefact'withincorrectorientationwouldstillappearinthesolution.)
Inthisfinalexample,thesinglepolygonontheleftalsohasatinyself-intersection.However,theclippingalgorithmseesthisvertex(88,50)assimply'touching'ratherthanintersectingtherightedgeofthepolygon(thoughonlybyafractionofaunit).Sincethisintersectionwon't
normallybedetected,theclippingsolution(egfollowingaunionoperation)willstillcontainthistinyself-intersection.SettingClipper'sStrictlySimplepropertytotrueavoidsthisuncommonproblem.
-
SeeAlsoClipper.StrictlySimple,CleanPolygons
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
CInt
Del.»{$IFDEFuse_int32}cInt=Int32;{$ELSE}cInt=Int64;{$ENDIF}C++»#ifdefuse_int32typedefintcInt;#elsetypedefsignedlonglongcInt;#endifC#»#ifuse_int32usingcInt=Int32;#elseusingcInt=Int64;#endif
cIntistheintegertypeusedbytheClipperLibrarytorepresentvertexcoordinatevalues.(SeealsoIntPoint.)
Thelibraryusesintegersinsteadoffloatingpointvaluestopreservenumericalrobustness.(Veryearlyversionsofthelibraryusedfloatingpointcoordinates,butitbecameapparentthatfloatingpointimprecisionwasalwaysgoingtocauseoccasionalerrors.)
BydefaultcIntrepresentsasigned64bitintegerandpolygoncoordinatescanhaveanyvalueintherange±9.2e+18.Thisaccommodatesthescalingoffloatingpointcoordinatevaluestoverylargeintegerssothatveryhighdegreesofprecisioncanberetainedduringclipping.However,ifcoordinatevaluescanbekeptwithintherange±3.0e+9,thenbyavoidinglargeintegermath,amodest~10%improvementinclippingperformanceisachieved.
Ifthepreprocessordirectiveuse_int32isdefined,cIntwillrepresenta
http://www.mpi-inf.mpg.de/~kettner/pub/nonrobust_cgta_06.pdf
-
signed32bitinteger.Thisimprovesclippingperformanceby20-30%butthetrade-offisthatcoordinatevaluesarerestrictedtothemuchnarrowerrangeof±46340.
-
SeeAlsoDefines,IntPoint
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
ClipType
Del.»typeTClipType=(ctIntersection,ctUnion,ctDifference,ctXor);C++»enumClipType{ctIntersection,ctUnion,ctDifference,ctXor};C#»publicenumClipType{ctIntersection,ctUnion,ctDifference,ctXor};
Therearefourbooleanoperations-AND,OR,NOT&XOR.
Giventhatsubjectandclippolygonbrush'filling'isdefinedbothbytheirverticesandtheirrespectivefillingrules,thefourbooleanoperationscanbeappliedtopolygonstodefinenewfillingregions:
AND(intersection)-createregionswherebothsubjectandclippolygonsarefilledOR(union)-createregionswhereeithersubjectorclippolygons
(orboth)arefilledNOT(difference)-createregionswheresubjectpolygonsarefilled
exceptwhereclippolygonsarefilledXOR(exclusiveor)-createregionswhereeithersubjectorclip
polygonsarefilledbutnotwherebotharefilled
-
AllpolygonclippingisperformedwithaClipperobjectwiththespecificbooleanoperationindicatedbytheClipTypeparameterpassedinitsExecutemethod.
Withregardtoopenpaths(polylines),clippingrulesgenerallymatchthoseofclosedpaths(polygons).However,whentherearebothpolylineandpolygonsubjects,thefollowingclippingrulesapply:
unionoperations-polylineswillbeclippedbyanyoverlappingpolygonssothatnon-overlappedportionswillbereturnedinthesolutiontogetherwiththeunion-edpolygonsintersection,differenceandxoroperations-polylineswillbeclipped
onlyby'clip'polygonsandtherewillbenotinteractionbetweenpolylinesandsubjectpolygons.
Exampleofclippingbehaviourwhenmixingpolylineandpolygonsubjects:
-
SeeAlsoOverview,Clipper,Clipper.Execute,PolyFillType
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
EndType
Del.»typeTEndType=(etClosedPolygon,etClosedLine,etOpenSquare,etOpenRound,etOpenButt);C++»enumEndType{etClosedPolygon,etClosedLine,etOpenSquare,etOpenRound,etOpenButt};C#»publicenumEndType{etClosedPolygon,etClosedLine,etOpenSquare,etOpenRound,etOpenButt};
TheEndTypeenumeratorhas5values:
etClosedPolygon:EndsarejoinedusingtheJoinTypevalueandthepathfilledasapolygonetClosedLine:EndsarejoinedusingtheJoinTypevalueandthe
pathfilledasapolylineetOpenSquare:EndsaresquaredoffandextendeddeltaunitsetOpenRound:EndsareroundedoffandextendeddeltaunitsetOpenButt:Endsaresquaredoffwithnoextension.etOpenSingle:Offsetsanopenpathinasingledirection.Planned
forafutureupdate.
Note:WithetClosedPolygonandetClosedLinetypes,thepathclosurewillbethesameregardlessofwhetherornotthefirstandlastverticesinthepathmatch.
-
SeeAlsoClipperOffset.AddPath,ClipperOffset.AddPaths
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
InitOptions
Del.»typeTInitOption=(ioReverseSolution,ioStrictlySimple,ioPreserveCollinear);C++»enumInitOptions{ioReverseSolution=1,ioStrictlySimple=2,ioPreserveCollinear=4};C#»publicconstintioReverseSolution=1;publicconstintioStrictlySimple=2;publicconstintioPreserveCollinear=4;
-
SeeAlsoClipper.Constructor,Clipper.PreserveCollinear,Clipper.ReverseSolution,Clipper.StrictlySimple
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
IntPoint
Del.»TIntPoint=recordX,Y:cInt;end;C++»structIntPoint{cIntX;cIntY;...};C#»publicclassIntPoint{publiccIntX;{get;set;}publiccIntY;{get;set;}...};
TheIntPointstructureisusedtorepresentallverticesintheClipperLibrary.Anintegerstoragetypehasbeendeliberatelychosentopreservenumericalrobustness.(Earlyversionsofthelibraryusedfloatingpointcoordinates,butitbecameapparentthatfloatingpointimprecisionwouldalwayscauseoccasionalerrors.)
AsequenceofIntPointsarecontainedwithinaPathstructuretorepresentasinglecontour.
Asofversion6,IntPointnowhasanoptionalthirdmember'Z'.Thiscanbeenabledbyexposing(ieuncommenting)thePreProcessordefine'use_xyz'.WhentheZmemberisused,itsvalueswillbecopiedtocorrespondingverticiesinsolutionstoclippingoperations.However,atpointsofintersectionwherethere'snocorrespondingZvalue,thevaluewillbeassignedzerounlessanewvalueisprovidedbyausersuppliedcallbackfunction.
UserswishingtocliporoffsetpolygonscontainingfloatingpointcoordinatesneedtouseappropriatescalingwhenconvertingthesevaluestoandfromIntPoints.
Seealsothenotesonrounding.
http://www.mpi-inf.mpg.de/~kettner/pub/nonrobust_cgta_06.pdf
-
SeeAlsoRounding,Clipper.ZFillFunction,Defines,CInt,Path,Paths
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
IntRect
Del.»TIntRect=recordleft,top,right,bottom:cInt;end;C++»structIntRect{cIntleft;cInttop;cIntright;cIntbottom;...};C#»publicclassIntRect{publiccIntleft;{get;set;}publiccInttop;{get;set;}publiccIntright;{get;set;}publiccIntbottom;{get;set;}...};
StructurereturnedbyClipper'sGetBoundsmethod.
-
SeeAlsoClipperBase.GetBounds,CInt
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
JoinType
Del.»typeTJoinType=(jtSquare,jtRound,jtMiter);C++»enumJoinType{jtSquare,jtRound,jtMiter};C#»publicenumJoinType{jtSquare,jtRound,jtMiter};
WhenaddingpathstoaClipperOffsetobjectviatheAddPathsmethod,thejoinTypeparametermaybeoneofthreetypes-jtMiter,jtSquareorjtRound.
jtMiter:There'sanecessarylimittomiteredjoinssinceoffsettingedgesthatjoinatveryacuteangleswillproduceexcessivelylongandnarrow'spikes'.Tocontainthesepotentialspikes,theClippOffsetobject'sMiterLimitpropertyspecifiesamaximumdistancethatverticeswillbeoffset(inmultiplesofdelta).Foranygivenedgejoin,whenmiteroffsettingwouldexceedthatmaximumdistance,'square'joiningisapplied.jtRound:Whileflattenedpathscanneverperfectlytraceanarc,they
areapproximatedbyaseriesofarcchords(seeClipperObject'sArcToleranceproperty).jtSquare:Squaringisapplieduniformallyatallconvexedgejoinsat
1×delta.
-
SeeAlsoClipperOffset,ClipperOffset.AddPaths,ClipperOffset.ArcTolerance,ClipperOffset.MiterLimit
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
Path
Del.»TPath=arrayofTIntPoint;C++»typedefstd::vectorPath;C#»usingPath=List;
ThisstructurecontainsasequenceofIntPointverticesdefiningasinglecontour(seealsoterminology).Pathsmaybeopenandrepresentaseriesoflinesegmentsboundedby2ormorevertices,ortheymaybeclosedandrepresentpolygons.Whetherornotapathisopendependsoncontext.Closedpathsmaybe'outer'contoursor'hole'contours.Whichtheyaredependsonorientation.
MultiplepathscanbegroupedintoaPathsstructure.
-
SeeAlsoOverview,Example,ClipperBase.AddPath,PolyTree,Orientation,IntPoint,Paths
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
Paths
Del.»TPaths=arrayofTPath;C++»typedefstd::vector<Path>Paths;C#»usingPaths=List>;
ThisstructureisfundamentaltotheClipperLibrary.It'salistorarrayofoneormorePathstructures.(ThePathstructurecontainsanorderedlistofverticesthatmakeasinglecontour.)
Pathsmayopen(aseriesoflinesegments),ortheymayclosed(polygons).Whetherornotapathisopendependsoncontext.Closedpathsmaybe'outer'contoursor'hole'contours.Whichtheyaredependsonorientation.
-
SeeAlsoClipper.Execute,ClipperBase.AddPath,ClipperBase.AddPaths,OffsetPaths,IntPoint,Path
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
PolyFillType
Del.»typeTPolyFillType=(pftEvenOdd,pftNonZero,pftPositive,pftNegative);C++»enumPolyFillType{pftEvenOdd,pftNonZero,pftPositive,pftNegative};C#»publicenumPolyFillType{pftEvenOdd,pftNonZero,pftPositive,pftNegative};
Fillingindicatesthoseregionsthatareinsideaclosedpath(ie'filled'withabrushcolororpatterninagraphicaldisplay)andthoseregionsthatareoutside.TheClipperLibrarysupports4fillingrules:Even-Odd,Non-Zero,PositiveandNegative.
ThesimplestfillingruleisEven-Oddfilling(sometimescalledalternatefilling).Givenagroupofclosedpathsstartfromapointoutsidethepathsandprogressalonganimaginarylinethroughthepaths.Whenthefirstpathiscrossedtheencounteredregionisfilled.Whenthenextpathiscrossedtheencounteredregionisnotfilled.Likewise,eachtimeapathiscrossed,fillingstartsifithadstoppedandstopsifithadstarted.
WiththeexceptionofEven-Oddfilling,allotherfillingrulesrelyonedgedirectionandwindingnumberstodeterminefilling.Edgedirectionisdeterminedbytheorderinwhichverticesaredeclaredwhenconstructingapath.Edgedirectionisusedtodeterminethewindingnumberofeachpolygonsubregion.
Thewindingnumberforeachpolygonsub-regioncanbederivedby:
1. startingwithawindingnumberofzeroand2. fromapoint(P1)that'soutsideallpolygons,drawanimaginary
linetoapointthat'sinsideagivensub-region(P2)3. whiletraversingthelinefromP1toP2,foreachpaththatcrosses
theimaginarylinefromrighttoleftincrementthewindingnumber,andforeachpaththatcrossesthelinefromlefttorightdecrementthewindingnumber.
4. Onceyouarriveatthegivensub-regionyouhaveitswindingnumber.
-
Even-Odd(Alternate):Oddnumberedsub-regionsarefilled,whileevennumberedsub-regionsarenot.Non-Zero(Winding):Allnon-zerosub-regionsarefilled.Positive:Allsub-regionswithwindingcounts>0arefilled.Negative:Allsub-regionswithwindingcounts<0arefilled.
PathsareaddedtoaClipperobjectusingtheAddPathorAddPathsmethodsandthefillingrules(forsubjectandclippolygonsseparately)arespecifiedintheExecutemethod.
Polygonregionsaredefinedbyoneormoreclosedpathswhichmayormaynotintersect.Asinglepolygonregioncanbedefinedbyasinglenon-intersectingpathorbymultiplenon-intersectingpathswherethere'stypicallyan'outer'pathandoneormoreinner'hole'paths.Lookingatthethreeshapesintheimageabove,themiddleshapeconsistsoftwoconcentricrectanglessharingthesameclockwiseorientation.Witheven-oddfilling,whereorientationcanbedisregarded,theinnerrectanglewouldcreateaholeintheouterrectangularpolygon.Therewouldbenoholewithnon-zerofilling.Intheconcentricrectanglesontheright,wheretheinnerrectangleisorientatedoppositetotheouter,aholewillberenderedwitheithereven-oddornon-zerofilling.Asinglepathcanalsodefinemultiplesubregionsifitself-intersectsasintheexampleofthe5pointedstarshapebelow.
-
ByfarthemostwidelyusedfillrulesareEven-Odd(akaAlternate)andNon-Zero(akaWinding).Mostgraphicsrenderinglibraries(AGG,AndroidGraphics,Cairo,GDI+,OpenGL,Quartz2Detc)andvectorgraphicsstorageformats(SVG,Postscript,Photoshopetc)supportboththeserules.Howeversomelibraries(egJava'sGraphics2D)onlysupportonefillrule.AndroidGraphicsandOpenGLaretheonlylibraries(thatI'mawareof)thatsupportmultiplefillingrules.
It'susefultonotethatedgedirectionhasnoaffectonawindingnumber'sodd-nessoreven-ness.(ThisiswhyorientationisignoredwhentheEven-Oddruleisemployed.)
ThedirectionoftheY-axisdoesaffectpolygonorientationandedgedirection.However,changingY-axisorientationwillonlychangethesignofwindingnumbers,nottheirmagnitudes,andhasnoeffectoneitherEven-OddorNon-Zerofilling.
http://www.antigrain.com/__code/include/agg_basics.h.html#filling_rule_ehttp://developer.android.com/reference/android/graphics/Path.FillType.htmlhttp://cairographics.org/manual/cairo-cairo-t.html#cairo-fill-rule-thttp://msdn.microsoft.com/en-us/library/windows/desktop/ms534120(v=vs.85).aspxhttp://www.glprogramming.com/red/chapter11.htmlhttp://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_paths/dq_paths.html#//apple_ref/doc/uid/TP30001066-CH211-TPXREF101http://www.w3.org/TR/SVG/painting.html#FillRulePropertyhttp://www.adobe.com/devnet-apps/photoshop/fileformatashtml/PhotoshopFileFormats.htm#50577409_17587http://docs.oracle.com/javase/6/docs/api/java/awt/Graphics.html#fillPolygon(int[], int[], int)
-
SeeAlsoClipper.Execute,ClipperBase.AddPath,ClipperBase.AddPaths,Orientation
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
PolyType
Del.»typeTPolyType=(ptSubject,ptClip);C++»enumPolyType{ptSubject,ptClip};C#»publicenumPolyType{ptSubject,ptClip};
Boolean(clipping)operationsaremostlyappliedtotwosetsofPolygons,representedinthislibraryassubjectandclippolygons.WheneverPolygonsareaddedtotheClipperobject,theymustbeassignedtoeithersubjectorclippolygons.
UNIONoperationscanbeperformedononesetorbothsetsofpolygons,butallotherbooleanoperationsrequirebothsetsofpolygonstoderivemeaningfulsolutions.
-
SeeAlsoClipperBase.AddPath,ClipperBase.AddPaths,ClipType
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
ZFillCallback
Del.»typeTZFillCallback=procedure(constE1Bot,E1Top,E2Bot,E2Top:TIntPoint;varPt:TIntPoint);C++»typedefvoid(*ZFillCallback)(constIntPoint&e1bot,IntPoint&e1top,IntPoint&e2bot,IntPoint&e2top,IntPoint&pt);C#»publicdelegatevoidZFillCallback(IntPointbot1,IntPointtop1,IntPointbot2,IntPointtop2,refIntPointpt);
Iftheuse_xyzpre-processordirectiveisenabled,thentheIntPointclasswillhaveanextra'Z'memberandtheClipperclass'sZFillFunctionpropertywillbeexposedsoitcanbeassignedacustomcallbackfunction.
ThiscustomcallbackprocedurerequiresfiveIntPointparameters:thefirst2parametersaretheverticesthatdefineonelinesegmentinvolvedintheintersectionandthenexttwoparameterstheotherlinesegment.(SincetheClipperlibraryhasbeendevelopedinanenvironmentthatusesaninvertedYaxisdisplay,e1botande2botwillalwayshaveYvaluesgreaterthanorequaltotheircorrespondinge1topande2topYvalues.)ThelastIntPointparametercontaintheactualcoordinatesattheintersection.ThislastparameterispassedbyreferencesothatitsZmembercanbeassignedwithacustomvalue.
-
SeeAlsoClipper.ZFillFunction,Defines
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
Area
Del.»functionArea(constpts:TPath):double;C++»doubleArea(constPath&poly);C#»publicstaticdoubleArea(Pathpoly);
Thisfunctionreturnstheareaofthesuppliedpolygon.It'sassumedthatthepathisclosedanddoesnotself-intersect.Dependingonorientation,thisvaluemaybepositiveornegative.IfOrientationistrue,thentheareawillbepositiveandconversely,ifOrientationisfalse,thentheareawillbenegative.
-
SeeAlsoOrientation,Path
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
CleanPolygon
Del.»functionCleanPolygon(constPoly:TPath;Distance:double=1.415):TPath;C++»voidCleanPolygon(constPath&in_poly,Path&out_poly,doubledistance=1.415);C++»voidCleanPolygon(Path&poly,doubledistance=1.415);C#»publicstaticPathCleanPolygon(Pathpoly,doubledistance=1.415);
Removesvertices:
thatjoinco-linearedges,orjoinedgesthatarealmostco-linear(suchthatifthevertexwasmovednomorethanthespecifieddistancetheedgeswouldbeco-linear)thatarewithinthespecifieddistanceofanadjacentvertexthatarewithinthespecifieddistanceofasemi-adjacentvertex
togetherwiththeirout-lyingvertices
Verticesaresemi-adjacentwhentheyareseparatedbyasingle(out-lying)vertex.
Thedistanceparameter'sdefaultvalueisapproximately√2sothatavertexwillberemovedwhenadjacentorsemi-adjacentverticeshavingtheircorrespondingXandYcoordinatesdifferingbynomorethan1unit.(Iftheegdesaresemi-adjacenttheout-lyingvertexwillberemovedtoo.)
C++only:Thisfunctionisoverloaded.Inthefirstdefinition,thein_polyandout_polyparameterscanreferencethesamePathobjectthoughinthatcasethecallingcodemightbecleareriftheseconddefinition(acceptingasinglePathsparameter)isused.
-
SeeAlsoCleanPolygons,SimplifyPolygon,Path
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
CleanPolygons
Del.»functionCleanPolygons(constPolys:TPaths;Distance:double=1.415):TPaths;C++»voidCleanPolygons(constPaths&in_polys,Paths&out_polys,doubledistance=1.415);C++»voidCleanPolygons(Paths&polys,doubledistance=1.415);C#»publicstaticPathsCleanPolygons(Pathspolys,doubledistance=1.415);
Removesvertices:
thatjoinco-linearedges,orjoinedgesthatarealmostco-linear(suchthatifthevertexwasmovednomorethanthespecifieddistancetheedgeswouldbeco-linear)thatarewithinthespecifieddistanceofanadjacentvertexthatarewithinthespecifieddistanceofasemi-adjacentvertex
togetherwiththeirout-lyingvertices
Verticesaresemi-adjacentwhentheyareseparatedbyasingle(out-lying)vertex.
Thedistanceparameter'sdefaultvalueisapproximately√2sothatavertexwillberemovedwhenadjacentorsemi-adjacentverticeshavingtheircorrespondingXandYcoordinatesdifferingbynomorethan1unit.(Iftheegdesaresemi-adjacenttheout-lyingvertexwillberemovedtoo.)
C++only:Thisfunctionisoverloaded.Inthefirstdefinition,thein_polysandout_polysparameterscanreferencethesamePathsobjectthoughinthatcasethecallingcodemightbecleareriftheseconddefinition(acceptingasinglePathsparameter)isused.
-
SeeAlsoCleanPolygon,SimplifyPolygons
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
ClosedPathsFromPolyTree
Del.»functionClosedPathsFromPolyTree(PolyTree:TPolyTree):TPaths;C++»voidClosedPathsFromPolyTree(PolyTree&polytree,Paths&paths);C#»publicstaticvoidClosedPathsFromPolyTree(PolyTreepolytree,Pathspaths);
ThisfunctionfiltersoutopenpathsfromthePolyTreestructureandreturnsonlyclosedpathsinaPathsstructure.
-
SeeAlsoPolyTree,Paths
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
MinkowskiDiff
Del.»functionMinkowskiDiff(constPoly1:TPath;constPoly2:TPath):TPaths;C++»voidMinkowskiDiff(constPath&poly1,constPath&poly2,Paths&solution);C#»publicstaticPathsMinkowskiDiff(Pathpoly1,Pathpoly2);
MinkowskiDifferenceisperformedbysubtractingeachpointinapolygonfromthesetofpointsinanopenorclosedpath.AkeyfeatureofMinkowskiDifferenceisthatwhenit'sappliedtotwopolygons,theresultingpolygonwillcontainthecoordinatespaceoriginwheneverthetwopolygonstouchoroverlap.(Thisfunctionisoftenusedtodeterminewhenpolygonscollide.)
Intheimageontheleftthebluepolygonisthe'minkowskidifference'ofthetworedboxes.Theblackdotrepresentsthecoordinatespaceorigin.
-
SeeAlsoMinkowskiSum,Path
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
MinkowskiSum
Del.»functionMinkowskiSum(constPattern:TPath;constPath:TPath;PathIsClosed:Boolean):TPaths;overload;Del.»functionMinkowskiSum(constPattern:TPath;constPaths:TPaths;PathFillType:TPolyFillType;PathIsClosed:Boolean):TPaths;overload;C++»voidMinkowskiSum(constPath&pattern,constPath&path,Paths&solution,boolpathIsClosed);C++»voidMinkowskiSum(constPath&pattern,constPaths&paths,Paths&solution,PolyFillTypepathFillType,boolpathIsClosed);C#»publicstaticPathsMinkowskiSum(Pathpattern,Pathpath,boolpathIsClosed);C#»publicstaticPathsMinkowskiSum(Pathpattern,Pathspaths,PolyFillTypepathFillType,boolpathIsClosed);
MinkowskiAdditionisperformedbyaddingeachpointinapolygon'pattern'tothesetofpointsinanopenorclosedpath.Theresultingpolygon(orpolygons)definestheregionthatthe'pattern'wouldpassoverinmovingfromthebeginningtotheendofthe'path'.
Pathpath=newPath();Pathpattern=newPath();Pathssolution=newPaths();
//Greekcapitalsigma(sumsign)...Int64[]ints1=newInt64[]{300,400,100,400,200,300,100,200,300,200};path=IntsToPolygon(ints1);
//diagonalbrushpattern...Int64[]ints2=newInt64[]{4,-6,6,-6,-4,6,-6,6};pattern=IntsToPolygon(ints2);
solution=Clipper.MinkowskiSum(pattern,path,false);//move'pattern'totheendof'path'...
-
pattern=TranslatePath(pattern,300,200);
//Displaysolution±pattern...
-
SeeAlsoMinkowskiDiff
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
OffsetPaths
Del.»functionOffsetPaths(constpolys:Paths;constdelta:double;JoinType:TJoinType=jtSquare;EndType:TEndType=etClosed;Limit:double=0.0):TPaths;C++»voidOffsetPaths(constPaths&in_polys,Paths&out_polys,doubledelta,JoinTypejointype=jtSquare,EndTypeendtype=etClosed,doublelimit=0.0);C#»publicstaticPathsOffsetPaths(Pathspolys,doubledelta,JoinTypejointype=JoinType.jtSquare,EndTypeendtype=EndType.etClosed,doublelimit=0.0);
Deprecated.(SeeClipperOffset.)
-
SeeAlsoClipperOffset
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
OpenPathsFromPolyTree
Del.»functionOpenPathsFromPolyTree(PolyTree:TPolyTree):TPaths;C++»voidOpenPathsFromPolyTree(PolyTree&polytree,Paths&paths);C#»publicstaticvoidOpenPathsFromPolyTree(PolyTreepolytree,Pathspaths);
ThisfunctionfiltersoutclosedpathsfromthePolyTreestructureandreturnsonlyopenpathsinaPathsstructure.
-
SeeAlsoPolyTree,Paths
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
Orientation
Del.»functionOrientation(constpoly:TPath):boolean;C++»boolOrientation(constPath&poly);//FunctionintheClipperLibnamespace.C#»publicstaticboolOrientation(Pathpoly);//StaticmethodoftheClipperclassintheClipperLibnamespace.
Orientationisonlyimportanttoclosedpaths.Giventhatverticesaredeclaredinaspecificorder,orientationreferstothedirection(clockwiseorcounter-clockwise)thattheseverticesprogressaroundaclosedpath.
Orientationisalsodependentonaxisdirection:
OnY-axispositiveupwarddisplays,Orientationwillreturntrueifthepolygon'sorientationiscounter-clockwise.OnY-axispositivedownwarddisplays,Orientationwillreturntrue
ifthepolygon'sorientationisclockwise.
Notes:
Self-intersectingpolygonshaveindeterminateorientationsinwhichcasethisfunctionwon'treturnameaningfulvalue.Themajorityof2Dgraphicdisplaylibraries(egGDI,GDI+,XLib,
Cairo,AGG,Graphics32)andeventheSVGfileformathavetheircoordinateoriginsatthetop-leftcorneroftheirrespectiveviewportswiththeirYaxesincreasingdownward.However,somedisplay
-
libraries(egQuartz,OpenGL)havetheircoordinateoriginsundefinedorintheclassicbottom-leftpositionwiththeirYaxesincreasingupward.ForNon-Zerofilledpolygons,theorientationofholesmustbe
oppositethatofouterpolygons.Forclosedpaths(polygons)inthesolutionreturnedbyClipper's
Executemethod,theirorientationswillalwaysbetrueforouterpolygonsandfalseforholepolygons(unlesstheReverseSolutionpropertyhasbeenenabled).
-
SeeAlsoOverview,Clipper.ReverseSolution,Path
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
PointInPolygon
Del.»functionPointInPolygon(constPt:TIntPoint;constpoly:TPath):Integer;C++»intPointInPolygon(constIntPointpt,constPath&poly);//FunctionintheClipperLibnamespace.C#»publicstaticintPointInPolygon(IntPointpt,Pathpoly);//StaticmethodoftheClipperclass.
Returns0whenfalse,-1whenptisonpolyand+1whenptisinpoly.
It'sassumedthat'poly'isclosedanddoesnotself-intersect.
-
SeeAlsoIntPoint,Path
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
PolyTreeToPaths
Del.»functionPolyTreeToPaths(PolyTree:TPolyTree):TPaths;C++»voidPolyTreeToPaths(PolyTree&polytree,Paths&paths);C#»publicstaticPathsPolyTreeToPaths(PolyTreepolytree);
ThisfunctionconvertsaPolyTreestructureintoaPathsstructure.
-
SeeAlsoPolyTree,Paths
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
ReversePath
Del.»functionReversePath(constpolys:TPath):TPath;C++»voidReversePath(constPath&p);C#»//CallPath.Reverse().
Reversesthevertexorder(andhenceorientation)inthespecifiedpath.
-
SeeAlsoPath
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
ReversePaths
Del.»functionReversePaths(constp:TPaths):TPaths;C++»voidReversePaths(constPaths&p);C#»voidReversePaths(Pathsp);
Reversesthevertexorder(andhenceorientation)ineachcontainedpath.
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
SimplifyPolygon
Del.»functionSimplifyPolygon(constPoly:TPath;FillType:TPolyFillType=pftEvenOdd):TPaths;C++»voidSimplifyPolygon(constPath&in_poly,Paths&out_polys,PolyFillTypefillType=pftEvenOdd);C#»publicstaticPathsSimplifyPolygon(Pathpoly,PolyFillTypefillType=PolyFillType.pftEvenOdd);
Removesself-intersectionsfromthesuppliedpolygon(byperformingabooleanunionoperationusingthenominatedPolyFillType).Polygonswithnon-contiguousduplicatevertices(ie'touching')willbesplitintotwopolygons.
Note:There'scurrentlynoguaranteethatpolygonswillbestrictlysimplesince'simplifying'isstillaworkinprogress.
-
SeeAlsoClipper.StrictlySimple,CleanPolygon,Path,PolyFillType
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
SimplifyPolygons
Del.»functionSimplifyPolygons(constpolys:TPaths;FillType:TPolyFillType=pftEvenOdd):TPaths;C++»voidSimplifyPolygons(constPaths&in_polys,Paths&out_polys,PolyFillTypefillType=pftEvenOdd);C++»voidSimplifyPolygons(Paths&polys,PolyFillTypefillType=pftEvenOdd);C#»publicstaticPolygonsSimplifyPolygons(Pathspolys,PolyFillTypefillType=PolyFillType.pftEvenOdd);
Removesself-intersectionsfromthesuppliedpolygons(byperformingabooleanunionoperationusingthenominatedPolyFillType).Polygonswithnon-contiguousduplicatevertices(ie'verticesaretouching')willbesplitintotwopolygons.
C++only:Thisfunctionisoverloaded.Inthefirstdefinition,thein_polysandout_polysparameterscanreferencethesamePathsobjectthoughinthatcasethecallingcodemightbecleareriftheseconddefinition(acceptingasinglePathsparameter)isused.
Note:There'scurrentlynoguaranteethatpolygonswillbestrictlysimplesince'simplifying'isstillaworkinprogress.
-
SeeAlsoClipper.StrictlySimple,CleanPolygons,PolyFillType
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib Clipper
-
//C++constructorsettingStrictlySimpleandPreserveCollinearproperties...Clipperclipper(ioStrictlySimple|ioPreserveCollinear);
//C#constructorsettingStrictlySimpleandPreserveCollinearproperties...Clipperclipper=newClipper(Clipper.ioStrictlySimple|Clipper.ioPreserveCollinear);
//DelphiconstructorsettingStrictlySimpleandPreserveCollinearproperties...clipper:=TClipper.Create([ioStrictlySimple,ioPreserveCollinear]);
Clipper.Constructor
Del.»constructorTClipper.Create(InitOptions:TInitOptions=[]);C++»Clipper::Clipper(intinitOptions=0):ClipperBase();C#»publicClipper(initOptions=0):base(){};
TheClipperconstructorcreatesaninstanceoftheClipperclass.OneormoreInitOptionsmaybepassedasaparametertosetthecorrespondingproperties.(Thesepropertiescanstillbesetorresetafterconstruction.)
Examples:
-
SeeAlsoPreserveCollinear,ReverseSolution,StrictlySimple,InitOptions
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib Clipper
-
Clipper.Execute
Del.»functionExecute(clipType:TClipType;outsolution:TPaths;subjFillType:TPolyFillType=pftEvenOdd;clipFillType:TPolyFillType=pftEvenOdd):boolean;overload;
functionExecute(clipType:TClipType;outsolution:TPolyTree;subjFillType:TPolyFillType=pftEvenOdd;clipFillType:TPolyFillType=pftEvenOdd):boolean;overload;C++»boolExecute(ClipTypeclipType,Paths&solution,PolyFillTypesubjFillType=pftEvenOdd,PolyFillTypeclipFillType=pftEvenOdd);
boolExecute(ClipTypeclipType,PolyTree&solution,PolyFillTypesubjFillType=pftEvenOdd,PolyFillTypeclipFillType=pftEvenOdd);C#»publicboolExecute(ClipTypeclipType,Pathssolution,PolyFillTypesubjFillType,PolyFillTypeclipFillType);
publicboolExecute(ClipTypeclipType,PolyTreesolution,PolyFillTypesubjFillType,PolyFillTypeclipFillType);
Oncesubjectandclippathshavebeenassigned(viaAddPathand/orAddPaths),Executecanthenperformtheclippingoperation(intersection,union,differenceorXOR)specifiedbytheclipType
-
parameter.
ThesolutionparametercanbeeitheraPathsorPolyTreestructure.ThePathsstructureissimplerthanthePolyTreestucture.Becauseofthisitisquickertopopulateandhenceclippingperformanceisalittlebetter(it'sroughly10%faster).However,thePolyTreedatastructureprovidesmoreinformationaboutthereturnedpathswhichmaybeimportanttousers.Firstly,thePolyTreestructurepreservesnestedparent-childpolygonrelationships(ieouterpolygonsowning/containingholesandholesowning/containingotherouterpolygonsetc).Also,onlythePolyTreestructurecandifferentiatebetweenopenandclosedpathssinceeachPolyNodehasanIsOpenproperty.(ThePathstructurehasnomemberindicatingwhetherit'sopenorclosed.)Forthisreason,whenopenpathsarepassedtoaClipperobject,theusermustuseaPolyTreeobjectasthesolutionparameter,otherwiseanexceptionwillberaised.
WhenaPolyTreeobjectisusedinaclippingoperationonopenpaths,twoancilliaryfunctionshavebeenprovidedtoquicklyseparateoutopenandclosedpathsfromthesolution-OpenPathsFromPolyTreeandClosedPathsFromPolyTree.PolyTreeToPathsisalsoavailabletoconvertpathdatatoaPathsstructure(irrespectiveofwhetherthey'reopenorclosed).
Thereareseveralthingstonoteaboutthesolutionpathsreturned:
theyaren'tinany
-
specificordertheyshouldneveroverlaporbeself-intersecting(butseenoteson
rounding)holeswillbeorientedoppositeouterpolygonsthesolutionfilltypecanbeconsideredeitherEvenOddorNonZero
sinceitwillcomplywitheitherfillingrulepolygonsmayrarelyshareacommonedge(thoughthisisnowvery
rareasofversion6)
ThesubjFillTypeandclipFillTypeparametersdefinethepolygonfillruletobeappliedtothepolygons(ieclosedpaths)inthesubjectandclippathsrespectively.(It'susualthoughobviouslynotessentialthatbothsetsofpolygonsusethesamefillrule.)
Executecanbecalledmultipletimeswithoutreassigningsubjectandclippolygons(iewhendifferentclippingoperationsarerequiredonthesamepolygonsets).
-
SeeAlsoExample,Rounding,ClipperBase.AddPath,ClipperBase.AddPaths,PolyNode.IsOpen,PolyTree,ClosedPathsFromPolyTree,OpenPathsFromPolyTree,PolyTreeToPaths,ClipType,Path,Paths,PolyFillType
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib Clipper
-
Clipper.PreserveCollinear
Del.»propertyPreserveCollinear:boolean;override;C++»voidPreserveCollinear(boolvalue);C#»publicboolPreserveCollinear{get{}set{}};
Bydefault,whenthreeormoreverticesarecollinearininputpolygons(subjectorclip),theClipperobjectremovesthe'inner'verticesbeforeclipping.WhenenabledthePreserveCollinearpropertypreventsthisdefaultbehaviortoallowtheseinnerverticestoappearinthesolution.
-
SeeAlsoConstructor
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib Clipper
-
Clipper.ReverseSolution
Del.»propertyReverseSolution:boolean;override;C++»voidReverseSolution(boolvalue);C#»publicboolReverseSolution{get{}set{}};
Whenthispropertyissettotrue,polygonsreturnedinthesolutionparameteroftheExecute()methodwillhaveorientationsoppositetotheirnormalorientations.
-
SeeAlsoExecute,Orientation
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib Clipper
-
Clipper.StrictlySimple
Del.»propertyStrictlySimple:boolean;override;C++»voidStrictlySimple(boolvalue);C#»publicboolStrictlySimple{get{}set{}};
Terminology:
Asimplepolygonisonethatdoesnotself-intersect.Aweaklysimplepolygonisasimplepolygonthatcontains'touching'
vertices,or'touching'edges.Astrictlysimplepolygonisasimplepolygonthatdoesnotcontain
'touching'vertices,or'touching'edges.
Vertices'touch'iftheysharethesamecoordinates(andarenotadjacent).Anedgetouchesanotherifoneofitsendverticestouchesanotheredgeexcludingitsadjacentedges,oriftheyareco-linearandoverlapping(includingadjacentedges).
Polygonsreturnedbyclippingoperations(seeClipper.Execute())shouldalwaysbesimplepolygons.WhentheStrictlySimplypropertyisenabled,polygonsreturnedwillbestrictlysimple,otherwisetheymaybeweaklysimple.It'scomputationallyexpensiveensuringpolygonsarestrictlysimpleandsothispropertyisdisabledbydefault.
Note:There'scurrentlynoguaranteethatpolygonswillbestrictlysimplesince'simplifying'isstillaworkinprogress.
-
Intheimageabove,thetwoexamplesshowweaklysimplepolygonsbeingbrokenintotwostrictlysimplepolygons.(Theoutlineswitharrowsareintendedtoaidvisualizingvertexorder.)
SeealsothearticleonSimplePolygonsonWikipedia.
http://en.wikipedia.org/wiki/Simple_polygon
-
SeeAlsoExecute,SimplifyPolygons
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib Clipper
-
Clipper.ZFillFunction
Del.»propertyZFillFunction:TZFillCallbackreadFZFillCallbackwriteFZFillCallback;C++»voidZFillFunction(ZFillCallbackzFillFunc);C#»publicZFillCallbackZFillFunction{get;set;};
Thispropertyisonlyexposedwhenthepre-processordirectiveuse_xyzhasbeendefined.Ifthisisthecase,a'Z'memberwillbeincludedintheIntPointstructurewhereuserscanstorecustomdata.Whilemostverticesinaclippingsolutionwillcorrespondtoinput(subjectandclip)vertices,therewillalsobenewverticeswhereveredgesintersect.ThispropertyassignsacustomcallbackfunctiontotheClipperobjectsothatcustom'Z'valuescanbeassignedtotheseintersectionvertices.(Notethat'Z'valuesinthesolutionatnon-intersectingverticeswillsimplybecopiedfrommatchinginputverticesalongwiththeXandYvalues.)
Itisuptothelibraryusertoassign'Z'valuesfornewintersectionvertices(otherwisethesevalueswillremain0).Thefourverticesthatdefinetheintersectinglinesegmentswillbepassedtothecallbackfunction(togetherwiththenewintersectionvertex)toaidtheuserindeterminingappropriateZvalues.
-
SeeAlsoDefines,IntPoint,ZFillCallback
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib ClipperBase
-
ClipperBase.AddPath
Del.»functionAddPath(constpath:TPath;polyType:TPolyType;Closed:Boolean):Boolean;C++»boolAddPath(constPath&pg,PolyTypepolyType,boolclosed);C#»publicvirtualboolAddPath(Pathpg,PolyTypepolyType,boolclosed);
Anynumberofsubjectandclippathscanbeaddedtoaclippingtask,eitherindividuallyviatheAddPath()method,orasgroupsviatheAddPaths()method,orevenusingbothmethods.
'Subject'pathsmaybeeitheropen(lines)orclosed(polygons)orevenamixtureofboth,but'clipping'pathsmustalwaysbeclosed.Clipperallowspolygonstoclipbothlinesandotherpolygons,butdoesn'tallowlinestoclipeitherlinesorpolygons.
Withclosedpaths,orientationshouldconformwiththefillingrulethatwillbepassedviaClippper'sExecutemethod.
PathCoordinaterange:Pathcoordinatesmustbebetween±0x3FFFFFFFFFFFFFFF(±4.6e+18),otherwisearangeerrorwillbethrownwhenattemptingtoaddthepathtotheClipperobject.Ifcoordinatescanbekeptbetween±0x3FFFFFFF(±1.0e+9),amodestincreaseinperformance(approx.15-20%)overthelargerrangecanbeachievedbyavoidinglargeintegermath.Ifthepreprocessordirectiveuse_int32isdefined(allowingafurtherincreaseinperformanceof20-30%),thenthemaximumrangeisrestrictedto±32,767.
ReturnValue:Thefunctionwillreturnfalseifthepathisinvalidforclipping.Apathis
-
invalidforclippingwhen:
ithaslessthan2verticesithas2verticesbutisnotanopenpaththeverticesareallco-linearanditisnotanopenpath
-
SeeAlsoExample,Clipper.Execute,AddPaths,Orientation,Defines,Path,PolyFillType,PolyType
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib ClipperBase
-
ClipperBase.AddPaths
Del.»functionAddPaths(constpaths:TPaths;polyType:TPolyType;Closed:Boolean):boolean;C++»boolAddPaths(constPaths&ppg,PolyTypepolyType,boolclosed);C#»publicvirtualboolAddPaths(Pathsppg,PolyTypepolyType,boolclosed);
Anynumberofsubjectandclippathscanbeaddedtoaclippingtask,eitherindividuallyviatheAddPath()method,orasgroupsviatheAddPaths()method,orevenusingbothmethods.
'Subject'pathsmaybeeitheropen(lines)orclosed(polygons)orevenamixtureofboth,but'clipping'pathsmustalwaysbeclosed.Clipperallowspolygonstoclipbothlinesandotherpolygons,butdoesn'tallowlinestoclipeitherlinesorpolygons.
Withclosedpaths,orientationshouldconformwiththefillingrulethatwillbepassedviaClippper'sExecutemethod.
PathCoordinaterange:Pathcoordinatesmustbebetween±0x3FFFFFFFFFFFFFFF(±4.6e+18),otherwisearangeerrorwillbethrownwhenattemptingtoaddthepathtotheClipperobject.Ifcoordinatescanbekeptbetween±0x3FFFFFFF(±1.0e+9),amodestincreaseinperformance(approx.15-20%)overthelargerrangecanbeachievedbyavoidinglargeintegermath.Ifthepreprocessordirectiveuse_int32isdefined(allowingafurtherincreaseinperformanceof20-30%),thenthemaximumrangeisrestrictedto±32,767.
ReturnValue:Thefunctionwillreturnfalseifthepathisinvalidforclipping.Apathis
-
invalidforclippingwhen:
ithaslessthan2verticesithas2verticesbutisnotanopenpaththeverticesareallco-linearanditisnotanopenpath
-
SeeAlsoExample,Clipper.Execute,AddPaths,Orientation,Defines,Paths,PolyFillType,PolyType
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib ClipperBase
-
ClipperBase.Clear
Del.»procedureClear;C++»virtualvoidClear();C#»publicvoidClear(){};
TheClearmethodremovesanyexistingsubjectandclippolygonsallowingtheClipperobjecttobereusedforclippingoperationsondifferentpolygonsets.
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib ClipperBase
-
ClipperBase.GetBounds
Del.»functionGetBounds:TIntRect;C++»IntRectGetBounds();C#»publicIntRectGetBounds(){...};
Thismethodreturnstheaxis-alignedboundingrectangleofallpolygonsthathavebeenaddedtotheClipperobject.
-
SeeAlsoExample,IntRect
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib ClipperOffset
-
ClipperOffset.AddPath
Del.»procedureAddPath(constPath:TPath;JoinType:TJoinType;EndType:TEndType);C++»voidAddPath(constPath&path,JoinTypejointype,EndTypeendtype);C#»publicvoidAddPath(Pathpath,JoinTypejointype,EndTypeendtype);
AddsaPathtoaClipperOffsetobjectinpreparationforoffsetting.
Anynumberofpathscanbeadded,andeachhasitsownJoinTypeandEndType.All'outer'Pathsmusthavethesameorientation,andany'hole'pathsmusthavereverseorientation.Closedpathsmusthaveatleast3vertices.Openpathsmayhaveasfewasonevertex.Openpathscanonlybeoffsetwithpositivedeltas.
-
SeeAlsoEndType,JoinType,Path
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib ClipperOffset
-
ClipperOffset.AddPaths
Del.»procedureAddPaths(constPaths:TPaths;JoinType:TJoinType;EndType:TEndType);C++»voidAddPaths(constPaths&paths,JoinTypejointype,EndTypeendtype);C#»publicvoidAddPaths(Pathspaths,JoinTypejointype,EndTypeendtype);
AddsPathstoaClipperOffsetobjectinpreparationforoffsetting.
Anynumberofpathscanbeadded,andeachpathhasitsownJoinTypeandEndType.All'outer'Pathsmusthavethesameorientation,andany'hole'pathsmusthavereverseorientation.Closedpathsmusthaveatleast3vertices.Openpathsmayhaveasfewasonevertex.Openpathscanonlybeoffsetwithpositivedeltas.
-
SeeAlsoEndType,JoinType,Paths
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib ClipperOffset
-
ClipperOffset.Clear
Del.»procedureClear;C++»voidClear();C#»publicvoidClear();
ThismethodclearsallpathsfromtheClipperOffsetobject,allowingnewpathstobeassigned.
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib ClipperOffset
-
ClipperOffset.Constructor
Del.»constructorCreate(MiterLimit:Double=2;RoundPrecision:Double=0.25);C++»ClipperOffset(doublemiterLimit=2.0,doubleroundPrecision=0.25);C#»publicClipperOffset(doublemiterLimit=2.0,doubleroundPrecision=0.25);
TheClipperOffsetconstructortakes2optionalparameters:MiterLimitandArcTolerance.Thestwoparameterscorrespondstopropertiesofthesamename.MiterLimitisonlyrelevantwhenJoinTypeisjtMiter,andArcToleranceisonlyrelevantwhenJoinTypeisjtRoundorwhenEndTypeisetOpenRound.
-
SeeAlsoArcTolerance,MiterLimit
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib ClipperOffset
-
ClipperOffset.Execute
Del.»procedureExecute(outsolution:TPaths;Delta:Double);overload;C++»voidExecute(Paths&solution,doubledelta);C#»publicvoidExecute(refPathssolution,doubledelta);Del.»procedureExecute(outPolyTree:TPolyTree;Delta:Double);overload;C++»voidExecute(PolyTree&polytree,doubledelta);C#»publicvoidExecute(refPolyTreepolytree,doubledelta);
Thismethodtakestwoparameters.Thefirstisthestructurethatreceivestheresultoftheoffsetoperation(eitheraPolyTreeoraPathsstructure).Thesecondparameteristheamounttowhichthesuppliedpathswillbeoffset.Negativedeltavaluesshrinkpolygonsandpositivedeltaexpandthem.
Thismethodcanbecalledmultipletimes,offsettingthesamepathsbydifferentamounts(ieusingdifferentdeltas).
-
#include"clipper.hpp"...usingnamespaceClipperLib;
intmain(){Pathsubj;Pathssolution;subj
-
Home ClipperLib ClipperOffset
-
ClipperOffset.ArcTolerance
Del.»propertyArcTolerance:double;//readandwriteC++»doubleArcTolerance;C#»publicdoubleArcTolerance{get;set;}
Firstly,thisfield/propertyisonlyrelevantwhenJoinType=jtRoundand/orEndType=etRound.
Sinceflattenedpathscanneverperfectlyrepresentarcs,thisfield/propertyspecifiesamaximumacceptableimprecision('tolerance')whenarcsareapproximatedinanoffsettingoperation.Smallervalueswillincrease'smoothness'uptoapointthoughatacostofperformanceandincreatingmoreverticestoconstructthearc.
ThedefaultArcToleranceis0.25units.Thismeansthatthemaximumdistancetheflattenedpathwilldeviatefromthe'true'arcwillbenomorethan0.25units(beforerounding).
Reducingtolerancesbelow0.25willnotimprovesmoothnesssincevertexcoordinateswillstillberoundedtointegervalues.Theonlywaytoachievesub-integerprecisionisthroughcoordinatescalingbeforeandafteroffsetting(seeexamplebelow).
It'simportanttomakeArcToleranceasensiblefractionoftheoffsetdelta(arcradius).Largetolerancesrelativetotheoffsetdeltawillproducepoorarcapproximationsbut,justasimportantly,verysmalltoleranceswillsubstantiallyslowoffsettingperformancewhileprovidingunnecessarydegreesofprecision.Thisismostlikelytobeanissuewhenoffsettingpolygonswhosecoordinateshavebeenscaledtopreservefloatingpointprecision.
Example:Imagineasetofpolygons(definedinfloatingpointcoordinates)thatistobeoffsetby10unitsusingroundjoins,andthesolutionistoretainfloatingpointprecisionuptoatleast6decimalplaces.Topreservethisdegreeoffloatingpointprecision,andgiventhatClipper
-
andClipperOffsetbothoperateonintegercoordinates,thepolygoncoordinateswillbescaledupby108(androundedtointegers)priortooffsetting.BothoffsetdeltaandArcTolerancewillalsoneedtobescaledbythissamefactor.IfArcTolerancewasleftunscaledatthedefault0.25units,everyarcinthesolutionwouldcontainafractionof44THOUSANDverticeswhilethefinalarcimprecisionwouldbe0.25×10-8units(ieoncescalingwasreversed).However,if0.1unitswasanacceptableimprecisioninthefinalunscaledsolution,thenArcToleranceshouldbesetto0.1×scaling_factor(0.1×108).NowifscalingisappliedequallytobothArcToleranceandtoDeltaOffset,theninthisexamplethenumberofvertices(steps)definingeacharcwouldbeafractionof23.
Theformulaforthenumberofstepsinafullcirculararcis...Pi/acos(1-arc_tolerance/abs(delta))
-
SeeAlsooffset_triginometry2
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib ClipperOffset
-
ClipperOffset.MiterLimit
Del.»propertyMiterLimit:double;//readandwriteC++»doubleMiterLimit;C#»publicdoubleMiterLimit{get;set;}
Thispropertysetsthemaximumdistanceinmultiplesofdeltathatverticescanbeoffsetfromtheiroriginalpositionsbeforesquaringisapplied.(Squaringtruncatesamiterby'cuttingitoff'at1×deltadistancefromtheoriginalvertex.)
ThedefaultvalueforMiterLimitis2(ietwicedelta).ThisisalsothesmallestMiterLimitthat'sallowed.Ifmiteringwasunrestricted(iewithoutanysquaring),thenoffsetsatveryacuteangleswouldgenerateunacceptablylong'spikes'.
Anexampleofanoffsetting'spike'atanarrowanglethat'saconsequenceofusingalargeMiterLimit(25)...
-
SeeAlsoJoinType
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib PolyNode
-
PolyTreepolytree;//calltoClipper.Executemethodherewhichfills'polytree'PolyNode*polynode=polytree.GetFirst();while(polynode){//dostuffwithpolynodeherepolynode=polynode->GetNext();}
PolyNode.GetNext
Del.»functionGetNext:TPolyNode;C++»PolyNode*GetNext();C#»publicPolyNodeGetNext();
ThereturnedPolynodewillbethefirstchildifany,otherwisethenextsibling,otherwisethenextsiblingoftheParentetc.
APolyTreecanbetraversedveryeasilybycallingGetFirst()followedbyGetNext()inaloopuntilthereturnedobjectisanullpointer...
-
SeeAlsoPolyTree.GetFirst
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib PolyNode
-
PolyNode.ChildCount
Del.»propertyChildCount:Integer;//readonlyC++»ChildCount();//readonlyC#»publicintChildCount;//readonly
ReturnsthenumberofPolyNodeChildsdirectlyownedbythePolyNodeobject.
-
SeeAlsoChilds
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib PolyNode
-
PolyNode.Childs
Del.»propertyChilds[index:Integer]:TPolyNode;//readonlyC++»std::vector<PolyNode*>Childs;//publicfieldC#»publicList<PolyNode>Childs;//readonlyproperty
Aread-onlylistofPolyNode.OuterPolyNodechildscontainholePolyNodes,andholePolyNodechildscontainnestedouterPolyNodes.
-
SeeAlsoChildCount
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib PolyNode
-
PolyNode.Contour
Del.»propertyContour:TPath;//readonlyC++»PathContour;//publicfieldC#»publicPathContour;//readonlyproperty
Returnsapathlistwhichcontainsanynumberofvertices.
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib PolyNode
-
PolyNode.IsHole
Del.»IsHole:Boolean;//readonlyC++»boolIsHole;//fieldC#»publicboolIsHole;//readonlyproperty
ReturnstruewhenthePolyNode'spolygon(Contour)isahole.
Childrenofouterpolygonsarealwaysholes,andchildrenofholesarealways(nested)outerpolygons.TheIsHolepropertyofaPolyTreeobjectisundefinedbutitschildrenarealwaystop-levelouterpolygons.
-
SeeAlsoOverview,Contour,PolyTree
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib PolyNode
-
PolyNode.IsOpen
Del.»IsOpen:Boolean;//readonlyC++»boolIsOpen;//fieldC#»publicboolIsOpen;//readonlyproperty
ReturnstruewhenthePolyNode'sContourresultsfromaclippingoperationonanopencontour(path).Onlytop-levelPolyNodescancontainopencontours.
-
SeeAlsoContour
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib PolyNode
-
PolyNode.Parent
Del.»Parent:TPolyNode;//readonlyC++»PolyNode*Parent;//fieldC#»publicPolyNodeParent;//readonlyproperty
ReturnstheparentPolyNode.
ThePolyTreeobject(whichisalsoaPolyNode)doesnothaveaparentandwillreturnanullpointer.
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib PolyTree
-
PolyTree.Clear
Del.»procedureClear;C++»voidClear();C#»publicvoidClear();
ThismethodclearsanyPolyNodechildrencontainedbyPolyTreetheobject.
Cleardoesnotneedtobecalledexplicitly.TheClipper.ExecutemethodthatacceptsaPolyTreeparameterwillautomaticallyclearthePolyTreeobjectbeforepropagatingitwithnewPolyNodes.Likewise,PolyTree'sdestructorwillalsoautomaticallyclearanycontainedPolyNodes.
-
SeeAlsoClipper.Execute
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib PolyTree
-
PolyTree.GetFirst
Del.»functionGetFirst:TPolyNode;C++»PolyNode*GetFirst();C#»publicPolyNodeGetFirst();
Thismethodreturnsthefirstouterpolygoncontourifany,otherwiseanullpointer.
ThisfunctionisalmostequivalenttocallingChilds[0]exceptthatwhenaPolyTreeobjectisempty(hasnochildren),callingChilds[0]wouldraiseanoutofrangeexception.
-
SeeAlsoPolyNode.GetNext,PolyNode.ChildCount,PolyNode.Childs
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib PolyTree
-
PolyTree.Total
Del.»propertyTotal:Integer;//readonlyC++»Total();//readonlyC#»publicintTotal;//readonly
ReturnsthetotalnumberofPolyNodes(polygons)containedwithinthePolyTree.ThisvalueisnottobeconfusedwithChildCountwhichreturnsthenumberofimmediatechildrenonly(Childs)containedbyPolyTree.
-
SeeAlsoPolyNode.ChildCount,PolyNode.Childs
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home
-
Overview
TheClipperLibraryperformsclipping,andoffsettingofbothlinesandpolygons.
AnumberoffeaturessetClipperapartfromotherclippinglibraries:
itacceptsalltypesofpolygonsincludingself-intersectingonesitsupportsmultiplepolygonfillingrules(EvenOdd,NonZero,
Positive,Negative)it'sveryfastrelativetootherlibrariesit'snumericallyrobustitalsoperformslineandpolygonoffsettingit'sfreetouseinbothfreewareandcommercialapplications
CurrentVersion:6.2.0
Author©right:AngusJohnson.Copyright©2010-2014License,termsandconditions:BoostSoftwareLicense
Terminology:
Clipping:commonlyreferstotheprocessofcuttingawayfromasetof2-dimensionalgeometricshapesthosepartsthatareoutsidearectangular'clipping'window.Thiscanbeachievedbyintersecting
http://www.angusj.com/delphi/clipper.php#featureshttp://www.mpi-inf.mpg.de/~kettner/pub/nonrobust_cgta_06.pdf
-
subjectpaths(linesandpolygons)withaclippingrectangle.Inamoregeneralsense,theclippingwindowneednotberectangularbutcanbeanytypeofpolygon,evenmultiplepolygons.Also,whileclippingtypicallyreferstoanintersectionoperation,inthisdocumentationitwillrefertoanyoneofthefourbooleanoperations(intersection,union,differenceandexclusive-or).Path:isanorderedsequenceofverticesdefiningasinglegeometric
contourthat'seitheraline(anopenpath)orapolygon(aclosedpath).Line:orpolylineisanopenpathcontaining2ormorevertices.Polygon:commonlyreferstoatwo-dimensionalregionboundedby
anouternon-intersectingclosedcontour.Thatregionmayalsocontainanumberof'holes'.Inthisdocumentationhowever,polygonwillsimplyrefertoaclosedpath.Contour:synonymouswithpath.Hole:isaclosedregionwithinapolygonthat'snotpartofthe
polygon.A'holepolygon'isaclosedpaththatformstheouterboundariesofahole.PolygonFillingRule:thefillingrule,togetherwithalistofclosed
paths,definesthoseregions(boundedbypaths)thatareinside(ieregions'brushfilled'inagraphicaldisplay)andthosewhichareoutside(ie'holes').
Distributionpackagecontents:
TheZIPpackagecontainstheClipperlibrary'ssourcecode,aWindowsCHMhelpfile,HTMLhelp,andanumberofcompileddemoapplications(withfullsourcecode).ThelibrarywasinitiallywritteninDelphiPascal(andcompileswithDelphiversion7orabove)butnowcontainsC++,C#andPythontranslationstoo.Thelibrary'ssourcecodeineachlanguageisabout5000lines.TheDelphicodecontainsreasonablyextensivecomments,butcommentsarefewerintheC++andC#code.TheincludedsampleapplicationsshowhowClippercanbeusedwiththedifferentlanguagesusinganumberofgraphicsdisplaylibrariesincluding-AGG,Cairo,OpenGL,Graphics32,GDI+andSVG.
DownloadLink:
-
SourceForge
References:
TheLibraryisbasedonbutsignificantlyextendsBalaVatti'spolygonclippingalgorithmasdescribedin"Agenericsolutiontopolygonclipping",CommunicationsoftheACM,Vol35,Issue7(July1992)pp56-63.
Asectionin"Computergraphicsandgeometricmodeling:implementationandalgorithms"byByMaxK.Agoston(Springer,2005)discussingVattiPolygonClippingwasalsohelpfulincreatingtheinitialClipperimplementation.
Thepapertitled"PolygonOffsettingbyComputingWindingNumbers"byChen&McMains(Paperno.DETC2005-85513,ASME2005.Pages565-575)containshelpfuldiscussiononthecomplexitiesofpolygonoffsettingtogetherwithsomesolutions.
http://sourceforge.net/projects/polyclippinghttp://portal.acm.org/citation.cfm?id=129906http://books.google.com/books?q=vatti+clipping+agostonhttp://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf
-
SeeAlsoSource,License,Clipper,ClipperOffset,ClipType,PolyFillType
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
ClipperBase
ClipperBaseisanabstractbaseclassforClipper.AClipperBaseobjectshouldnotbeinstantiateddirectly.
-
ReferenceMethods
InClipperBase:AddPathAddPathsClearGetBounds
-
SeeAlsoClipper
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
Clipper
Hierarchy|ClipperBase
TheClipperclassencapsulatesbooleanoperationsonpolygons(intersection,union,differenceandXOR),whichisalsocalledpolygonclipping.
Inputpolygons,bothsubjectandclipsets,arepassedtoaClipperobjectbyitsAddPathandAddPathsmethods,andtheclippingoperationisperformedbycallingitsExecutemethod.MultiplebooleanoperationscanbeperformedonthesameinputpolygonsetsbyrepeatcallstoExecute.
-
ReferenceMethods PropertiesInClipper:Constructor PreserveCollinearExecute ReverseSolution
StrictlySimpleZFillFunction
InClipperBase:AddPathAddPathsClearGetBounds
-
SeeAlsoOverview,ClipType
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
#include"clipper.hpp"...usingnamespaceClipperLib;
intmain(){
ClipperOffset
TheClipperOffsetclassencapsulatestheprocessofoffsetting(inflating/deflating)bothopenandclosedpathsusinganumberofdifferentjointypesandendtypes.
(ThisclassreplacesthenowdeprecatedOffsetPathsfunctionwhichwaslessflexible.)
Preconditionsforoffsetting:1.Theorientationsofclosedpathsmustbeconsistentsuchthatouterpolygonssharethesameorientation,andanyholeshavetheoppositeorientation(ienon-zerofilling).Openpathsmustbeorientedwithclosedouterpolygons.2.Polygonsmustnotself-intersect.
Limitations:Whenoffsetting,smallartefactsmayappearwherepolygonsoverlap.Toavoidtheseartefacts,offsetoverlappingpolygonsseparately.
-
Pathsubj;Pathssolution;subj
-
ReferenceMethods PropertiesInClipperOffset:AddPath ArcToleranceAddPaths MiterLimitClearConstructorExecute
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
PolyNode
PolyNodesareencapsulatedwithinaPolyTreecontainer,andtogetherprovideadatastructurerepresentingtheparent-childrelationshipsofpolygoncontoursreturnedbyClipper'sExecutemethod.
APolyNodeobjectrepresentsasinglepolygon.ItsIsHolepropertyindicateswhetherit'sanouterorahole.PolyNodesmayownanynumberofPolyNodechildren(Childs),wherechildrenofouterpolygonsareholes,andchildrenofholesare(nested)outerpolygons.
-
ReferenceMethods PropertiesInPolyNode:GetNext ChildCount
ChildsContourIsHoleIsOpenParent
-
SeeAlsoOverview,Clipper.Execute,PolyTree
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home ClipperLib
-
PolyTree
Hierarchy|PolyNode
PolyTreeisintendedasaread-onlydatastructurethatshouldonlybeusedtoreceivesolutionsfromclippingandoffsettingoperations.It'sanalternativetothePathsdatastructurewhichalsoreceivesthesesolutions.PolyTree'stwomajoradvantagesoverthePathsstructureare:itproperlyrepresentstheparent-childrelationshipsofthereturnedpolygons;itdifferentiatesbetweenopenandclosedpaths.However,sincePolyTreeisamorecomplexstructurethanthePathsstructure,andsinceit'smorecomputationallyexpensivetoprocess(theExecutemethodbeingroughly5-10%slower),itshouldusedonlybewhenparent-childpolygonrelationshipsareneeded,orwhenopenpathsarebeing'clipped'.
AnemptyPolyTreeobjectcanbepassedasthesolutionparameterinClipper.ExecuteandinClipperOffset.Execute.Oncetheclippingoroffsetingoperationiscompleted,themethodreturnswiththePolyTreestructurefilledwithdatarepresentingthesolution.
APolyTreeobjectisacontainerforanynumberofPolyNodechildren,witheachcontainedPolyNoderepresentingasinglepolygoncontour(eitheranouterorholepolygon).PolyTreeitselfisaspecializedPolyNodewhoseimmediatechildrenrepresentthetop-levelouterpolygonsofthesolution.(ItsownContourpropertyisalwaysempty.)Thecontainedtop-levelPolyNodesmaycontaintheirownPolyNodechildrenrepresentingholepolygonsthatmayalsocontainchildrenrepresentingnestedouterpolygonsetc.Childrenofouterswillalwaysbeholes,andchildrenofholeswillalwaysbeouters.
PolyTreescanalsocontainopenpaths.OpenpathswillalwaysberepresentedbytoplevelPolyNodes.Twofunctionsareprovidedtoquicklyseparateoutopenandclosedpathsfromapolytree-OpenPathsFromPolyTreeandClosedPathsFromPolyTree.
-
polytree:Contour=()ChildCount=1Childs[0]:Contour=((10,10),(100,10),(100,100),(10,100))IsHole=FalseChildCount=1Childs[0]:Contour=((20,20),(20,90),(90,90),(90,20))IsHole=TrueChildCount=2Childs[0]:Contour=((30,30),(50,30),(50,50),(30,50))IsHole=FalseChildCount=0Childs[1]:Contour=((60,60),(80,60),(80,80),(60,80))IsHole=FalseChildCount=0
-
ReferenceMethods PropertiesInPolyTree:Clear TotalGetFirstInPolyNode:GetNext ChildCount
ChildsContourIsHoleIsOpenParent
-
SeeAlsoOverview,Clipper.Execute,ClipperOffset.Execute,PolyNode,ClosedPathsFromPolyTree,OpenPathsFromPolyTree,Paths
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
-
Home
-
ClipperLib
Filenames:clipper.pas;clipper.hppandclipper.cpp;clipper.cs
Namespace:ClipperLib
-
ContentsTypes Classes Functions
CInt Clipper AreaClipType ClipperBase CleanPolygonEndType ClipperOffset CleanPolygonsInitOptions PolyNode ClosedPathsFromPolyTreeIntPoint PolyTree MinkowskiDiffIntRect MinkowskiSumJoinType OffsetPathsPath OpenPathsFromPolyTreePaths OrientationPolyFillType PointInPolygonPolyType PolyTreeToPathsZFillCallback ReversePath
ReversePathsSimplifyPolygonSimplifyPolygons
Copyright©2010-2014AngusJohnson-Clipper6.2.0-Helpfilebuilton1-November-2014
Graphics32 HelpOverviewChangesDeprecatedExampleFAQLicenseRoundingClipperLibCIntClipTypeEndTypeInitOptionsIntPointIntRectJoinTypePathPathsPolyFillTypePolyTypeZFillCallbackAreaCleanPolygonCleanPolygonsClosedPathsFromPolyTreeMinkowskiDiffMinkowskiSumOffsetPathsOpenPathsFromPolyTreeOrientationPointInPolygonPolyTreeToPathsReversePathReversePathsSimplifyPolygonSimplifyPolygonsClipperConstructorExecutePreserveCollinearReverseSolutionStrictlySimpleZFillFunctionClipperBaseAddPathAddPathsClearGetBoundsClipperOffsetAddPathAddPathsClearConstructorExecuteArcToleranceMiterLimitPolyNodeGetNextChildCountChildsContourIsHoleIsOpenParentPolyTreeClearGetFirstTotal