SGisOnsurface

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Geometric Queries
Introduced first in SolidGeometry 4.9, Creation date: 2020-01-11, Last change: 2025-09-14

returns whether a point is on a surface

Description

Based on isonVLFL


See Also: SGisInterior , isonVLFLsurface , isonVLFL , VLisInteriorofBBlist

Example Illustration

 missing image of SGisOnsurface(SG,VL);

Syntax

vi=SGisOnsurface(SG,VL);

Input Parameter

SG: Solid Geometry
VL: Vertex list to test

Output Parameter

vi: On Surface Index of VL

Examples


A=SGbool('-',SGbox([30,20,10]),SGbox([26,16,6]));
SGisOnsurface(A,0.5*(A.VL+circshift(A.VL,1)))
isonVLFL(A.VL,A.FL,0.5*(A.VL+circshift(A.VL,3)))
isonVLFL(A.VL,A.FL,0.5*(A.VL+circshift(A.VL,3)))




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, SGisOnsurface, determines whether points in a vertex list (VL) are on the surface of a given solid geometry (SG).

Input Parameters

Output

Algorithm Steps

  1. The function begins by ensuring that the input SG is in the correct format using SGofSG(SG). This likely standardizes or validates the solid geometry structure.
  2. The core operation is performed by calling isonVLFL(SG.VL, SG.FL, VL). This function checks which vertices in VL are on the surface defined by the vertex list SG.VL and face list SG.FL. The result is stored in vi.
  3. If no output is requested (i.e., nargout == 0), the function proceeds to visualize the results:
  4. If no output is requested again, it creates another figure with a top-down view using view(0,90):

Example Usage

An example is provided where a boolean operation is performed on two boxes, and the resulting geometry is tested to find which vertices are on the surface.

Algorithm explaination created using ChatGPT on 2025-08-19 00:34. (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