Mathematics > Computational Geometry

84 functions in MATLAB › Mathematics > Computational Geometry.

Elementary Polygons

addboundaryAdds a new polygonal boundary to a polyshape and returns the combined shape.
boundingboxSmallest axis-aligned rectangle that contains a polyshape.
centroidCenter of mass of a polyshape, treated as a uniform plate.
holesReturns the holes of a polyshape as an array of polyshape objects.
inpolygonTests which points lie inside or on the edge of a polygon.
isholeTells which boundaries of a polyshape are holes.
isinteriorTests whether points lie inside a polyshape.
issimplifiedTests whether a polyshape is free of self-intersections and other defects.
nearestvertexIndex of the polyshape vertex closest to each query point.
nsidedpolyCreates a regular polygon with a given number of sides, as a polyshape.
numboundariesNumber of boundaries of a polyshape, counting outer boundaries and holes.
numsidesTotal number of sides (vertices) of a polyshape.
overlapsTests whether two polyshapes share any area.
polyareaArea of a polygon given by its vertex coordinates.
polybufferGrows or shrinks a polyshape by a fixed distance.
polyshapeCreates a 2-D polygon, possibly with several regions and holes, that supports geometry queries and Boolean operations.
rectintArea of intersection between axis-aligned rectangles.
regionsSplits a polyshape into its disconnected regions.
rmboundaryRemoves selected boundaries from a polyshape.
rmholesRemoves holes from a polyshape, leaving solid regions.
rmsliversRemoves thin parts of a polyshape narrower than a given width.
rotateRotates a polyshape by an angle in degrees about a center point.
scaleScales a polyshape by a factor, about a center point.
sortboundariesReorders the boundaries of a polyshape by a chosen criterion.
sortregionsReorders the regions of a polyshape by a chosen criterion.
subtractBoolean difference of two polyshapes: the first with the second cut out.
translateShifts a polyshape by a given offset in x and y.
turningdistTurning-function distance between two polyshape boundaries.

Bounding Regions

alphaShapeCreates a bounding region around a set of 2-D or 3-D points, controlled by a radius alpha.
alphaSpectrumAlpha values at which the alpha shape changes its set of triangles or tetrahedra.
alphaTriangulationTriangles or tetrahedra that make up an alpha shape, with the point coordinates.
areaArea of a polyshape or a 2-D alpha shape (a 3-D alpha shape has volume instead).
boundaryBoundary of a set of 2-D or 3-D points, between the convex hull and a tight outline.
boundaryFacetsBoundary edges (2-D) or faces (3-D) of an alpha shape.
convhullConvex hull of a set of 2-D or 3-D points.
convhullnConvex hull of points in n dimensions, as facets of point indices.
criticalAlphaSmallest alpha at which an alpha shape meets a connectivity criterion.
inShapeTests whether points lie inside an alpha shape.
numRegionsNumber of disjoint regions of an alpha shape.
perimeterPerimeter length of a polyshape or a 2-D alpha shape.
surfaceAreaSurface area of a 3-D alpha shape.
volumeVolume enclosed by a 3-D alpha shape.

Triangulation Representation

barycentricToCartesianConverts barycentric coordinates in given triangles or tetrahedra to Cartesian coordinates.
baryToCartLegacy form of barycentricToCartesian for TriRep and DelaunayTri objects.
boundaryshapeConverts the boundary of a 2-D triangulation into a polyshape.
cartesianToBarycentricConverts Cartesian points to barycentric coordinates relative to given triangles or tetrahedra.
cartToBaryLegacy form of cartesianToBarycentric for TriRep and DelaunayTri objects.
circumcenterCircumcenters (and circumradii) of the triangles or tetrahedra in a triangulation.
circumcentersLegacy form of circumcenter for TriRep and DelaunayTri objects.
edgeAttachmentsTriangles or tetrahedra attached to given edges of a triangulation.
edgesAll edges of a triangulation, as pairs of vertex indices.
faceNormalUnit normal vector of each triangle of a triangulated surface.
faceNormalsLegacy form of faceNormal for TriRep and DelaunayTri objects.
featureEdgesSharp edges of a triangulated surface, selected by the angle between adjacent faces.
freeBoundaryBoundary facets of a triangulation: edges of a 2-D mesh or faces of a 3-D one that touch only one simplex.
incenterIncenters and inscribed-circle radii of the triangles or tetrahedra of a triangulation.
incentersLegacy form of incenter for TriRep and DelaunayTri objects.
isConnectedTests whether pairs of vertices are joined by an edge in a triangulation.
isEdgeTests whether pairs of vertices form an edge of a legacy DelaunayTri or TriRep triangulation.
nearestNeighborNearest vertex of a triangulation or alpha shape to each query point.
pointLocationFinds the triangle or tetrahedron of a triangulation that contains each query point.
stlreadReads a triangulated surface from an STL file.
stlwriteWrites a triangulation to an STL file.
tetrameshDraws a tetrahedral mesh as semi-transparent solid elements.
triangulationStores a 2-D or 3-D triangulation and answers queries about it.
trimeshPlots a triangular mesh as wireframe edges.
triplotPlots a 2-D triangulation as line edges.
TriRepLegacy triangulation representation class, replaced by triangulation.
trisurfPlots a triangular surface with shaded faces.
vertexAttachmentsLists the triangles or tetrahedra attached to given vertices.
vertexNormalUnit normal vector at the vertices of a triangulated surface.

Delaunay Triangulation

convexHullConvex hull of the points of a Delaunay triangulation, as point indices.
delaunayDelaunay triangulation of 2-D or 3-D points, as a matrix of triangle or tetrahedron indices.
delaunaynDelaunay triangulation of points in n dimensions.
DelaunayTriLegacy class that builds and stores the Delaunay triangulation of a point set.
delaunayTriangulationCreates a Delaunay triangulation object from 2-D or 3-D points.
inOutStatusFlags which triangles of a constrained Delaunay triangulation lie inside the constrained region.
isInteriorFlags the triangles of a constrained Delaunay triangulation that lie inside the constrained region.
voronoiDiagramReturns vertices and cells of the Voronoi diagram of a delaunayTriangulation.

Spatial Search

dsearchnIndex of the nearest point in a set, for each query point.
tsearchnFinds the enclosing simplex of query points in an n-D triangulation.

Voronoi Diagram

patchDraws one or more filled polygons from vertex coordinates or from faces and vertices.
voronoiComputes or plots the Voronoi diagram of 2-D points.
voronoinVoronoi vertices and cells for points in n dimensions.