SGof2Dfunc

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SG/Solids
Introduced first in SolidGeometry 5.4, Creation date: 2023-10-14, Last change: 2025-09-15

creates a surface or a solid of a 1D or 2D fnct



See Also: SGofGeoTIFF , SGofSurface , VLwarpgrid , FLofVLmeshgrid

Example Illustration

 missing image of SGof2Dfunc(ff,ax,res,D)

Syntax

SG=SGof2Dfunc([ff,ax,res,D])

Input Parameter

ff: handle to the function; default is @sin
ax: axis [xmin xmax ymin ymax]; default is [-10 10 -10 10]
res: step size; default is max(dy,dy)/99;
D: Socket height; default is '' ==> only surface

Output Parameter

SG: Solid Geometry

Examples


SGof2Dfunc(@cos,[-pi 2*pi -pi 3*pi],.1); SG=ans; % creates just the surface without thickness
SGofSurface(SG.VL,SG.FL,0.5) % creates a solid from the surface

SGof2Dfunc(@cos,[-pi 2*pi -pi 3*pi],.1,0) % creates a solid with no socket
SGof2Dfunc(@cos,[-pi 2*pi -pi 3*pi],.1,1) % creates a solid plus socket

zzz=@(x,y) x+y
SGof2Dfunc(zzz,[-pi 2*pi -pi 3*pi],.1,1) % creates a solid plus socket
SGof2Dfunc(str2func('@(x,y)x*x-y*y'),[-1 1 -1 1],.1,1) ;SS=ans; % creates a solid plus socket
view(0,90); viewsmooth(-30,30,200)

SGof2Dfunc(str2func('@(x,y)x*x-y*y'),[-1 1 -1 1],.01) ;SS=ans;
SGofSurface(SS,'',.3)




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