Syntax
CVL=CVLofVLCIL(VL,CIL)
Input Parameter
VL : | | Point or Vertex list |
CIL : | | [startindex endindex; startindex endindex; ] |
Output Parameter
CVL : | | CLosed Polygon List or Closed Vertex List |
Examples
VL=rand(6,3)
CVLofVLCIL(VL,[1 3;4 6])
Copyright 2017-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 function, CVLofVLCIL, is designed to generate a Closed Vertex List (CVL) from a given Vertex List (VL) and a Contour Index List (CIL). The function is part of the SolidGeometry library and was introduced in version 3.9.
Input Parameters
- VL: A matrix representing a list of points or vertices. Each row corresponds to a vertex, and each column corresponds to a coordinate dimension (e.g., x, y, z).
- CIL: A matrix where each row contains two indices, [startindex endindex]. These indices specify the start and end of a segment in the VL that should be included in the CVL.
Output
- CVL: A matrix representing a Closed Polygon List or Closed Vertex List. It is constructed by concatenating segments of the VL as specified by the CIL.
Algorithm Steps
- Initialize the CVL matrix with NaN values. The size of CVL is determined by the number of vertices in VL plus the number of segments in CIL, and it has the same number of columns as VL.
- Initialize a counter variable, k, to zero. This variable keeps track of the current position in the CVL matrix.
- Iterate over each row in the CIL matrix:
- For each row, calculate the number of vertices, ni, in the current segment by subtracting the start index from the end index and adding one.
- Copy the segment of vertices from VL, specified by the current row of CIL, into the CVL matrix starting at position k+1.
- Update the counter k by adding ni plus one to account for the next segment's starting position.
- After the loop, trim the CVL matrix to remove any trailing NaN values by keeping only the rows up to k-1.
- If no output argument is specified (nargout==0), plot the CVL using the CVLplot function with a magenta color and a line width of 2.
Algorithm explaination created using ChatGPT on 2025-08-18 23:32. (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