Syntax
textVLEL(VL,EL,[c,s,nt,lb])
Input Parameter
VL : | | Vertex list |
EL : | | Edge list |
c : | | color |
s : | | thickness |
nt : | | optional selector |
lb : | | descirptor letter; default is 'E' |
Examples
PL=PLcircle(10); EL=ELofn(PL); SGfigure; CPLplot(PL);
textVLEL(PL,EL)
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)
The function textVLEL
is designed to plot descriptors for each edge of an edge list. It is part of the SolidGeometry library and was introduced by Tim Lueth. The function takes several input parameters and uses them to annotate edges in a 3D plot.
Input Parameters
- VL: Vertex list, a matrix where each row represents a vertex in 2D or 3D space.
- EL: Edge list, a matrix where each row represents an edge by specifying two vertex indices.
- c: Color of the text, default is 'k' (black).
- s: Thickness or font size of the text, default is 10.
- nt: Optional selector, default is all vertices.
- lb: Descriptor letter, default is 'E'.
Algorithm Steps
- Initialize default values for optional parameters
c
, s
, nt
, and lb
if they are not provided.
- Check if the vertex list
VL
is 2D. If so, add a zero column to make it 3D.
- Determine the number of edges
n
from the edge list EL
. If n
is greater than 99, exit the function.
- Initialize an array
h
to store text handles.
- Iterate over each edge in
EL
:
- Calculate the center point
cf
of the edge by averaging the coordinates of its two vertices.
- Use the
text
function to plot the descriptor at the center point cf
, using the format '%s%i'
where %s
is the descriptor letter and %i
is the edge index.
- If a color is specified, set the text color using
set(h,'Color',c)
.
- If a font size is specified, set the text size using
set(h,'FontSize',s)
.
The function returns the handles h
to the text objects created.
Algorithm explaination created using ChatGPT on 2025-08-19 01:08. (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