SGofSurface

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SG/Solids
Introduced first in SolidGeometry 2.4, Creation date: 2015-07-30, Last change: 2025-09-14

returns a fitting solid relativ to a surface

Description

Fast and stable function even for large data sets.
This function supports also facets list of type cell: {FL1,FL2,FL3}.
It also supports facets list separated by NaN: [FL1;NaN NaN NaN;FL2]
For planar ring, touch the crossing surface

See Also: VLtransN , VLFLvertexNormal

Example Illustration

 missing image of SGofSurface(OVL,OFL,t,d,s,cn)

Syntax

[SG,VL1,VL2,FLW]=SGofSurface(OVL,OFL,[t,d,s,cn])

Input Parameter

OVL: Vertex list of a surface (nx3)
OFL: Facet list of a surface (nx3)
t: thickness of the solid; default is 0.5
d: distance from the surface; default is 0.3
s: streching of the border line; default is 0
cn: false=matlab vertex calc; true=corrected vertex normal; default is false; true is 10 times slower -> VLFLvertexNormal

Output Parameter

SG: resulting solid that can be attached to the surface
VL1: VL oved along d
VL2: VL moved d*ez
FLW: Facet of list wall [VL1;VL2]

Examples

Surface clouds to solid geometries
loadweb 'AAruffo_surf.mat'
SGofSurface(SG1.VL,SG1.FL,-5,0); A=ans
SGpuzzlecut3D(A); X=ans;
SGboxpacking(X,[],[500 500 500])
%% See the result of different vertex normal vectors
[VL,FL]=VLFLsample(18); SGofSurface(VL,FL,1,0,0,false)
[VL,FL]=VLFLsample(18); SGofSurface(VL,FL,1,0,0,true)




Copyright 2015-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

Last html export of this page out of FM database by TL: 2025-09-21