Syntax
[p,v,vi,f,fi,haxis]=SGselect3d([SG,tx])
Input Parameter
SG : | | Solid geometry; if empty gca is used |
tx : | | optional menue header |
Output Parameter
p : | | point |
v : | | vertex |
vi : | | vertex index |
f : | | facet |
fi : | | facet index |
haxis : | | gca |
Examples
SGselect3d(SGsample(25),'test')
SGselect3d(SGofSG(SG)), TofPcam(ans)
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, SGselect3d
, is designed for interactive selection of a point, vertex, or facet in a 3D axis. It is part of the SolidGeometry library and was introduced in version 4.4.
Input Parameters
- SG: Solid geometry object. If this parameter is empty, the current axis (gca) is used.
- tx: An optional menu header text.
Output Results
- p: The selected point.
- v: The selected vertex.
- vi: The index of the selected vertex.
- f: The selected facet.
- fi: The index of the selected facet.
- haxis: The handle to the current axis (gca).
Algorithm Steps
- Retrieve the solid geometry (SG) and optional text (tx) from the input parameters using
getfuncparams
.
- If SG is not empty, create a new figure using
SGfigure
, plot the solid geometry with SGplot
in green, and set the view to a specific angle (-30, 30).
- Display a help text using
SGhelptext
to guide the user through rotating the view and selecting a point or facet.
- Pause the execution to allow user interaction.
- Display another help text to prompt the user to select a point or facet.
- Enable camera lighting with
camlightTL
.
- Wait for a mouse input using
ginput(1)
and then call select3d
to get the selected point, vertex, vertex index, facet, facet index, and axis handle.
- Clear the help text and adjust the axis position to fill the figure window.
- If no output arguments are specified, plot the selected facet and vertex using
VLFLplot
and VLplot
, and enable 3D rotation with rotate3d on
.
Algorithm explaination created using ChatGPT on 2025-08-19 06:57. (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