public class PolygonIntersector
extends java.lang.Object
GPCJ2 is an adaptation of the GPCJ library, that is itself a Java port of the GPC library. It was developed from GPCJ by Christian Lutz: https://github.com/ChristianLutz/gpcj
GPC (General Polygon Clipper) was written by Alan Murta http://www.cs.man.ac.uk/~toby/gpc/
GPCJ (General Polygon Clipper for Java) was written by Daniel Bridenbecker and extended by David Legland: http://web.archive.org/web/20090213122910/http://www.seisw.com/GPCJ/GPCJ.html
Original licence for GPC:
The SEI Software Open Source License, Version 1.0
Copyright (c) 2004, Solution Engineering, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOLUTION ENGINEERING, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Constructor and Description |
---|
PolygonIntersector() |
Modifier and Type | Method and Description |
---|---|
static Polygon2d[] |
intersect(Polygon2d poly0,
Polygon2d poly1)
Intersects two 2D polygons and returns an array of the results.
|
static Polygon3d[] |
intersect(Polygon3d poly0,
Polygon3d poly1,
RigidTransform3d TPW)
Intersects two 3D polygons in a given plane and returns an array of the
results.
|
Polygon2d[] |
intersectPolygons(Polygon2d poly0,
Polygon2d poly1)
Intersects two 2D polygons and returns an array of the results.
|
Polygon3d[] |
intersectPolygons(Polygon3d poly0,
Polygon3d poly1,
RigidTransform3d TPW)
Intersects two 3D polygons in a given plane and returns an array of the
results.
|
public Polygon2d[] intersectPolygons(Polygon2d poly0, Polygon2d poly1)
poly0
- first polygon to intersectpoly1
- second polygon to intersectpublic Polygon3d[] intersectPolygons(Polygon3d poly0, Polygon3d poly1, RigidTransform3d TPW)
poly0
- first polygon to intersectpoly1
- second polygon to intersectTPW
- transform from plane to world, used for the projectionpublic static Polygon2d[] intersect(Polygon2d poly0, Polygon2d poly1)
poly0
- first polygon to intersectpoly1
- second polygon to intersectpublic static Polygon3d[] intersect(Polygon3d poly0, Polygon3d poly1, RigidTransform3d TPW)
poly0
- first polygon to intersectpoly1
- second polygon to intersectTPW
- transform from plane to world, used for the projection