cellEdges
Find edges attached to specified cells
Description
Examples
Edges Attached to Specified Cells
Find edges attached to two middle cylinders in a geometry consisting of four stacked cylinders.
Create a geometry that consists of four stacked cylinders.
gm = multicylinder(5,[1 2 3 4],'ZOffset',[0 1 3 6])
gm = DiscreteGeometry with properties: NumCells: 4 NumFaces: 9 NumEdges: 5 NumVertices: 5 Vertices: [5x3 double]
Plot the geometry with the cell and edge labels.
pdegplot(gm,'CellLabels','on','EdgeLabels','on','FaceAlpha',0.2)
Find edges attached to cells 2 and 3.
edgeIDs = cellEdges(gm,[2 3])
edgeIDs = 1×3
2 3 4
Cell Edges Attached to Internal and External Faces
Find edges attached to the outer cuboid in a geometry consisting of two nested cuboids.
Create a geometry that consists of two nested cuboids of the same height.
gm = multicuboid([2 5],[4 10],3)
gm = DiscreteGeometry with properties: NumCells: 2 NumFaces: 12 NumEdges: 24 NumVertices: 16 Vertices: [16x3 double]
Plot the geometry with the cell labels.
pdegplot(gm,'CellLabels','on','FaceAlpha',0.2)
Find all edges attached to the outer cell. Show the first 10 edges.
edgeIDs = cellEdges(gm,2); edgeIDs(1:10)
ans = 1×10
1 2 3 4 5 6 7 8 9 10
From all edges attached to the outer cell, return the edges attached to only the internal faces. Internal faces are faces shared between multiple cells.
edgeIDs_int = cellEdges(gm,2,'internal')
edgeIDs_int = 1×4
9 10 11 12
From all edges attached to the outer cell, return the edges attached to the external faces. Show the first 10 edges.
edgeIDs_ext = cellEdges(gm,2,'external');
edgeIDs_ext(1:10)
ans = 1×10
1 2 3 4 5 6 7 8 13 14
Input Arguments
g
— 3-D geometry
DiscreteGeometry
object
3-D geometry, specified as a DiscreteGeometry
object.
RegionID
— Cell ID
positive number | vector of positive numbers
Cell ID, specified as a positive number or a vector of positive numbers. Each number represents a cell ID.
FilterType
— Type of edges to return
'all'
(default) | 'internal'
| 'external'
Type of edges to return, specified as 'internal'
,
'external'
, or 'all'
. Depending on this
argument, cellEdges
returns these types of faces:
'internal'
— Edges attached to only internal faces. Internal faces are faces shared between multiple cells.'external'
— Edges attached to only external faces. External faces are faces not shared between multiple cells.'all'
— All edges attached to the specified cells.
Output Arguments
EdgeID
— IDs of edges attached to specified cells
positive number | vector of positive numbers
IDs of edges attached to the specified cells, returned as a positive number or a vector of positive numbers.
Version History
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)