Syntax
h=VLFLplotfacets(VL,FL)
Input Parameter
VL : | | Vertex list or SG |
FL : | | Facet list |
Output Parameter
h : | | handle list of all facets |
Examples
loadweb JACO_robot.mat
SGfigure; VLFLplotfacets(JCF)
setplotlight(h,'w',0.4)
Copyright 2018-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, VLFLplotfacets
, is designed to plot a list of facets as separate independent facets. It is part of the SolidGeometry library and was introduced in version 4.2. The function takes two main input parameters and returns a handle list of all facets.
Input Parameters
- VL: This is the vertex list or an SG (SolidGeometry) object. If it is an SG object, the function will extract the vertex and facet lists from it.
- FL: This is the facet list, which contains indices of vertices that form each facet.
Output
- h: A handle list of all facets plotted. Each handle corresponds to a plotted facet.
Algorithm Steps
- Set a variable
nu
to 500, which is used to control the frequency of updates to the plot.
- Check if
VL
is an SG object using the isSG
function. If true, extract the vertex list VL
and facet list FL
using VLFLofSG
.
- Determine the number of facets
nf
by getting the number of rows in FL
.
- Initialize a zero vector
h
of size nf
to store handles for each facet.
- Start a timer using
tic
to measure the execution time of the plotting loop.
- Loop over each facet from 1 to
nf
:
- Extract the vertices for the current facet using the indices in
FL(i,:)
.
- Define a vector
b
as [1 2 3]
, representing the order of vertices for plotting.
- Use the
trisurf
function to plot the current facet and store the handle in h(i)
.
- If the current index
i
is a multiple of nu
, update the plot using drawnow
.
- End the timer with
toc
to display the elapsed time for plotting.
Algorithm explaination created using ChatGPT on 2025-08-18 22:56. (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