Syntax
[SFL,VIL,n]=VLFLsurface(VL,FL,V)
Input Parameter
VL : | | Complete vertex list |
FL : | | Complete facet list |
V : | | One vertex that is part of the surface v is element of VL |
Output Parameter
SFL : | | Surface facet list |
VIL : | | Vertex index list |
n : | | Number of vertices of the surface |
Examples
Processing a STL object;
[VL,FL]=VLFLreadSTL ('TEST-BIN3'); VLFLplot (VL,FL);
[SFL,VIL,n]=VLFLsurface (VL,FL,5)
Copyright 2012-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This algorithm identifies all vertices and facets that belong to the same surface in a 3D mesh, given a starting vertex.
Input Parameters
- VL: Complete vertex list. A matrix where each row represents a vertex in 3D space.
- FL: Complete facet list. A matrix where each row represents a facet, defined by indices of vertices in VL.
- V: A vertex that is part of the surface. It can be a vector representing the vertex coordinates or an index of VL.
Output Results
- SFL: Surface facet list. A list of facets that form the surface containing the vertex V.
- VIL: Vertex index list. A list of indices of vertices that form the surface.
- n: Number of vertices of the surface.
Algorithm Steps
- Check if V is a vector or an index:
- If V is a vector, find its index in VL using
ismember
. If not found, throw an error.
- If V is an index, use it directly as the starting vertex index list (VIL).
- Initialize
n
to 0.
- Iterate while the size of VIL changes:
- Update
n
to the current size of VIL.
- Identify facets in FL that contain any vertex in VIL using
ismember
and update SFL.
- Extract unique vertex indices from SFL to update VIL.
- Remove any zero entries from VIL.
- Ensure SFL contains unique rows and remove any zero entries.
Algorithm explaination created using ChatGPT on 2025-08-19 07:54. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21