lsst.geom  14.0-1-g7257b6a+14
Public Member Functions | Public Attributes | List of all members
lsst.geom.geometry.SphericalConvexPolygon Class Reference
Inheritance diagram for lsst.geom.geometry.SphericalConvexPolygon:
lsst.geom.geometry.SphericalRegion

Public Member Functions

def __init__ (self, args)
 
def getVertices (self)
 
def getEdges (self)
 
def getBoundingCircle (self)
 
def getBoundingBox (self)
 
def getZRange (self)
 
def clip (self, plane)
 
def intersect (self, poly)
 
def area (self)
 
def containsPoint (self, v)
 
def contains (self, pointOrRegion)
 
def intersects (self, pointOrRegion)
 
def __repr__ (self)
 
def __eq__ (self, other)
 
def __hash__ (self)
 

Public Attributes

 boundingBox
 
 boundingCircle
 
 vertices
 
 edges
 

Detailed Description

A convex polygon on the unit sphere with great circle edges. Points
falling exactly on polygon edges are considered to be inside (contained
by) the polygon.

Constructor & Destructor Documentation

◆ __init__()

def lsst.geom.geometry.SphericalConvexPolygon.__init__ (   self,
  args 
)
Creates a new polygon. Arguments must be either:

1. a SphericalConvexPolygon
2. a list of vertices
3. a list of vertices and a list of corresponding edges

In the first case, a copy is constructed. In the second case,
the argument must be a sequence of 3 element tuples/lists
(unit cartesian 3-vectors) - a copy of the vertices is stored
and polygon edges are computed. In the last case, copies of the
input vertex and edge lists are stored.

Vertices must be hemispherical and in counter-clockwise order when
viewed from outside the unit sphere in a right handed coordinate
system. They must also form a convex polygon.

When edges are specified, the i-th edge must correspond to the plane
equation of great circle connecting vertices (i - 1, i), that is,
the edge should be a unit cartesian 3-vector parallel to v[i-1] ^ v[i]
(where ^ denotes the vector cross product).

Note that these conditions are NOT verified for performance reasons.
Operations on SphericalConvexPolygon objects constructed with inputs
not satisfying these conditions are undefined. Use the convex()
function to check for convexity and ordering of the vertices. Or,
use the convexHull() function to create a SphericalConvexPolygon
from an arbitrary list of hemispherical input vertices.

Member Function Documentation

◆ __repr__()

def lsst.geom.geometry.SphericalConvexPolygon.__repr__ (   self)
Returns a string representation of this polygon.

◆ area()

def lsst.geom.geometry.SphericalConvexPolygon.area (   self)
Returns the area of this spherical convex polygon.

◆ clip()

def lsst.geom.geometry.SphericalConvexPolygon.clip (   self,
  plane 
)
Returns the polygon corresponding to the intersection of this
polygon with the positive half space defined by the given plane.
The plane must be specified with a cartesian unit vector (its
normal) and always passes through the origin.

Clipping is performed using the Sutherland-Hodgman algorithm,
adapted for spherical polygons.

◆ contains()

def lsst.geom.geometry.SphericalConvexPolygon.contains (   self,
  pointOrRegion 
)
Returns True if the specified point or spherical region is
completely contained in this polygon. Note that the implementation
is conservative where ellipses are concerned: False may be returned
for an ellipse that is actually completely contained by this polygon.

◆ getBoundingBox()

def lsst.geom.geometry.SphericalConvexPolygon.getBoundingBox (   self)
Returns a bounding box for this spherical convex polygon.

◆ getBoundingCircle()

def lsst.geom.geometry.SphericalConvexPolygon.getBoundingCircle (   self)
Returns a bounding circle (not necessarily minimal) for this
spherical convex polygon.

◆ getEdges()

def lsst.geom.geometry.SphericalConvexPolygon.getEdges (   self)
Returns the list of polygon edges. The i-th edge is the plane
equation for the great circle edge formed by vertices i-1 and i.

◆ getVertices()

def lsst.geom.geometry.SphericalConvexPolygon.getVertices (   self)
Returns the list of polygon vertices.

◆ getZRange()

def lsst.geom.geometry.SphericalConvexPolygon.getZRange (   self)
Returns the z coordinate range spanned by this spherical
convex polygon.

◆ intersect()

def lsst.geom.geometry.SphericalConvexPolygon.intersect (   self,
  poly 
)
Returns the intersection of poly with this polygon, or
None if the intersection does not exist.

◆ intersects()

def lsst.geom.geometry.SphericalConvexPolygon.intersects (   self,
  pointOrRegion 
)
Returns True if the given point or spherical region intersects
this polygon. Note that the implementation is conservative where
ellipses are concerned: True may be returned for an ellipse that
is actually disjoint from this polygon.

The documentation for this class was generated from the following file: