convexHull
Convex hull of Delaunay triangulation
Description
Examples
Compute and plot the convex hull of a 2-D Delaunay triangulation.
Create a Delaunay triangulation from a set of 2-D points.
rng default;
x = rand([10,1]);
y = rand([10,1]);
DT = delaunayTriangulation(x,y);Compute the convex hull.
C = convexHull(DT);
Plot the triangulation and highlight the convex hull in red.
plot(DT.Points(:,1),DT.Points(:,2),".",MarkerSize=10) hold on plot(DT.Points(C,1),DT.Points(C,2),"r") hold off

Compute and plot the convex hull of a 3-D Delaunay Triangulation.
Create a Delaunay triangulation from a 3-D set of points.
rng("default");
P = rand([25,3]);
DT = delaunayTriangulation(P);Compute the convex hull and the volume bounded by the convex hull.
[C,v] = convexHull(DT);
Display the volume and plot the convex hull.
v
v = 0.3943
trisurf(C,DT.Points(:,1), ... DT.Points(:,2), ... DT.Points(:,3), ... FaceColor="cyan")

Input Arguments
Delaunay triangulation, specified as a scalar delaunayTriangulation
object.
Data Types: delaunayTriangulation
Output Arguments
Convex hull vertices, returned as a column vector or matrix of vertex IDs.
When
DTis a 2-D triangulation,Cis a column vector containing the sequence of vertex IDs around the convex hull. The vertex IDs are the row numbers of the vertices in thePointsproperty.When
DTis 3-D triangulation,Cis a 3-column matrix containing the connectivity list of triangle vertices in the convex hull.
Data Types: double
Area or volume of the convex hull, returned as a scalar.
Data Types: double
Extended Capabilities
Thread-Based Environment
Run code in the background using MATLAB® backgroundPool or accelerate code with Parallel Computing Toolbox™ ThreadPool.
Version History
Introduced in R2013aThese syntaxes using DelaunayTri objects as Delaunay
triangulation representations DT are not recommended:
C = convexHull(DT)returns the indices into the array of pointsDT.Xthat correspond to the vertices of the convex hull.[C,v] = convexHull(DT)returns the convex hull and the area or volume bounded by the convex hull.
Use delaunayTriangulation instead.
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)