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
See Also: SGofGeoTIFF
, SGofSurface
, VLwarpgrid
, FLofVLmeshgrid
SG=SGof2Dfunc([ff,ax,res,D])
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 |
SG: | Solid Geometry |
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)