pofselect3D

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - User interface
Introduced first in SolidGeometry 5.0, Creation date: 2020-12-29, Last change: 2025-09-15

returns touch point, solid, handle normal vector etc.



See Also: SGprofiledepthdimension

Example Illustration

 missing image of pofselect3D(obj)

Syntax

[p,SG,ef,ec]=pofselect3D([obj])

Input Parameter

obj: graphics object; default is gca

Output Parameter

p: touched point
SG: touched graphics object
ef: normal vector of facet
ec: normal vector to camera




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)

The function pofselect3D is designed to interact with 3D graphics objects in a MATLAB environment, specifically for selecting and analyzing touch points on these objects. Below is a detailed explanation of the algorithm and its parameters.

Input Parameters

Output Results

Algorithm Steps

  1. The function begins by determining the input parameter obj using getfuncparams. If no object is specified, it defaults to the current object (gco).
  2. It checks if the object is a Solid Geometry (SG) object using isSG. If true, it retrieves the SG object and its transformation matrix, then extracts the position p and returns.
  3. If obj is a character string, the function exits early.
  4. The function then calls select3d to get the touch point p, along with other parameters b, c, d, fi, and hp.
  5. It retrieves the SG object associated with the handle hp using SGofgo and SGofSG.
  6. The normal vector of the facet ef is calculated using VLFLnormf with the vertex list VL and facet list FL of the SG object.
  7. The camera's transformation matrix T is obtained using Tofcam, and the camera normal vector ec is derived from it.
  8. If no output arguments are specified, the function visualizes the normal vectors using lplot and enables 3D rotation with rotate3d on.
Algorithm explaination created using ChatGPT on 2025-08-19 00: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