isConvex: Determine Whether Polygons are Convex

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Determine whether polygons found in a PolySet are convex.

Usage

1
isConvex (polys)

Arguments

polys

PolySet to use.

Details

Convex polygons do not self-intersect. In a convex polygon, only the first and last vertices may share the same coordinates (i.e., the polygons are optionally closed).

The function does not give special consideration to holes. It returns a value for each unique (PID, SID), regardless of whether a contour represents a hole.

Value

PolyData with columns PID, SID (may be missing), and convex. Column convex contains Boolean values.

Author(s)

Nicholas M. Boers, Associate Professor – Computer Science
MacEwan University, Edmonton AB
Last modified Rd: 2013-04-10

See Also

isIntersecting, PolySet.

Examples

1
2
3
4
5
6
7
8
9
local(envir=.PBSmapEnv,expr={
  #--- load the data (if using R)
  if (!is.null(version$language) && (version$language=="R"))
    data(nepacLL,envir=.PBSmapEnv)
  #--- calculate then print the polygons that are convex
  p <- isConvex(nepacLL);
  #--- nepacLL actually contains no convex polygons
  print(p[p$convex,])
})

PBSmapping documentation built on Jan. 15, 2021, 3:41 p.m.