stlFileChecker
Detect and list bad features of STL files
Description
Use the stlFileChecker
object to detect and list bad features in
STL files. The bad features you can detect using the stlFileChecker
object
are:
Non-manifold edges
Non-manifold vertices
Slivers
Duplicate vertices
Normal transition edges
Free triangles
T-vertices
Creation
Description
obj = stlFileChecker(
detects bad
features in the STL file specified by filename
)filename
and lists the
features in the stlFileChecker
object.
obj = stlFileChecker(
sets Input Properties using name-value
arguments. For example, filename
,Name=Value
)stlFileChecker('s.stl',ShowLog=1)
displays a
log of the bad features in file s.stl
. You can specify multiple
name-value arguments. Properties not specified retain their default values.
Input Arguments
filename
— Name of STL file
character vector | string scalar
Name of the STL file, specified as a character vector or string scalar.
Example: S = stlFileChecker('s1.stl')
Properties
Input Properties
ShowLog
— Display or hide log of bad features
1
(default) | 0
Display or hide a log of the bad features in the STL file, specified as
1
or 0
. Specify 1
to
display the log of bad features. Specify 0
to hide the log of bad
features.
Example:
ShowLog=0
Data Types: logical
MinimumSeparation
— Minimum separation between two distinct vertices
1e-6
(default) | positive scalar
Minimum separation between two distinct vertices, specified as a positive scalar
in meters. If the distance between two vertices is less than
, then the object
considers the vertices as duplicates. The smallest value that you can specify is
MinimumSeparation
2.5e-7
.
Example: MinimumSeparation=2e-6
Data Types: double
MinimumArea
— Minimum area of triangle
1e-11
(default) | positive scalar
Minimum area of a triangle, specified as a positive scalar in square meters. If
the area of a triangle is less than
, then the object considers the
triangle as a sliver. The smallest value that you can specify is
MinimumArea
2.5e-12
.
Example: MinimumArea=3e-10
Data Types: double
Derived Properties
NonManifoldEdges
— Edges shared by more than two triangles
positive scalar
This property is read-only.
Edges shared by more than two triangles, returned as a positive scalar.
Data Types: double
NonManifoldVertices
— Vertex connected to two or more surfaces
positive scalar
This property is read-only.
Vertex connected to two or more surfaces, returned as a positive scalar. A pair of triangles with a common edge belong to the same surface.
Data Types: double
Slivers
— Triangle with area less than MinimumArea
positive scalar
This property is read-only.
Triangle with area less than MinimumArea
, returned as a positive scalar.
Data Types: double
DuplicateVertices
— Vertices with separation less than MinimumSeparation
positive scalar
This property is read-only.
Vertices with separation less than MinimumSeparation
, returned as a positive scalar.
Data Types: double
NormalTransitionEdges
— Edges shared by triangles with normals in opposite directions
positive scalar
This property is read-only.
Edges shared by triangles with normals in opposite directions, returned as a positive scalar.
Data Types: double
FreeTriangles
— Triangles with no shared vertex
positive scalar
This property is read-only.
Triangles with no shared vertex, returned as a positive scalar.
Data Types: double
TVertices
— Edge connected to any point other than end point of triangle
positive scalar
This property is read-only.
Edge connected to any point other than the end point of a triangle, returned as a positive scalar.
Data Types: double
Examples
Detect and Visualize Bad Mesh Features
Use the stlFileChecker
object to detect and display bad features in an STL file.
stlFilename = 'sample_stl_file.stl';
s = stlFileChecker(stlFilename)
detected 8 non manifold edges detected 3 non manifold vertices detected 0 duplicate Vertices detected 0 Slivers detected 12 Normal Transition Edges detected 2 Free Triangles detected 9 T-Vertices detected 4 duplicate Vertices detected 0 Slivers
s = stlFileChecker with properties: FileName: 'sample_stl_file.stl' Triangulation: [162x3 triangulation] NonManifoldEdges: [8x2 double] NonManifoldVertices: [3x1 double] Slivers: [0x1 double] DuplicateVertices: [4x1 double] NormalTransitionEdges: [12x2 double] FreeTriangles: [2x1 double] TVertices: [9x1 double] ShowLog: 1 MinimumSeparation: 1.0000e-06 MinimumArea: 1.0000e-11
Visualize the non-manifold edges in the STL file.
showNonManifoldEdges(s)
Visualize the non-manifold vertices in the STL file.
figure showNonManifoldVertices(s)
Visualize the free triangles in the STL file.
figure showFreeTriangles(s)
Detect and Visualize T-Vertices
Detect and visualize the T-vertices in an STL file.
s = stlFileChecker('sample_file.stl',ShowLog=0);
Visualize the T-vertices in the STL file.
showTVertices(s)
More About
STL File
An STL file describes the surface geometry of a three-dimensional object as a mesh of triangles. The three elements of a triangle are: edge, vertices, and face. This table shows the bad features in an STL file.
STL Bad Features
Non-manifold edge
| Non-manifold vertex
| Sliver
| Duplicate vertices
|
Normal transition edge
| Free triangle
| T-vertex
|
Version History
Introduced in R2021b
See Also
Apri esempio
Si dispone di una versione modificata di questo esempio. Desideri aprire questo esempio con le tue modifiche?
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
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)