crop
Syntax
Description
Examples
Crop Surface Mesh Using a Bounding Box
Read a surface mesh from a PLY file into the workspace.
fileName = fullfile(toolboxdir("lidar"),"lidardata", ... "surfaceMesh","sphere.ply"); sphereMesh = readSurfaceMesh(fileName);
Display the surface mesh.
removeDefects(sphereMesh,"unreferenced-vertices") surfaceMeshShow(sphereMesh,Title="Original Mesh")
Define a bounding box to crop the sphere mesh to its lower half.
bbox3d = [-1 1 -1 1 -1 0]; crop(sphereMesh,bbox3d)
Display the cropped mesh.
removeDefects(sphereMesh,"unreferenced-vertices") surfaceMeshShow(sphereMesh, Title="Cropped mesh")
Input Arguments
mesh
— Surface mesh
surfaceMesh
object
Surface mesh, specified as a surfaceMesh
object.
bbox
— 3-D bounding box dimensions
six-element vector
3-D bounding box dimensions, specified as a six-element vector. The vector is of the form [minX maxX minY maxY minZ maxZ], specifying the minimum and maximum limits of the box along the x-,y-, z-directions.
Version History
Introduced in R2022b
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.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- 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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)