Syntax
fi=FLselect3Dginput(VL,FL,[singlef])
Input Parameter
VL : | | Vertex List |
FL : | | Facet list |
singlef : | | if true; only one facet is returned instead of all; default is true |
Output Parameter
fi : | | list of facets that belong to the mouse click |
Copyright 2020-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, FLselect3Dginput
, is designed to select a point in the current axes and find the corresponding facets on a 3D surface. It is part of the SolidGeometry library and was introduced in version 4.9. The function is primarily used for user interaction with 3D plots.
Input Parameters
- VL: Vertex List - A list of vertices that define the 3D object.
- FL: Facet List - A list of facets (triangles) that make up the surface of the 3D object.
- singlef: A boolean parameter that determines if only one facet should be returned. The default value is
true
.
Output Results
- fi: A list of facets that correspond to the mouse click position.
Algorithm Steps
- Retrieve input parameters using
getfuncparams
function. If no arguments are provided, VL
is set using SGofgca
.
- Check if
VL
is a SolidGeometry object using isSG
. If true, extract FL
and VL
from the object.
- If a shape parameter
sh
is provided, plot the vertices and facets using VLFLplotalpha
.
- Enable 3D rotation on the plot and display an annotation instructing the user to rotate the solid and press "Enter" to select a facet.
- Pause execution to allow user interaction, then delete the annotation and disable rotation.
- Capture a mouse click using
ginput
and select the 3D point using select3d
.
- If a valid point is selected, find the nearest facet using
FLofVLFLnearestneighborVL
and store the result in fi
.
- If
singlef
is true and fi
is not empty, return only the first facet.
- If no output is expected, plot the selected facet in green using
VLFLplotalpha
.
Algorithm explaination created using ChatGPT on 2025-08-19 01:44. (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