Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

General Polygon Clipper

From Wikipedia, the free encyclopedia
Graphics software library
icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "General Polygon Clipper" – news ·newspapers ·books ·scholar ·JSTOR
(December 2021) (Learn how and when to remove this message)

TheGeneral Polygon Clipper (GPC) is a software library providing for computing the results of clipping operations on sets ofpolygons. It generalises the computer graphicsclipping problem of intersecting polygons with polygons.The first release of GPC was designed and implemented in 1997 by Alan Murta. As of August 2009[update] the final GPC release was version 2.32. The core GPC library is written in theC programming language but the library has also been ported to work with several other languages.

Availability

[edit]

Since August 2020 GPC is no longer officially distributed by the author.

In December 2021 a copy of the GPC code (v2.33) was placed onGitHub under theMIT License byPaint.NET author Rick Brewster.[1]

Licensing

[edit]

Developers may use GPC for any purpose without paid licensing restrictions.

Features of GPC

[edit]

The following summarises the features and operations on polygons supported by GPC.

GPC can compute the following clip operations:difference,intersection,exclusive-or andunion.

Polygons may comprise multiple disjoint contours.Contour vertices may be specified as clockwise or anticlockwise.Contours may be convex, concave or self-intersecting.Contours may be nested. In other words, polygons may have holes.

The clip operation output from GPC is a set of polygon contours or tristrips.Holes and external contours are differentiated in GPC's output.Coincident edges and degenerate regions are handled correctly.

Examples of GPC operations on sets of polygons

[edit]

The following four images show examples of GPC computing operations between two polygon sets. The first polygon set comprises outlines of the United Kingdom and Ireland. The second polygon set comprises the four large inward-pointing arrows. In each example, the areas resulting from the GPC operation between the two sets of polygons are rendered in colour.

This example showsdifference between the two sets:

Example of GPC Difference
Example of GPCDifference

This example showsintersection between the two sets:

Example of GPC Intersection
Example of GPCIntersection

This example showsunion between the two sets:

Example of GPC Union
Example of GPCUnion

This example showsexclusive-or between the two sets:

Example of GPC Exclusive-or
Example of GPCExclusive-or

Ports and language bindings

[edit]

The core GPC code is written inC, but the GPC user community has contributed a number of ports and bindings (or wrappers) for various other languages (ActionScript 3,Borland Delphi,C#,GNU Octave,Haxe,Haskell,Java,Lua,Pascal,Perl,Python,VB.Net). All of these ports and bindings are freely available.

References

[edit]
  1. ^"GeneralPolygonClipper".GeneralPolygonClipper on GitHub. Retrieved22 December 2021.

External links

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=General_Polygon_Clipper&oldid=1305056503"
Category:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp