rmboundary
Remove polyshape
boundary
Description
Examples
Remove Polygon Boundary
Create a polygon made up of two triangles, and then remove the triangle whose centroid is nearer to the point (4,2). You can use the sortboundaries
function to access the boundary index corresponding to the triangle closer to the reference point, which is 1 after sorting.
x1 = [0 1 2]; y1 = [0 1 0]; x2 = [2 3 4]; y2 = [1 2 1]; polyin = polyshape({x1,x2},{y1,y2}); plot(polyin)
polysort = sortboundaries(polyin,'centroid','ascend','ReferencePoint',[4 2]); polyout = rmboundary(polysort,1); plot(polyout)
Input Arguments
polyin
— Input polyshape
scalar
Input polyshape
, specified as a scalar.
Data Types: polyshape
I
— Boundary index
scalar integer | vector of integers
Boundary index, specified as a scalar integer or vector of integers. Each
element of I
corresponds to a single boundary of the
input polyshape
.
Data Types: double
| single
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
TF
— Simplify indicator
true
| false
Simplify indicator, specified as one of these values:
true
— Alter polygon vertices to produce a well-defined polygon when the input vertices produce intersections or improper nesting.false
— Do not alter input vertices regardless of intersections or improper nesting. Computing with ill-defined polygons can lead to inaccurate or unexpected results.
Data Types: logical
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
Dynamic memory allocation must be enabled for code generation.
Name-value pair must be compile time constant.
Version History
Introduced in R2017b
See Also
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
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)