Main Content

Polygonal Shapes

Create and manipulate polygons and polygonal shapes

Given a set of 2-D points or a 2-D triangulation, you can create a polygon or a 2-D polygonal shape. Polygons are closed 2-D shapes with straight edges and no holes, discontinuities, or overlaps. Polygonal shapes are also shapes with straight edges, but they can have holes, discontinuities, and overlaps. Polygons are a subset of polygonal shapes.

Represent a polygonal shape by creating a polyshape object. Then modify, query, combine, and plot a polygon or polygonal shape by using object functions.

For more information about plotting polygonal shapes, see Polygons.

Objects

polyshapeRepresent 2-D polygonal shapes

Functions

expand all

polyshapeRepresent 2-D polygonal shapes
boundaryshapeCreate polyshape from 2-D triangulation
nsidedpolyCreate polyshape representing regular polygon with n sides
addboundaryAdd polyshape boundary
rmboundaryRemove polyshape boundary
rmsliversRemove polyshape boundary outliers
rmholesRemove holes in polyshape
simplifySimplify polyshape boundaries
polybufferCreate buffer around points, lines, or polyshape objects
sortboundariesSort polyshape boundaries
sortregionsSort polyshape regions
rotateRotate polyshape
scaleScale polyshape
translateTranslate polyshape
boundaryFind vertex coordinates of polyshape boundary
holesConvert polyshape hole boundaries to array of polyshape objects
isholeDetermine if polyshape boundary is a hole
isinteriorQuery points inside polyshape
issimplifiedDetermine if polyshape is well-defined
nearestvertexQuery nearest polyshape vertex
numboundariesFind number of polyshape boundaries
numsidesFind number of polyshape sides
overlapsDetermine whether polyshape objects overlap
plotPlot polyshape
regionsAccess polyshape regions
areaCompute area of polyshape
perimeterCompute perimeter of polyshape
turningdistCompute turning distance between polyshape objects
boundingboxFind bounding box of polyshape
centroidFind centroid of polyshape
convhullFind convex hull of polyshape
triangulationTriangulate polyshape
intersectIntersection of polyshape objects or intersection of line segment with polyshape
subtractDifference of two polyshape objects
unionUnion of polyshape objects
xorExclusive OR of two polyshape objects
polyareaCompute area of polygon
rectintFind rectangle intersection area
inpolygonFind points located inside or on edge of polygon