Last change of this documentation page: 2022-06-02 of SolidGeometry 4.3
SGboolh(flag,A,B);- returns boolean operations on solid geometries using a heuristic

SGboolh(flag,A,B);% SGboolh(flag,A,B); - returns boolean operations on solid geometries using a heuristic
% (by Tim Lueth, VLFL-Lib, 2018-NOV-06 as class: SURFACES)
%
% without any change of SGbool/SGbool5 (Aug 2017) this fnctn returns
% quite useful results by avoiding numerical instabilities. (Status of:
% 2018-11-07)
%
% Introduced first in SolidGeometry 4.3
%
% See also: CSGsample, SGbool
%
% C=SGboolh(flag,A,B);
% === INPUT PARAMETERS ===
% flag: '+', 'x', 'A' ,'B'
% A: Solid A
% B: Solid B
% === OUTPUT RESULTS ======
% C: result of boolean operation
%
% EXAMPLE:
% testfunctTL('[A,B]=CSGsample(#2); SGboolh(#1,A,B);','+xAB',1:10)
% n=14; [A,B]=CSGsample(n); CSGsample(n)
% SGboolh('+',A,B); SGcheckmeshlab(ans);
% SGboolh('-',A,B); SGcheckmeshlab(ans);
% SGboolh('A',A,B); SGcheckmeshlab(ans);
% SGboolh('B',A,B); SGcheckmeshlab(ans);
%
% See also: CSGsample, SGbool
%
%
% Copyright 2018 Tim C. Lueth

SGcutTCPL(SG,To,CPL)- punching: shoots a contour through a solid - same as SGcutTCPLthrough

SGcutTCPL(SG,To,CPL)% SGcutTCPL(SG,To,CPL) - punching: shoots a contour through a solid - same as SGcutTCPLthrough
% (by Tim Lueth, VLFL-Lib, 2018-NOV-06 as class: SURFACES)
%
% =======================================================================
% OBSOLETE (2020-08-23) - USE 'SGpunchTCPLthrough
% ' INSTEAD
% =======================================================================
%
% This fnctns works only for correct boolean merged solids! No open
% boundaries et al. (Status of: 2020-01-09)
%
% Introduced first in SolidGeometry 4.3
%
% See also: [ SGpunchTCPLthrough
% ] ; SGcutT, BBofSGcutT, SGcut, SGcut2, SGcutBB, SGcutTd,
% SGpunchTCPLfirstwall, SGpunchTCPLthrough, SGpunchhollowsolid
%
% [C,Ts,succ]=SGcutTCPL([SG,To,CPL])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% To: Optional T frame
% CPL: Closed Polygon Line
% === OUTPUT RESULTS ======
% C: Resulting Solid
% Ts: Frame for cutting in c direction
% succ: flag for success
%
% EXAMPLE:
% SGcutTCPL(SGsample(25),TofP([-4 -6 0]),[PLcircle(1,8);nan nan;PLcircle(0.5)])
% SGcutTCPL(SGsample(25),'',[PLcircle(1,8);nan nan;PLcircle(0.5)])
%
% See also: [ SGpunchTCPLthrough
% ] ; SGcutT, BBofSGcutT, SGcut, SGcut2, SGcutBB, SGcutTd,
% SGpunchTCPLfirstwall, SGpunchTCPLthrough, SGpunchhollowsolid
%
%
% Copyright 2018-2020 Tim C. Lueth

CPLsweep(CPL,wt,cp,gw)- returns a swept contour

CPLsweep(CPL,wt,cp,gw)% CPLsweep(CPL,wt,cp,gw) - returns a swept contour
% (by Tim Lueth, VLFL-Lib, 2018-NOV-05 as class: CLOSED POLYGON LISTS)
%
% Contour required for creating revolute joints.
% Tricky fnctn that rotates edges (Status of: 2019-03-30)
%
% Introduced first in SolidGeometry 4.3
%
% See also: CPLconvexhull
%
% CPLN=CPLsweep(CPL,[wt,cp,gw])
% === INPUT PARAMETERS ===
% CPL: Closed polygon line
% wt: angle w or [wmin wmax]; default is p/20
% cp: center point for rotation; default is 0
% gw: increase decrease contour; default is 0
% === OUTPUT RESULTS ======
% CPLN: Final contour
%
% EXAMPLE:
% CPLsweep(CPLsample(14),[-pi/50 pi/4]);
% CPLsweep(CPLsample(14),[-pi/50 pi/4],[15 0]);
% CPLsweep(CPLsample(14),[-pi/50 pi/4],[0 15]);
%
% See also: CPLconvexhull
%
%
% Copyright 2018-2021 Tim C. Lueth

BBofSGcutT(SGx,Tx,z,d,ct)- returns the bounding box for a cutting frame

BBofSGcutT(SGx,Tx,z,d,ct)% BBofSGcutT(SGx,Tx,z,d,ct) - returns the bounding box for a cutting frame
% (by Tim Lueth, VLFL-Lib, 2018-NOV-05 as class: SURFACES)
%
% helpful and used in many cutting fnctn such as SGcutTcrossblade (Status
% of: 2020-01-13)
%
% Introduced first in SolidGeometry 4.3
%
% See also: BBui, SGcutT, TofPcam, SGcut, SGcut2, SGcutBB, SGcutT
%
% [BB,Ts,Tc,SGC,aew]=BBofSGcutT([SGx,Tx,z,d,ct])
% === INPUT PARAMETERS ===
% SGx: Solid Geoemtry
% Tx: Cutting frame (cuts above z==0)
% z: size [-z/2 +z/2] or [zmin zmax]
% d: displacement to add to x and y values of BB; z unchanged
% ct: default is '-a' in interactive mode
% === OUTPUT RESULTS ======
% BB: Bounding box size
% Ts: Cutting frame (if interactively used) on surface
% Tc: Cutting Frame in center point
% SGC: Cutted Solid Geometry of [zmin zmax]
% aew: view angle in interactive mode
%
% EXAMPLE:
% loadweb JACO_robot.mat
% BBofSGcutT(JC0,eye(4),10);
% BBofSGcutT(JC0,eye(4));
% BBofSGcutT(JC0);
% BBofSGcutT;
%
% See also: BBui, SGcutT, TofPcam, SGcut, SGcut2, SGcutBB, SGcutT
%
%
% Copyright 2018-2022 Tim C. Lueth

SGcutend(SG,ez,d,expl);- returns a cutted object that is cuttet related to the BB

SGcutend(SG,ez,d,expl);% SGcutend(SG,ez,d,expl); - returns a cutted object that is cuttet related to the BB
% (by Tim Lueth, VLFL-Lib, 2018-NOV-04 as class: SURFACES)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGcutT, SGcutBB, SGcut
%
% [A,B,T]=SGcutend([SG,ez,d,expl]);
% === INPUT PARAMETERS ===
% SG: SG if empty, SGofgca
% ez: string as 'top,'bottom','behind','left',right','infront', 'x+',
% 'x-, 'y+', 'y-', 'z+', 'z-',
% d: distance from outside border
% expl: explosition distance; Parts are separated; default is 0;
% === OUTPUT RESULTS ======
% A: remaining solid (magenta)
% B: removed solid (white)
% T: Transformation matrix used
%
% EXAMPLE:
% loadweb JACO_robot.mat
% SGcutend(JCF,'top',10,10)
%
% See also: SGcutT, SGcutBB, SGcut
%
%
% Copyright 2018-2020 Tim C. Lueth

CPLconvexhull(CPL)- returns the convex hull for a CPL

CPLconvexhull(CPL)% CPLconvexhull(CPL) - returns the convex hull for a CPL
% (by Tim Lueth, VLFL-Lib, 2018-NOV-03 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.3
%
% See also: delaunayofCPL, CPLconvexhulldelaunay
%
% CPLN=CPLconvexhull(CPL)
% === INPUT PARAMETERS ===
% CPL: CPL
% === OUTPUT RESULTS ======
% CPLN: convex hull
%
% EXAMPLE:
% CPLconvexhull(PLstar(10))
% CPLconvexhull(CPLsample(14))
% delaunayofCPL(CPLsample(14))
%
%
% See also: delaunayofCPL, CPLconvexhulldelaunay
%
%
% Copyright 2018-2020 Tim C. Lueth

SGsurfaceselect(SG,fi,vi)- returns an isolated surface from a solid or SGofgca

SGsurfaceselect(SG,fi,vi)% SGsurfaceselect(SG,fi,vi) - returns an isolated surface from a solid or SGofgca
% (by Tim Lueth, VLFL-Lib, 2018-NOV-03 as class: SURFACES)
%
% DOES NOT WORK WITH NON MANIFOLD VERTICES - SGchecknonmanifoldvertices
% (Status of: 2018-11-03)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGsurface
%
% [SGI,SG,SIL,nfi]=SGsurfaceselect([SG,fi,vi])
% === INPUT PARAMETERS ===
% SG: Solid geometry or empty for gca
% fi: facet index
% vi: vertex index
% === OUTPUT RESULTS ======
% SGI: Selected closed surface
% SG: SG with reordered facet list
% SIL: Surface index list for all surfaces
% nfi: facet index with respect to
%
% EXAMPLE:
% SGfigure; SGplot(JCF); SGsurfaceselect
% SGsurfaceselect(JCF,[2803 2865 2870])
% SGsurfaceselect(JCF,1000)
% SGsurfaceselect(JCF,'',2803)
%
% See also: SGsurface
%
%
% Copyright 2018 Tim C. Lueth

CPLbufferEdges(CPL,r,t)- returns contours with broken our rounded edges;

CPLbufferEdges(CPL,r,t)% CPLbufferEdges(CPL,r,t) - returns contours with broken our rounded edges;
% (by Tim Lueth, VLFL-Lib, 2018-NOV-03 as class: CLOSED POLYGON LISTS)
%
% ATTENTION = 'round' creates too many points wrt 3D printing
% This fnctn based on CPLbuffer / polybuffer(polyshape)
% Square doubles the numver of points; round at least triples the number
% of points (Status of: 2018-11-03)
%
% Introduced first in SolidGeometry 4.3
%
% See also: CPLradialEdges
%
% CPLN=CPLbufferEdges(CPL,[r,t])
% === INPUT PARAMETERS ===
% CPL: Closed Polygon Line
% r: radius; default is 0.3
% t: 'square', 'round'
% === OUTPUT RESULTS ======
% CPLN:
%
% EXAMPLE:
% CPLbufferEdges([PLgearDIN(1,9);nan nan;PLcircle(.5)],.3,'round')
% CPLbufferEdges([PLgearDIN(1,9);nan nan;PLcircle(.5)],.3,'square')
%
% See also: CPLradialEdges
%
%
% Copyright 2018 Tim C. Lueth

SGhelptext(helpstr,cname)- Writes a text annotation box on top of the current axis

SGhelptext(helpstr,cname)% SGhelptext(helpstr,cname) - Writes a text annotation box on top of the current axis
% (by Tim Lueth, VLFL-Lib, 2018-NOV-02 as class: USER INTERFACE)
%
% This fnctn was already part of several interactive fnctn and is now
% just a independent fnctn (Status of: 2018-11-02)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGfigure, rotate3d, ginput, select3d
%
% h=SGhelptext(helpstr,[cname])
% === INPUT PARAMETERS ===
% helpstr: help string (yellow)
% cname: caller string (red)
% === OUTPUT RESULTS ======
% h: handle to text annotation
%
% EXAMPLE:
% SGhelptext('Rotate and Press Enter','Solid Geometry Modeler'); a=ans
% SGhelptext('','');
%
% See also: SGfigure, rotate3d, ginput, select3d
%
%
% Copyright 2018 Tim C. Lueth

TofPcam(p,r,cp)- returns a transformation matrix using a vertex and a the current camera view

TofPcam(p,r,cp)% TofPcam(p,r,cp) - returns a transformation matrix using a vertex and a the current camera view
% (by Tim Lueth, VLFL-Lib, 2018-NOV-02 as class: ANALYTICAL GEOMETRY)
%
% This fnctn is used to create interactively transformation matrices
% ez = view direction
% ey = cup of view
% ex= ez cross ey
% t = p;
% SG-Lib 5.0 support mouse click selection (Status of: 2020-10-03)
%
% Introduced first in SolidGeometry 4.3
%
% See also: Tofgca, Tofcam, camplot, camset, Tofgca, Tofcam, tcamera,
% camofT
%
% [T,vi,fi,aew]=TofPcam([p,r,cp])
% === INPUT PARAMETERS ===
% p: 3D coordinate in the current view OR handle of a graphics object;
% default is gca
% r: 'a', 'c', 's' 'm' as axial coral or sagittal point; default is
% 'm'ouse
% cp: if true; cross section center; if false or numeric; surface plus
% value
% === OUTPUT RESULTS ======
% T: HT matrix with ez = view direction and ey = cup of view
% vi: index of nearest vertex
% fi: index of touched facet
% aew: [view(1) view(2)] to restore camera view later
%
% EXAMPLE:
% SGfigure(SGbox([30,20,10]));
% shg; rotate3d on; pause; ginput(1); p=select3d; TofPcam(p), rotate3d on
% cla; SGplotalpha(SG); TofPcam('','m'); % select z-axis (coronal, axial sagittal by mouse)
% cla; SGplotalpha(SG); TofPcam('','m',-10); % select z-axis (coronal, axial sagittal by mouse)
%
%
% See also: Tofgca, Tofcam, camplot, camset, Tofgca, Tofcam, tcamera,
% camofT
%
%
% Copyright 2018-2020 Tim C. Lueth

exp_2018_11_02_bladecut(B)- EXPERIMENT SGpunchblade

exp_2018_11_02_bladecut(B)% exp_2018_11_02_bladecut(B) - EXPERIMENT SGpunchblade
% (by Tim Lueth, VLFL-Lib, 2018-NOV-02 as class: MODELING PROCEDURES)
%
% Shows how to separate a solid by a blade cut into several pieces.
% In this case as puzzle cut, the Fischertechnik contour was used (Status
% of: 2020-01-21)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGbladeofPL, SGbladeofCVL
%
% exp_2018_11_02_bladecut([B])
% === INPUT PARAMETERS ===
% B: Solid to be cut interactively
%
% EXAMPLE:
% exp_2018_11_02_bladecut(SGsample(25))
%
% See also: SGbladeofPL, SGbladeofCVL
%
%
% Copyright 2018-2020 Tim C. Lueth

SGfischertechniksample(name)- returns SG for some Fischertechnik samples

SGfischertechniksample(name)% SGfischertechniksample(name) - returns SG for some Fischertechnik samples
% (by Tim Lueth, VLFL-Lib, 2018-NOV-02 as class: MODELING PROCEDURES)
%
% This is not to replace Fischertechnik elements. It is much cheaper to
% buy them from Fischertechnik. It is more an example how to integrate
% Fischertechnik compatible contours and elements into other mechanisms.
% (Status of: 2018-11-02)
%
% Introduced first in SolidGeometry 4.3
%
% See also: CPLsample, SGsample, VLsample, PLsample, VLFLsample,
% CSGsample, SGerrorsample, SGcmdsample, testfunctTL, permutevector
%
% SG=SGfischertechniksample([name])
% === INPUT PARAMETERS ===
% name: name of a solid or just empty to see all supported ones
% === OUTPUT RESULTS ======
% SG: Solid Geometry
%
% EXAMPLE:
% SGfischertechniksample
%
% See also: CPLsample, SGsample, VLsample, PLsample, VLFLsample,
% CSGsample, SGerrorsample, SGcmdsample, testfunctTL, permutevector
%
%
% Copyright 2018 Tim C. Lueth

webdownload(url,FNAME)- downloads a file from a url and changes the name to date and tim

webdownload(url,FNAME)% webdownload(url,FNAME) - downloads a file from a url and changes the name to date and tim
% (by Tim Lueth, VLFL-Lib, 2018-NOV-01 as class: FILE HANDLING)
%
% Same construction data is stored on file server in the internet. By
% using this fnctn it is possible to download it and store it permanently
% for performance reasons locally on your system. In addition the name of
% the file can be changed to a name concept that fits your needs.
% By default date and time of download is used as name.
% By default the original extension of the file is reused. (Status of:
% 2018-11-01)
%
% Introduced first in SolidGeometry 4.3
%
% See also: loadweb
%
% [fname,orgfname,data]=webdownload([url,FNAME])
% === INPUT PARAMETERS ===
% url: complete url to download the file
% FNAME: new file name; default is datestr; false=> original name
% === OUTPUT RESULTS ======
% fname: file name on your file system
% orgfname: original file name
% data: data from url source
%
% EXAMPLE:
% url='';
% webdownload(url,false)
% webdownload(url)
% webdownload(url,'test')
% webdownload(url,'test.xxx')
%
% See also: loadweb
%
%
% Copyright 2018 Tim C. Lueth

CPLfischertechnik(tol,gb);- returns the most common CPL for the design of fischertechnik compatible connections

CPLfischertechnik(tol,gb);% CPLfischertechnik(tol,gb); - returns the most common CPL for the design of fischertechnik compatible connections
% (by Tim Lueth, VLFL-Lib, 2018-OKT-31 as class: CLOSED POLYGON LISTS)
%
% The stones have a width of 15 x 15 x 15 mm
% The buttons have a height of 2.5 mm, a width of 4 mm at the head and 3
% mm at the foot.
% The distance between the rails is therefore also 15 mm.
% The rods have a diameter of 4 mm.
% The drill holes have a distance of 10 mm
% The holes are cut with the button foot widths
% The buttons were initially cut circles and have changed to swallowtails
% or today V-lips
% (Status of: 2018-11-01)
%
% Introduced first in SolidGeometry 4.3
%
% See also: FTelement, VLFLdovetail
%
% [CPLL,CPLI,CPLC,PL3,PL4]=CPLfischertechnik([tol,gb]);
% === INPUT PARAMETERS ===
% tol: [tolerance between the lines CPLL and CPLI[a
% gb: length of contour; default is 15 mm
% === OUTPUT RESULTS ======
% CPLL: Line to create a blade or concave contour (rail, blade)
% CPLI: Line to create a convex contour (know)
% CPLC:
% PL3:
% PL4:
%
% EXAMPLE:
% [a,b,c,d,e]=CPLfischertechnik;
% f=a(2:end-1,:); SGofCPLrot(f);
% f=a(2:end-1,:); SGofCPLrot(f,4);
% f=c(2:end-1,:); SGofCPLrot(f);
% SGofCPLz(e,15);
% SGofCPLz(d,15);
% f=b(2:end-1,:); SGofCPLrot(f,4,true)
% SGofCPLz(d,15); A=ans; f=b(2:end-1,:); SGofCPLrot(f,4); B=ans; SGtransrelSG(B,A,'aligntop',2.5)
%
%
% See also: FTelement, VLFLdovetail
%
%
% Copyright 2018 Tim C. Lueth

SGofSGTsurface(SGT,FNam,t,d,s)- returns the flange surface for a given T matrix frame name

SGofSGTsurface(SGT,FNam,t,d,s)% SGofSGTsurface(SGT,FNam,t,d,s) - returns the flange surface for a given T matrix frame name
% (by Tim Lueth, VLFL-Lib, 2018-OKT-31 as class: SURFACES)
%
% calls fnctn SGofSurface with the surfaces of Frame N (Status of:
% 2018-10-31)
%
% Introduced first in SolidGeometry 4.3
%
% See also: isplanarVLFL, SGofSurface, VLFLofSGTsurface
%
% SG=SGofSGTsurface([SGT,FNam,t,d,s])
% === INPUT PARAMETERS ===
% SGT: Solid Geometry
% FNam: Name of Frame
% 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
% === OUTPUT RESULTS ======
% SG: Solid Geometry
%
% EXAMPLE:
% load JACO_robot.mat
% X=SGTui(JC01,'T',1);
% SGofSGTsurface(X,'T')
%
% See also: isplanarVLFL, SGofSurface, VLFLofSGTsurface
%
%
% Copyright 2018 Tim C. Lueth

SGcmdsample(name)- Creates a SGcommandstring or a solid for some sampke geometries

SGcmdsample(name)% SGcmdsample(name) - Creates a SGcommandstring or a solid for some sampke geometries
% (by Tim Lueth, VLFL-Lib, 2018-OKT-31 as class: SURFACES)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGCLsample, SGofCPLcommand, SGofCPLui, CPLsample, SGsample,
% VLsample, PLsample, VLFLsample, CSGsample, SGerrorsample,
% SGfischertechniksample, testfunctTL, permutevector
%
% [cmd,SG]=SGcmdsample([name])
% === INPUT PARAMETERS ===
% name: name of solid or empty
% === OUTPUT RESULTS ======
% cmd: command string
% SG: solid geometry
%
% EXAMPLE:
% SGcmdsample
% SGcmdsample('3156')
% SGcmdsample('S3156')
%
% See also: SGCLsample, SGofCPLcommand, SGofCPLui, CPLsample, SGsample,
% VLsample, PLsample, VLFLsample, CSGsample, SGerrorsample,
% SGfischertechniksample, testfunctTL, permutevector
%
%
% Copyright 2018-2019 Tim C. Lueth

CPLcopyradial(CPL,R,n,ow)- copies a CPL radial with radius and number of copies

CPLcopyradial(CPL,R,n,ow)% CPLcopyradial(CPL,R,n,ow) - copies a CPL radial with radius and number of copies
% (by Tim Lueth, VLFL-Lib, 2018-OKT-30 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.3
%
% See also: CPLcopypattern, CPLcopypatternPL
%
% CPL=CPLcopyradial(CPL,R,n,[ow])
% === INPUT PARAMETERS ===
% CPL: Original Contour
% R: Radius
% n: number of copies
% ow: offest angle
% === OUTPUT RESULTS ======
% CPL: copied contours
%
% EXAMPLE:
% CPLcopyradial(PLcircle(10),30,3);
%
% See also: CPLcopypattern, CPLcopypatternPL
%
%
% Copyright 2018 Tim C. Lueth

CPLofPLgrowline(PL,s,edge,caps);- converts a single open polygon into a grown contour

CPLofPLgrowline(PL,s,edge,caps);% CPLofPLgrowline(PL,s,edge,caps); - converts a single open polygon into a grown contour
% (by Tim Lueth, VLFL-Lib, 2018-OKT-30 as class: CLOSED POLYGON LISTS)
%
% Reimplemented version of PLgrowline using the polyshape class on
% 2018-10-30 by Tim Lueth (Status of: 2018-10-30)
%
% Introduced first in SolidGeometry 4.3
%
% See also: PLgrow, CPLgrow, CPLbuffer, CPLofPLgrow
%
% CPL=CPLofPLgrowline(PL,s,[edge,caps]);
% === INPUT PARAMETERS ===
% PL: Open point list line
% s: thickness
% edge: true= rounded edges; false = simple; default false;
% caps: true= rounded caps; false = straight; default is false;
% === OUTPUT RESULTS ======
% CPL: Closed Polygon line
%
% EXAMPLE: PL=[-5 10; -5 0; +5 0; +5 -10], CPLofPLgrowline(PL,1,true)
% PL=[-5 10; -5 0; +5 0; +5 -10], CPLofPLgrowline(PL,1,false)
% PL=[0 -19;0 20;0 19; 0 0]
% PL=[-5 10; -5 0; +5 0; +5 -10], CPLofPLgrowline(PL,1,true,true)
%
% See also: PLgrow, CPLgrow, CPLbuffer, CPLofPLgrow
%
%
% Copyright 2018 Tim C. Lueth

CPLofPLgrow(PL,R)- creates CPL circles around points of a point list

CPLofPLgrow(PL,R)% CPLofPLgrow(PL,R) - creates CPL circles around points of a point list
% (by Tim Lueth, VLFL-Lib, 2018-OKT-30 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.3
%
% See also: CPLbuffer, CPLofPLgrowline
%
% CPL=CPLofPLgrow(PL,R)
% === INPUT PARAMETERS ===
% PL: point list [n x 2]
% R: Radius
% === OUTPUT RESULTS ======
% CPL:
%
% EXAMPLE:
% CPLofPLgrow(PLstar(10),1)
% CPLofPLgrow(PLstar(10),2)
% CPLofPLgrow([PLstar(10);nan nan;PLstar(5)],1)
%
% See also: CPLbuffer, CPLofPLgrowline
%
%
% Copyright 2018 Tim C. Lueth

CPLbuffer(CPL,d,typ);- grows shrinks a CPL

CPLbuffer(CPL,d,typ);% CPLbuffer(CPL,d,typ); - grows shrinks a CPL
% (by Tim Lueth, VLFL-Lib, 2018-OKT-30 as class: CLOSED POLYGON LISTS)
%
% ATTENTION in contrast to CPLgrow, this fnctn uses polyshape and
% polybuffer. Both fnctns change the order of the points within a cpl and
% also the orientation to always clock-wise (cw) !
% 1st contour is cw, next inter ccw then cw and so on. (Status of:
% 2019-07-05)
%
% Introduced first in SolidGeometry 4.3
%
% See also: CPLofPLgrow, CPLofPLgrowline, PLonCPLcontour
%
% CPLN=CPLbuffer(CPL,d,[typ]);
% === INPUT PARAMETERS ===
% CPL: Closed Polygon line line
% d: Shifting distance
% typ: 'round'—Round out ,'square'—Square off, 'miter'—Preserve angle
%
% === OUTPUT RESULTS ======
% CPLN: Closed Polygon line
%
% EXAMPLE:
% CPLbuffer(PLstar(10),1);
% CPLbuffer(CPLsample(12),+3);
% CPLbuffer(CPLsample(12),+3,'round');
% CPLbuffer(CPLsample(10),1)
%
%
% See also: CPLofPLgrow, CPLofPLgrowline, PLonCPLcontour
%
%
% Copyright 2018-2020 Tim C. Lueth

surfofgca(gh)- returns the surfaces (not the patches) from the graphics handel

surfofgca(gh)% surfofgca(gh) - returns the surfaces (not the patches) from the graphics handel
% (by Tim Lueth, VLFL-Lib, 2018-OKT-30 as class: VISUALIZATION)
%
% uses h=findall(gh,'type','surface'); surf2patch(h,'triangles');
% (Status of: 2018-10-31)
%
% Introduced first in SolidGeometry 4.3
%
% See also: VLFLofSurf, surf2patch
%
% [h,VL,FL]=surfofgca([gh])
% === INPUT PARAMETERS ===
% gh: axis handle; default is gca
% === OUTPUT RESULTS ======
% h: handle to all surfaces of hf
% VL: Vertex list of surface
% FL: Triangulated Facet List of Surfaces using surf2patch
%
%
% See also: VLFLofSurf, surf2patch
%
%
% Copyright 2018 Tim C. Lueth

VLFLofSurf(s)- returns a vertex and facet list from a surf handle

VLFLofSurf(s)% VLFLofSurf(s) - returns a vertex and facet list from a surf handle
% (by Tim Lueth, VLFL-Lib, 2018-OKT-30 as class: SURFACES)
%
% Matlab support not only patches (n x 3) tesselates surfaces but also
% polygon shaphed surfaces caller surfaces (Status of: 2018-10-31)
%
% Introduced first in SolidGeometry 4.3
%
% See also: VLFLofPatch
%
% [VL,FL]=VLFLofSurf(s)
% === INPUT PARAMETERS ===
% s: surface handle
% === OUTPUT RESULTS ======
% VL: Vertex list
% FL: Facet list
%
% See also: VLFLofPatch
%
%
% Copyright 2018 Tim C. Lueth

CPLmeltbool(CPL,fullstep)- Merges a list of CPL by boolean add and sub

CPLmeltbool(CPL,fullstep)% CPLmeltbool(CPL,fullstep) - Merges a list of CPL by boolean add and sub
% (by Tim Lueth, VLFL-Lib, 2018-OKT-30 as class: CLOSED POLYGON LISTS)
%
%
% [a,b]=CPLsortinout(CPLsample(14)) (Status of: 2018-12-22)
%
% Introduced first in SolidGeometry 4.3
%
% See also: CPLsortinout, CPLbool, CPLsplitpoints, CPLrecontour, CPLrepair
%
% CPL1=CPLmeltbool(CPL,[fullstep])
% === INPUT PARAMETERS ===
% CPL:
% fullstep:
% === OUTPUT RESULTS ======
% CPL1:
%
% EXAMPLE:
% PLA=[PLcircle(4); nan nan; PLcircle(4)+3]; % Orientation doesnt matter
% PLB=[PLcircle(4); nan nan; flipud(PLcircle(4)+3)]; % Orientation doesnt matter
% CPLmeltbool(CPLsample(14)); % Single step analysis
% CPLmeltbool(CPLsample(14),true); % Full step analysis
%
% See also: CPLsortinout, CPLbool, CPLsplitpoints, CPLrecontour, CPLrepair
%
%
% Copyright 2018-2019 Tim C. Lueth

cellsize(C);- returns the size of cell elements

cellsize(C);% cellsize(C); - returns the size of cell elements
% (by Tim Lueth, VLFL-Lib, 2018-OKT-30 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.3
%
% See also: size, numel, length
%
% cs=cellsize(C);
% === INPUT PARAMETERS ===
% C): cell array
% === OUTPUT RESULTS ======
% cs: size of array
%
% EXAMPLE:
% loadweb JACO_robot.mat;
% FS=FSofSG(JCF), size(FS)
% cellsize(FS)
% cellsize(FS')
% cellsize({[1 ],[3 2] [2 3 1] [2]})
%
% See also: size, numel, length
%
%
% Copyright 2018 Tim C. Lueth

CPLofSGsliceauto(SG,dz);- returns the slive with a significant z distance

CPLofSGsliceauto(SG,dz);% CPLofSGsliceauto(SG,dz); - returns the slive with a significant z distance
% (by Tim Lueth, VLFL-Lib, 2018-OKT-29 as class: SLICES)
%
% Introduced first in SolidGeometry 4.3
%
% See also: CPLofSGslice, CPLofSGslice2, CPLofSGslice3, CVLzofSGsliceauto
%
% [CPL,CVL,zz]=CPLofSGsliceauto(SG,[dz]);
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% dz: minimal z change; default is soBB(SG)/50
% === OUTPUT RESULTS ======
% CPL: Closed Polygon Line
% CVL: Closed Vertex List of all z values
% zz:
%
% EXAMPLE:
% SGreadSTL; A=ans; SGrotateservo(A); B=ans
% CPLofSGsliceauto(B);
%
%
% See also: CPLofSGslice, CPLofSGslice2, CPLofSGslice3, CVLzofSGsliceauto
%
%
% Copyright 2018-2020 Tim C. Lueth

SGrotateservo(SG)- turns the SG of a servo motor to an upright position

SGrotateservo(SG)% SGrotateservo(SG) - turns the SG of a servo motor to an upright position
% (by Tim Lueth, VLFL-Lib, 2018-OKT-29 as class: SURFACES)
%
% The X axis is the longest dimension
% The y axis is the smallest dimension (Status of: 2020-07-03)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGrotate, SGmotorG50V6
%
% [SG,T,CPL1,CPL2]=SGrotateservo(SG)
% === INPUT PARAMETERS ===
% SG: Original Servo Solid Geoemtry
% === OUTPUT RESULTS ======
% SG: Rotate Solid
% T: Frame of Shaft
% CPL1: Contour of Shaft
% CPL2: Contour of body
%
% EXAMPLE:
% SGreadSTL; A=ans; SGrotateservo(A)
%
% See also: SGrotate, SGmotorG50V6
%
%
% Copyright 2018-2020 Tim C. Lueth

SGofCPLui_2018- simple CPL and SG editor using SGofCPLcommand

SGofCPLui_2018% SGofCPLui_2018 - simple CPL and SG editor using SGofCPLcommand
% (by Tim Lueth, VLFL-Lib, 2018-OKT-28 as class: CLOSED POLYGON LISTS)
%
% =======================================================================
% OBSOLETE (2019-08-12) - USE 'SGofCPLcommandui' INSTEAD
% =======================================================================
%
% Introduced first in SolidGeometry 4.3
%
% See also: [ SGofCPLcommandui ] ; SGofCPLcommand, SGofCPLui, SGcmdsample
%
% [SG,CPL]=SGofCPLui_2018
% === OUTPUT RESULTS ======
% SG: Solid geometry
% CPL: Closed polygon line
%
% EXAMPLE:
% SGofCPLui
% c 4, c 2, h 3, b 40 40, h 5
% g 10 22, ms 4 2, h 5, c 7, h 7,
%
% See also: [ SGofCPLcommandui ] ; SGofCPLcommand, SGofCPLui, SGcmdsample
%
%
% Copyright 2018-2019 Tim C. Lueth

PCwriteXYZ(PC,FNAME,ONAME)- writes an XYZ File of Vertices and Normals that is used by Meshlab

PCwriteXYZ(PC,FNAME,ONAME)% PCwriteXYZ(PC,FNAME,ONAME) - writes an XYZ File of Vertices and Normals that is used by Meshlab
% (by Tim Lueth, VLFL-Lib, 2018-OKT-28 as class: VERTICES / CLOUDS)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGwriteSTL, CPLwriteSVG
%
% PCwriteXYZ(PC,[FNAME,ONAME])
% === INPUT PARAMETERS ===
% PC: Point Cloud or Vertex list
% FNAME:
% ONAME:
%
% EXAMPLE:
% loadweb IntelRealsense.mat % loads vertex lists from RS300 and RS415
% PCwriteXYZ(VL_D415a);
%
% See also: SGwriteSTL, CPLwriteSVG
%
%
% Copyright 2018 Tim C. Lueth

CPLboolpshape(fflag,CPLA,CPLB);- Boolean Fncts based on the polyshape class

CPLboolpshape(fflag,CPLA,CPLB);% CPLboolpshape(fflag,CPLA,CPLB); - Boolean Fncts based on the polyshape class
% (by Tim Lueth, VLFL-Lib, 2018-OKT-26 as class: SURFACES)
%
% Polyshape class ignore the polygon orientation if 'simplify' is set to
% false. PREFERABLE
% Polyshape class MODIFIES the polygon shape if 'simplify' is set to
% true. PLEASE AVOID
% case {'+','PLUS','OR','UNION'}
% case {'X','AND','INTERSECT'}
% case {'A','A\B'}
% case {'B','B\A', 'REM'}
% case 'XOR' (Status of: 2018-10-28)
%
% Introduced first in SolidGeometry 4.3
%
% See also: CPLbool, CPLpolybool
%
% CPLN=CPLboolpshape(fflag,CPLA,CPLB);
% === INPUT PARAMETERS ===
% fflag: Operator
% CPLA: Contour A
% CPLB: Contour B
% === OUTPUT RESULTS ======
% CPLN: Final CPL
%
% EXAMPLE:
% CPLboolpshape('+',PLcircle(10), flipud(PLcircle(8)+4))
%
% See also: CPLbool, CPLpolybool
%
%
% Copyright 2018 Tim C. Lueth

SGofCPLcommand(cstr,blines,t,gap1,gap2,gap3)- Simple commandline based 2.5 solid modeler for the use of a caliper

SGofCPLcommand(cstr,blines,t,gap1,gap2,gap3)% SGofCPLcommand(cstr,blines,t,gap1,gap2,gap3) - Simple commandline based 2.5 solid modeler for the use of a caliper
% (by Tim Lueth, VLFL-Lib, 2018-OKT-25 as class: PARAMETRIC DESIGN)
%
% First a Contour is designed; afterwards the contour is extruded; and
% set below the already designed existing solid; ATTENTION IF YOU MELT
% THE PARTS AFTERWARDS AVOID edges with same planes
%
% SGofCPLcommands supports the following commands, separated by commas:
% See publishable tutorial VLFL_EXP45.m
%
% === CPL shape commands =================================
% b x-size y-size [d] => Box as rectangle or displace trapaze
% c diameter diameter edges => Cylinder or ellipse as polygon
% cs phi r-outer r-inner offset => Cylinder segment with angle
% co r-outer length r-inner => Cylinder oval segment with optional
% holes
% d diameter x-coord y-coord n-faces => Drilling hole at x/y with n edges
% g diameter teeth-nr turn => Gear that it turned (f.i. 0.5 teeth)
% ms diameter-1 diameter-2 => Motor shaft contour
%
% === CPL manipulation commands =================================
% move x-coord y-coord => Move the CPL relatively
% cp x-coord y-coord => Center point change
% ch distance radius => Convex hull in distance with optional radius
% dupc x-copies y copies distance => Duplicates contour in as x y
% pattern
% dupr radius number offset => Duplicates contour radial in n copies
% rad radius => Radial edges (+r) or cuts (-r) at each corner
% rot degree x y => Rotate a contour ccw by degree on centerpoint x
% y, default is center of CPL
% mirr x1 y1 x2 y2 => mirror CPL at straigth line through p1 p2
% fitt char => create fitting buffer 'c', 't', 'i' for all holes in
% CPL
%
% === CPL stack commands =================================
% enter => current CPL is shifted to the stack
% dup => current CPL is duplicated to the stack
% swap => current CPL is swaped with CPL on stack
% +/add => current CPL is added to stack CPL
% -/sub => current CPL is substracted from stack CPL
% rem => stack CPL ist substracted from current CPL
% &/isec => current CPL is intersected with stack CPL
% hs height => stack connection using height
%
% === CPL to solid commands =================================
% h height z-displacement => Height of the extruded solid
% hc height z-displacement => Height of extrusion with smoothed edges
% r angle pitch => Extrusion by rotation (degree) and optional pitch
%
% === SG element commands =================================
% scr mm length diameter => Screw/Cutter/Nut threat of diameter and
% length
% sph diameter end-angle => Sphere
% text string size-x size-z => Text string without space
%
% === SG manipulation commands =================================
% move x-coord y-coord => Move the solid relatively
% cham rar upper-dist lower-dist => Chamfer the edges of a 2.5 solid
% rotx degree => rotate around the x-axis
% roty degree => rotate around the y-axis
% rotz degree => rotate around the z-axis
% mirr x-degree y-degree z-displacement => mirror at the xy plane
% rotated around x and y-axis shifted in z
% grow offset => Grow/shrink the current solid with an offset
% melt => Boolean addition of all solid elements
% textstamp string => Add a string to the largest surface
% dupr number => Duplicates solids radial in n copies
% dups nx ny nz d => Duplicates solid spatial in x y z with distance d
% dupg nx ny nz d => Duplicates solid on a grid in x y z with
% distance d
% hollow wall => Creates a hollow solid
% shell wall distance => Creates a shell for the solid
% cutz z1 z2 => Cuts the solid at z1 and z2
%
% === SG save and restore commands =================================
% save name => saves the solid into name.SG
% load name => loads a solid from name.SG
% write name => saves the solid into File name.STL
% read name => reads the solid from File name.STL
% mag fact => magnifies the current solid
% col color => colors the faces of the current solid
%
% === SG stack commands =================================
% enter => current SG is shifted to the stack
% dup => current SG is duplicated to the stack
% swap => current SG is swaped with SG on stack
% clear nr => Clear stack content 1..n
% +/add => current SG is added to stack SG
% -/sub => current SG is substracted from stack SG
% rem => stack SG is substracted from current SG
% &/isec => current SG is intersected with stack SG
% rel command parameter => current SG is move relatively to stack
%
% === Frame commands =================================
% fset name ident rotation feature => attach a frame to the current SG
% falign Stack-Frame SG-Frame degree => align current SG-frame with
% stack frame and rotate
%
% === Macro commands =================================
% $cmd: : => Define macro using $1 $2 $3 $4 as parameters
% $cmd $1 $2 $3 $4 => Use macro as command with $1 $2 $3 $4 as
% parameters
%
%
% Try: SGofCPLcommand('g 3 22, h 5, c 5, h 20, roty -90, move 10 10')
% Try: SGofCPLcommand('$cob: co $1 $2 $3, h $3, fset B 1 0 R1, fset F 2 0
% R2:, $cob 10 50 5, dup, falign F B 45')
% Try: SGofCPLcommand('b 30 10, h 10, enter, $hole: c 3, h 10, rotx
% 90,move $1 $2 $3 :,$hole 10 5 5,-,enter, $hole 0 5 5,-,enter, $hole -10
% 5 5,-') % by Kei Aoyagi
%
%
% 2018-11-21 Tim Lueth (implementation) and Yilun Sun (requests)
% discussed the boolean RPN (reverse Polish Notation / Forth) concept
% using stacks
% (Status of: 2020-09-21)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGofCPLui, SGofCPLz, SGsurfacemeltbool, SGsurfacemeltbool
%
% [SG,CPLO,warn]=SGofCPLcommand(cstr,[blines,t,gap1,gap2,gap3])
% === INPUT PARAMETERS ===
% cstr: CPL command string, use '?' for info
% blines:
% t:
% gap1:
% gap2:
% gap3:
% === OUTPUT RESULTS ======
% SG: solid Geometry
% CPLO:
% warn:
%
% EXAMPLE:
% SGofCPLcommand('g 4 21, h 4'); % Gear with diameter 4mm, 21 teeth, height 4 mm
% SGofCPLcommand('g 4 21, h 4, c 3, h 1, move 5 0, b 40 10 ,h 2,b 25 10 , h 20')
% SGofCPLcommand('g 4 21, h 4, c 3, h 1, move 5 0, b 40 10 ,d 2.5 -15 0, d 2.5 +15 0, h 2,b 25 10 , h 20')
% SGofCPLcommand('g 4 21, h 4, c 3, h 1, move 5 0, b 15 8, h 4, b 40 10 ,d 2.5 -15 0, d 2.5 +15 0, h 2,b 25 10 , h 20')
% SGofCPLcommand('g 4 21, h 4, c 3, h 1, move 5 0, b 15 8, hc 4, b 40 10 ,d 2.5 -15 0, d 2.5 +15 0, hc 2,b 25 10 , hc 20')
% SGofCPLcommand('g 5 10, enter, b 10 30 10')
% SGofCPLcommand('g 5 10, enter, b 10 30 10')
% SGofCPLcommand('g 5 10, enter, b 10 30 10, xor, h 4')
%
% See also: SGofCPLui, SGofCPLz, SGsurfacemeltbool, SGsurfacemeltbool
%
%
% Copyright 2018-2020 Tim C. Lueth

SGgearwormDIN(m,dw,wg,R)- returns a gear worm solid

SGgearwormDIN(m,dw,wg,R)% SGgearwormDIN(m,dw,wg,R) - returns a gear worm solid
% (by Tim Lueth, VLFL-Lib, 2018-OKT-24 as class: PARAMETRIC DESIGN)
%
% DIN 3975
% (Status of: 2018-10-25)
%
% Introduced first in SolidGeometry 4.3
%
% See also: PLgearrackDIN, SGgearDIN, SGgearpairDIN, SGgearrackDIN,
% CPLmotorshaft
%
% [SGW,SGX]=SGgearwormDIN([m,dw,wg,R])
% === INPUT PARAMETERS ===
% m: modul
% dw: diameter middle circle
% wg: number of windings; default is 5; if wg<0; Len=abs(wg)
% R: Radius or CPL for an inner contour
% === OUTPUT RESULTS ======
% SGW: Solid of gear work
% SGX: Gear and Shaft
%
% EXAMPLE:
% SGgearmwormDIN(1,5)
% SGgearmwormDIN(1,10)
% SGgearmwormDIN(1,20)
% SGgearmwormDIN(1,40)
% SGgearmwormDIN(1,40,6)
% SGgearmwormDIN(1,'','',2); view(-30,30);
% SGgearmwormDIN(1,'','',CPLmotorshaft); view(-30,30);
%
% See also: PLgearrackDIN, SGgearDIN, SGgearpairDIN, SGgearrackDIN,
% CPLmotorshaft
%
%
% Copyright 2018-2021 Tim C. Lueth

VLFLselectcrossingfacets(SG,T,XSG,xfull);- selects the crossing facets of a solid that is crossed by a second one

VLFLselectcrossingfacets(SG,T,XSG,xfull);% VLFLselectcrossingfacets(SG,T,XSG,xfull); - selects the crossing facets of a solid that is crossed by a second one
% (by Tim Lueth, VLFL-Lib, 2018-OKT-21 as class: VERTICES / CLOUDS)
%
% This fnctn is an optional interactive fnctn to select the potential
% crossing facet of two solids (Status of: 2018-10-23)
%
% Introduced first in SolidGeometry 4.3
%
% See also: VLDLBBofVLFL, collofBBs, SGintersectFacetPoints,
% VLofVLFLselfIntersection
%
% CFL=VLFLselectcrossingfacets(SG,[T,XSG,xfull]);
% === INPUT PARAMETERS ===
% SG: Solid A
% T: point or HT matrix; default==''; manual select
% XSG: cube length, rectangle size, box size or Solid Geoemetry
% xfull: true == full cross check not only BB of XSG; default is false;
% === OUTPUT RESULTS ======
% CFL: crossing facets of [SG XSG]
%
% EXAMPLE:
% load SG_Instruments.mat
% VLFLselectcrossingfacets(SG_Forceps)
% VLFLselectcrossingfacets(SG_Forceps,[120 75])
% VLFLselectcrossingfacets(SG_Forceps,[120 75],[40 20])
% VLFLselectcrossingfacets(SGsphere(12),'',[1 50 50]);
%
% See also: VLDLBBofVLFL, collofBBs, SGintersectFacetPoints,
% VLofVLFLselfIntersection
%
%
% Copyright 2018-2021 Tim C. Lueth

CPLplotregions(CPL,ind)- plots the regions of a CPL / polyshape in different colors

CPLplotregions(CPL,ind)% CPLplotregions(CPL,ind) - plots the regions of a CPL / polyshape in different colors
% (by Tim Lueth, VLFL-Lib, 2018-OKT-18 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.3
%
% See also: CPLplotasPS, CPLplot, CPLfaceplot, CPLplotcolors, CPLplotinout
%
% h=CPLplotregions(CPL,[ind])
% === INPUT PARAMETERS ===
% CPL: Closed polygon
% ind: index of regions; default is all
% === OUTPUT RESULTS ======
% h: handle to graphics objects
%
% EXAMPLE:
% SGfigure; CPLplotregions(CPLsample(14))
%
% See also: CPLplotasPS, CPLplot, CPLfaceplot, CPLplotcolors, CPLplotinout
%
%
% Copyright 2018 Tim C. Lueth

CPLplotcolors(CPL,ind,fs)- plots all contours or indexed contours in colors

CPLplotcolors(CPL,ind,fs)% CPLplotcolors(CPL,ind,fs) - plots all contours or indexed contours in colors
% (by Tim Lueth, VLFL-Lib, 2018-OKT-18 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.3
%
% See also: CPLplotasPS, CPLplot, CPLfaceplot, CPLplotregions,
% CPLplotinout, CPLplotcwccw
%
% h=CPLplotcolors(CPL,[ind,fs])
% === INPUT PARAMETERS ===
% CPL: Closed Polygon line
% ind: indizes; default is all
% fs: optional font size
% === OUTPUT RESULTS ======
% h: handle to graphics objects
%
% EXAMPLE:
% SGfigure; CPLplotcolors(CPLsample(12));
% SGfigure; CPLplotcolors(CPLsample(12),'',16);
%
%
% See also: CPLplotasPS, CPLplot, CPLfaceplot, CPLplotregions,
% CPLplotinout, CPLplotcwccw
%
%
% Copyright 2018-2019 Tim C. Lueth

CPLopendistance(CPL)- returns the maximal distance between neighbor points of a contour related to the contour size

CPLopendistance(CPL)% CPLopendistance(CPL) - returns the maximal distance between neighbor points of a contour related to the contour size
% (by Tim Lueth, VLFL-Lib, 2018-OKT-18 as class: CLOSED POLYGON LISTS)
%
% This fnctn is designed for analyzing CPLofprocessedimage contoures or
% CPLofimage contours (Status of: 2018-10-18)
%
% Introduced first in SolidGeometry 4.3
%
% See also: CPLofprocessedimage, CPLofimage
%
% [DP,DN]=CPLopendistance(CPL)
% === INPUT PARAMETERS ===
% CPL: CLosed Polygon line
% === OUTPUT RESULTS ======
% DP: maximum distance in relation to bb of CPL
% DN: maximum distance between two points
%
% See also: CPLofprocessedimage, CPLofimage
%
%
% Copyright 2018 Tim C. Lueth

FLofVLonsphereprojection(VL)- returns a facet list that is based on alphashape triangulation of sphere projected vertices

FLofVLonsphereprojection(VL)% FLofVLonsphereprojection(VL) - returns a facet list that is based on alphashape triangulation of sphere projected vertices
% (by Yilun Sun, VLFL-Lib, 2018-OKT-17 as class: VERTICES / CLOUDS)
%
% Point clouds that are recorded by a video camera create vertices that
% are equidistant if they are projected on to a internal surface of a
% sphere. Therefor this fnctn projects first vertices to spherical,
% performs an alphashape triangulation, and returns the facets (Status
% of: 2018-10-17)
%
% Introduced first in SolidGeometry 4.3
%
% See also: FLofVLnearestneighbors, FLofVLdelaunay
%
% [FL,PL]=FLofVLonsphereprojection(VL)
% === INPUT PARAMETERS ===
% VL: Vertex list / Point cloud
% === OUTPUT RESULTS ======
% FL: Facet list
% PL: Point list [AZ EL]
%
% EXAMPLE:
% loadweb IntelRealsense.mat; whos
% FLofVLonsphereprojection(VL_D415c);
%
%
% See also: FLofVLnearestneighbors, FLofVLdelaunay
%

CPLofprocessedimage(I,ms,fspecial);- returns contours inside a processed image

CPLofprocessedimage(I,ms,fspecial);% CPLofprocessedimage(I,ms,fspecial); - returns contours inside a processed image
% (by Tim Lueth, VLFL-Lib, 2018-OKT-17 as class: IMAGES)
%
% It uses finally CPL=CPLofimage(I,2);
% Support: 'gaussian', 'sobel', 'prewitt', 'laplacian', 'log', 'average',
% 'unsharp', 'disk', 'motion'
% (Status of: 2018-10-17)
%
% Introduced first in SolidGeometry 4.3
%
% See also: fspecial, imfilter, CPLofimage
%
% CPL=CPLofprocessedimage(I,[ms,fspecial]);
% === INPUT PARAMETERS ===
% I: Image
% ms: optional resize value; default is 1024; 0==unchanged
% fspecial: optional filter values - see at fspecial
% === OUTPUT RESULTS ======
% CPL:
%
% EXAMPLE:
% loadweb CAD_pictures.mat; imshow(CADpictservo); shg
% CPLofprocessedimage(CADpictservo,'','disk',20); CPL=ans; CPL=CPL/10;
% findcirclesinCPL(CPL,1)
%
% See also: fspecial, imfilter, CPLofimage
%
%
% Copyright 2018 Tim C. Lueth

lengthNaN(CPL)- returns the length of the individiual entries of a nan separated list

lengthNaN(CPL)% lengthNaN(CPL) - returns the length of the individiual entries of a nan separated list
% (by Tim Lueth, VLFL-Lib, 2018-OKT-16 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.3
%
% See also: selectNaN, replaceNaN, cellofNaN, separateNaN, uniqueNaN,
% unsortNaN
%
% [l,a]=lengthNaN(CPL)
% === INPUT PARAMETERS ===
% CPL: nan separated list
% === OUTPUT RESULTS ======
% l: length of the individual segments of the nan separated list
% a: starting indices
%
% EXAMPLE:
% loadweb CAD_pictures.mat; imshow(CADpictservo);
% CPLofimage(CADpictservo); CPL=ans;
% selectNaN(CPL,find(lengthNan(CPL)>300));
% [a,b]=lengthNaN(CPLsample(11))
%
% See also: selectNaN, replaceNaN, cellofNaN, separateNaN, uniqueNaN,
% unsortNaN
%
%
% Copyright 2018-2019 Tim C. Lueth

imshow4(I)- Plots RGB images in 4 color segments

imshow4(I)% imshow4(I) - Plots RGB images in 4 color segments
% (by Tim Lueth, VLFL-Lib, 2018-OKT-13 as class: AUXILIARY PROCEDURES)
%
% Auxiliary fnctn to understand easier the color chanels of a r x c x
% chanel image (Status of: 2018-10-13)
%
% Introduced first in SolidGeometry 4.3
%
% See also: imshow
%
% imshow4(I)
% === INPUT PARAMETERS ===
% I: RGB image or grayscale
%
% EXAMPLE:
% I=imread('peppers.png');
% imshow4(I)
% imshow4(imresize(I,[640 nan]))
% imshow4(rgb2gray(I))
% imshow4(rgb2ntsc(I))
% imshow4(sum(I,3))
%
% See also: imshow
%
%
% Copyright 2018 Tim C. Lueth

imresizep(I,maxrc,defcol)- resizes an image proportional relative to a mimum number of pixels

imresizep(I,maxrc,defcol)% imresizep(I,maxrc,defcol) - resizes an image proportional relative to a mimum number of pixels
% (by Tim Lueth, VLFL-Lib, 2018-OKT-13 as class: IMAGES)
%
% This fnctn is used to limit an image size before image processing to
% guarantee a defined processing time. The image is always scaled
% proportionally.
% It is possible to scale on maximum value for row or col, or on defined
% rows number, defined cols number or defined size. If there is need to
% add a border, since the given format differenz from the original
% images's proportion, a color can specified for the border; (Status of:
% 2020-03-31)
%
% Introduced first in SolidGeometry 4.3
%
% See also: imreadui
%
% I=imresizep(I,maxrc,[defcol])
% === INPUT PARAMETERS ===
% I: Images
% maxrc: maximum number of rows or cols; or [rw nan] or [nan col];
% defcol: color for borders to extend; default is 255
% === OUTPUT RESULTS ======
% I: resized image smaller than [maxrc x maxrc]
%
% EXAMPLE:
% I=imread('peppers.png'); whos I
% imresizep(I,480); pause
% imresizep(I,[nan 1080]);pause
% imresizep(I,[1080 nan]);
% pause; imresizep(I,[700 2000],255);
% pause; imresizep(I,[2000 700],100);
%
% See also: imreadui
%
%
% Copyright 2018-2020 Tim C. Lueth

viewsmooth (az,el,n)- slowly rotates to a new viwe

viewsmooth (az,el,n)% viewsmooth (az,el,n) - slowly rotates to a new viwe
% (by Tim Lueth, VLFL-Lib, 2018-OKT-11 as class: VISUALIZATION)
%
% Introduced first in SolidGeometry 4.3
%
% See also: viewsmooth, Videoquickrotate3D, animatego, figurerotate,
% drawnowvid
%
% viewsmooth(az,el,[n])
% === INPUT PARAMETERS ===
% az: azimut similar to view
% el: elevantion similar to view
% n: number of steps; default is 15
%
% EXAMPLE:
% SGfigure(-30,30); SGbox; shg; viewsmooth(170,30,20);
%
% See also: viewsmooth, Videoquickrotate3D, animatego, figurerotate,
% drawnowvid
%
%
% Copyright 2018-2022 Tim C. Lueth

findcircleinCPL(CPL,epsn)- searches for radial contours and returns center points and radius and index

findcircleinCPL(CPL,epsn)% findcircleinCPL(CPL,epsn) - searches for radial contours and returns center points and radius and index
% (by Tim Lueth, VLFL-Lib, 2018-OKT-11 as class: ANALYTICAL GEOMETRY)
%
% It is recommended to use PLofCPL(PL) before calling this fnctn
% return format is a list for each point of the list the radius of the 3
% point neighborhood
% [R X Y W nmin isR]
% R is Radius R
% X of Center
% Y of Center
% W is Angle in grad between 3 Points
% nmin required number for a circle polygon for this radius and angle
% isR true if detected as circle (Status of: 2018-10-15)
%
% Introduced first in SolidGeometry 4.3
%
% See also: CVLdimclassifier
%
% [RL,RCL]=findcircleinCPL(CPL,[epsn])
% === INPUT PARAMETERS ===
% CPL: Closed Contour List
% epsn: rounding limit; default is n of rd
% === OUTPUT RESULTS ======
% RL:
% RCL:
%
% EXAMPLE:
% findcircleinCPL(PLofCPL(CPLsample(12)))
% findcircleinCPL(PLofCPL(CPLsample(31)))
%
% See also: CVLdimclassifier
%
%
% Copyright 2018 Tim C. Lueth

imageofipcam(u)- returns an image of the ipcam

imageofipcam(u)% imageofipcam(u) - returns an image of the ipcam
% (by Tim Lueth, VLFL-Lib, 2018-OKT-11 as class: IMAGES)
%
% does work with the iPhoneapp ipcam (Status of: 2018-10-11)
%
% Introduced first in SolidGeometry 4.3
%
% See also: ipcam_2014b, immeasureui, ipcam
%
% imageofipcam([u])
% === INPUT PARAMETERS ===
% u: url - used at least for the first call
%
% EXAMPLE:
% imageofipcam('http://10.183.35.246:8020/image.jpg');
%
% See also: ipcam_2014b, immeasureui, ipcam
%
%
% Copyright 2018 Tim C. Lueth

CPLmotorshaft(Ra,Rc,tW)- returns the CPL for a motorshaft, for instance Fischertechnik

CPLmotorshaft(Ra,Rc,tW)% CPLmotorshaft(Ra,Rc,tW) - returns the CPL for a motorshaft, for instance Fischertechnik
% (by Tim Lueth, VLFL-Lib, 2018-OKT-11 as class: CLOSED POLYGON LISTS)
%
% the standard shape is a
% Ra=Da/2; Rc=Dc-Ra (Status of: 2020-07-03)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGgearDIN, SGgearrackDIN, SGmotorG50V6
%
% PL=CPLmotorshaft([Ra,Rc,tW])
% === INPUT PARAMETERS ===
% Ra: Radius of the largest Diameter
% Rc: Radius distance from the center to the plate
% tW: turning offset in degree
% === OUTPUT RESULTS ======
% PL: Point List for CPL
%
% EXAMPLE:
% CPLmotorshaft(3,2)
% CPLmotorshaft(3,2,pi/2)
%
% See also: SGgearDIN, SGgearrackDIN, SGmotorG50V6
%
%
% Copyright 2018-2020 Tim C. Lueth

SGgearandrackDIN(m,z1,z2,R,h)- retunrs a gear and gear rack combination

SGgearandrackDIN(m,z1,z2,R,h)% SGgearandrackDIN(m,z1,z2,R,h) - retunrs a gear and gear rack combination
% (by Tim Lueth, VLFL-Lib, 2018-OKT-11 as class: MODELING PROCEDURES)
%
% Introduced first in SolidGeometry 4.3
%
% See also: PLgearrackDIN, SGgearDIN, SGgearpairDIN, SGgearrackDIN,
% CPLmotorshaft
%
% SGgearandrackDIN([m,z1,z2,R,h])
% === INPUT PARAMETERS ===
% m: module
% z1: teeth number of gear
% z2: teeth number of rack
% R: bore of gear
% h: height of gear and rack
%
% EXAMPLE:
% SGgearandrackDIN(1,32,12,5,10)
% SGgearandrackDIN(1,32,12,CPLmotorshaft(5,3),10)
%
% See also: PLgearrackDIN, SGgearDIN, SGgearpairDIN, SGgearrackDIN,
% CPLmotorshaft
%
%
% Copyright 2018 Tim C. Lueth

SGgearrackDIN(m,z,h0,b,tig,re)- returns a gear rack for a gear

SGgearrackDIN(m,z,h0,b,tig,re)% SGgearrackDIN(m,z,h0,b,tig,re) - returns a gear rack for a gear
% (by Tim Lueth, VLFL-Lib, 2018-OKT-11 as class: SURFACES)
%
% Introduced first in SolidGeometry 4.3
%
% See also: PLgearrackDIN, SGgearDIN, SGgearpairDIN
%
% SG=SGgearrackDIN([m,z,h0,b,tig,re])
% === INPUT PARAMETERS ===
% m: module
% z: number of teeth if integer or length if real
% h0: base size
% b: width of rack / height of gear
% tig: false = gap; true= tooth
% re: rounded edges; default is false
% === OUTPUT RESULTS ======
% SG: Solid Geoemtry
%
% EXAMPLE:
% SGgearrackDIN(1,5,'',5,false)
% SGgearrackDIN(1,5,'',5,false,true)
%
% See also: PLgearrackDIN, SGgearDIN, SGgearpairDIN
%
%
% Copyright 2018 Tim C. Lueth

getfuncparams(n,args,v,fillinm,b,b,b)- processes varargin list -

getfuncparams(n,args,v,fillinm,b,b,b)% getfuncparams(n,args,v,fillin) - processes varargin list -
% (by Tim Lueth, VLFL-Lib, 2018-OKT-11 as class: AUXILIARY PROCEDURES)
%
% SG-Lib standard fnctn to process the input arguments varargin
% This fnctn is automaticaly processed/parsed by Tim Lueth's FM
% documentation database
% ===> if nargin>=XX && ~isempty(varargin{XX}); YYY=varargin{XX}; end;
% The fnctn is able to handle arrays of input vales per argument
% (Status of: 2020-09-06)
%
% Introduced first in SolidGeometry 4.3
%
% See also: getvarg
%
% [nv,ea]=getfuncparams(n,args,v,[fillin])
% === INPUT PARAMETERS ===
% n: number of parameter varargin
% args: varargin
% v: default value
% fillin: default is false; if true, variable is filled with default
% values
% === OUTPUT RESULTS ======
% nv: value for variable or logical of found if there are two output
% arguments
% ea: true if argument was empty
%
% EXAMPLE:
% m=getfuncparams(1,varargin,1);
% getfuncparams(1,{'a','b','c'},3)
% getfuncparams(4,{'a','b','c'},3)
% [a,b]=getfuncparams(2,{'a','','c'},3) % b shows that there 2nd is empty
% [a,b]=getfuncparams(6,{'a','','c'},3) % b shows that 6th is empty
% [a,b]=getfuncparams(3,{'a','','c'},'c') % b shows that 3rd is forced / given
% getfuncparams(1,{9},[1 2 3 4]) % replaces the array by a scalar
% getfuncparams(1,{9},[1 2 3 4],true) % replaces the first element of the array
% getfuncparams(1,{[9 8 7]},[1 2 3 4],true) % replaces the first three elements of the array
% A=SGbox, B=SGbox, C=[A B], getfuncparams(1,{A,B,C},[C B A],true)
%
% See also: getvarg
%
%
% Copyright 2018-2021 Tim C. Lueth

PLgearrackDIN(m,l,h0,tig,rem,l,h0,re)- returns a PL for gearrack

PLgearrackDIN(m,l,h0,tig,rem,l,h0,re)% PLgearrackDIN(m,l,h0,tig,rem,l,h0,re) - returns a PL for gearrack
% (by Tim Lueth, VLFL-Lib, 2018-OKT-11 as class: MECHANICAL PROCEDURES)
%
% Introduced first in SolidGeometry 4.3
%
% See also: PLgearrackDIN, PLgearDIN, PLthreadDIN, SGofCPLrota
%
% [PL,l,p]=PLgearrackDIN([m,l,h0,tig,rem,l,h0,re])
% === INPUT PARAMETERS ===
% m: modul
% l: number of teeth if integer; maximal length if real;
% h0: optional height
% tig: false=tooth a origin; true=gap at origin
% rem: rounded edges; default is false
% l:
% h0:
% re:
% === OUTPUT RESULTS ======
% PL: Point list [ n x 3]
% l: exact length
% p: tooth + gap size = pi * m
%
% EXAMPLE:
% PLgearrackDIN(1)
% PLgearrackDIN(1,10)
% PLgearrackDIN(1,10.001,10)
% PLgearrackDIN(1,4,'',false)
% PLgearrackDIN(1,4,'',true)
% PLgearrackDIN(1,4,'',true,true)
%
% See also: PLgearrackDIN, PLgearDIN, PLthreadDIN, SGofCPLrota
%
%
% Copyright 2018 Tim C. Lueth

SGgearpairDIN(m,z1,z2,h,R,d)- provides a simple gear ratio stage as Solid Geometry

SGgearpairDIN(m,z1,z2,h,R,d)% SGgearpairDIN(m,z1,z2,h,R,d) - provides a simple gear ratio stage as Solid Geometry
% (by Tim Lueth, VLFL-Lib, 2018-OKT-08 as class: MECHANICAL PROCEDURES)
%
% Introduced first in SolidGeometry 4.3
%
% See also: PLgear, PLgearDIN, SGgearDIN, SGspurgear, VLFLgear,
% VLFLgearhub4shaft, VLFLinternalgear
%
% [SG1,SG2,SG3,SG4]=SGgearpairDIN([m,z1,z2,h,R,d])
% === INPUT PARAMETERS ===
% m: modules
% z1: number of teeth 1
% z2: number of teeth 1
% h: height of the gear
% R: radius of axle
% d: height of the bearing
% === OUTPUT RESULTS ======
% SG1: Gear 1
% SG2: Gear 2
% SG3: Bearing 1
% SG4: Bearing Top
%
% EXAMPLE:
% SGgearpairDIN(1,32,16,5);
%
% See also: PLgear, PLgearDIN, SGgearDIN, SGspurgear, VLFLgear,
% VLFLgearhub4shaft, VLFLinternalgear
%
%
% Copyright 2018 Tim C. Lueth

SGgearDIN(m,z,R,h,tig)- Calculate a gear with the count from 9.12 to 48; for internal and external gears

SGgearDIN(m,z,R,h,tig)% SGgearDIN(m,z,R,h,tig) - Calculate a gear with the count from 9.12 to 48; for internal and external gears
% (by Tim Lueth, VLFL-Lib, 2018-OKT-08 as class: MECHANICAL PROCEDURES)
%
% There is much more precise modelling by Yannick Krieger and Matthias
% Traeger.
% (Status of: 2018-10-09)
%
% Introduced first in SolidGeometry 4.3
%
% See also: PLgear, PLgearDIN, SGgearpairDIN, SGspurgear, VLFLgear,
% VLFLgearhub4shaft, VLFLinternalgear
%
% SG=SGgearDIN([m,z,R,h,tig])
% === INPUT PARAMETERS ===
% m: modul; negativ values for internal gears
% z: number of teeth
% R: radius for a shaft/axle or CPL for inner contour
% h: height of the gear
% tig: 0/1 for the position if the first tooth at zeros degree
% === OUTPUT RESULTS ======
% SG: Solid Geometry
%
% EXAMPLE:
% SGgearDIN (+1,26)
% SGgearDIN (+1,26,3)
% SGgearDIN (+1,26,CPLofmotorshaft)
% SGgearDIN (-1,26)
% SGgearDIN (+1,26,'','',1)
% SGgearDIN (+1,26,'','',0)
%
% See also: PLgear, PLgearDIN, SGgearpairDIN, SGspurgear, VLFLgear,
% VLFLgearhub4shaft, VLFLinternalgear
%
%
% Copyright 2018 Tim C. Lueth

TplanesofVLFLfacets(VL,FL)- returns the HT matrices for the facets from center and normal

TplanesofVLFLfacets(VL,FL)% TplanesofVLFLfacets(VL,FL) - returns the HT matrices for the facets from center and normal
% (by Tim Lueth, VLFL-Lib, 2018-OKT-08 as class: ANALYTICAL GEOMETRY)
%
% This fnctn calculates the center of each facet and the normal and
% creates
% a HT matrix for the center point and a
% Vertex facet list from the center and a larger edge length (Status of:
% 2018-10-08)
%
% Introduced first in SolidGeometry 4.3
%
% See also: TplanesofPCnormals
%
% [T,DVL,DFL]=TplanesofVLFLfacets(VL,FL)
% === INPUT PARAMETERS ===
% VL: Vertex list or Solid Geometry
% FL: Facet list
% === OUTPUT RESULTS ======
% T: cell list of transformation matrices
% DVL: Triangle vertex list
% DFL: fTriangle vertex listacet list
%
% EXAMPLE:
% loadweb IntelRealsense.mat % loads vertex lists from RS300 and RS415
% VLdownsample(VL_D415a,30); NVL=ans; whos('VL_D415a'), whos ('NVL')
% TplanesofVLFLfacets(NVL,FL)
%
% See also: TplanesofPCnormals
%
%
% Copyright 2018 Tim C. Lueth

TplanesofPCnormals(pc)- returns the HT matrices for the points and normals

TplanesofPCnormals(pc)% TplanesofPCnormals(pc) - returns the HT matrices for the points and normals
% (by Tim Lueth, VLFL-Lib, 2018-OKT-08 as class: ANALYTICAL GEOMETRY)
%
% in fact this fnctn makes quite clear that the vertex normals of a point
% cloud are all oriented into the center of the origin (Status of:
% 2018-10-08)
%
% Introduced first in SolidGeometry 4.3
%
% See also: TplanesofVLFLfacets
%
% [T,DVL,FL]=TplanesofPCnormals(pc)
% === INPUT PARAMETERS ===
% pc: point cloud or vertex list
% === OUTPUT RESULTS ======
% T: cell list of transformation matrices
% DVL: Triangle vertex list
% FL: facet list
%
% EXAMPLE:
% loadweb IntelRealsense.mat % loads vertex lists from RS300 and RS415
% VLdownsample(VL_D415a,30); NVL=ans; whos('VL_D415a'), whos ('NVL')
% TplanesofPCnormals(NVL)
%
% See also: TplanesofVLFLfacets
%
%
% Copyright 2018 Tim C. Lueth

CPLofPLalphashape(PL,)- returns a closed polygon contour around a point list using alphashape

CPLofPLalphashape(PL,)% CPLofPLalphashape(PL,) - returns a closed polygon contour around a point list using alphashape
% (by Tim Lueth, VLFL-Lib, 2018-OKT-08 as class: SURFACES)
%
% same as PLFLofPLalphashape (Status of: 2018-10-08)
%
% Introduced first in SolidGeometry 4.3
%
% See also: PLFLofPLalphashape
%
% [CPL,PL,FL,EL,CEL]=CPLofPLalphashape(PL,[])
% === INPUT PARAMETERS ===
% PL: Original Point cloud
% === OUTPUT RESULTS ======
% CPL: Closed Polygon List of contour (endpoint=startpoint)
% PL: Point list (doubled entries removed)
% FL: Facet List
% EL: Edge list of free boundary sorted
% CEL: Contour index list
%
% EXAMPLE:
% pc=PCofSG(SGsample(25),30000); PL=pc.Location(:,1:2);
% CPLofPLalphashape(PL);
%
% See also: PLFLofPLalphashape
%
%
% Copyright 2018 Tim C. Lueth

VLdownsample(VL,gs,ongrid)- returns a downsampled vertex list

VLdownsample(VL,gs,ongrid)% VLdownsample(VL,gs,ongrid) - returns a downsampled vertex list
% (by Tim Lueth, VLFL-Lib, 2018-OKT-08 as class: SR300)
%
% Introduced first in SolidGeometry 4.3
%
% See also: pcdownsample, unique
%
% [NVL,a,b]=VLdownsample(VL,[gs,ongrid])
% === INPUT PARAMETERS ===
% VL: Vertex list
% gs: grid size; default is 1 percent (100x100x100) = 10000
% ongrid: 'grid','mean','stable','first','last'
% === OUTPUT RESULTS ======
% NVL: New vertex list
% a: selection index of VL
% b: mapping index of VL
%
% EXAMPLE:
% loadweb IntelRealsense.mat
% VLdownsample(VL_D415a); NVL=ans; whos('VL_D415a'), whos ('NVL')
%
% See also: pcdownsample, unique
%
%
% Copyright 2018 Tim C. Lueth

PCfindNearestNeighbors(pc,ind,nr,al)- returns for a pointcloud a list of direct neighbors, distances and areas

PCfindNearestNeighbors(pc,ind,nr,al)% PCfindNearestNeighbors(pc,ind,nr,al) - returns for a pointcloud a list of direct neighbors, distances and areas
% (by Tim Lueth, VLFL-Lib, 2018-OKT-08 as class: SR300)
%
% Since the nearest neighbor search is time consuming, it makes sense to
% reduce the number of points to less than 10000.
% uses findNearestNeighbors from class pointCLoud. (Status of: 2018-10-08)
%
% Introduced first in SolidGeometry 4.3
%
% See also: findNearestNeighbors
%
% [NIL,DIL,OA,AL,pc]=PCfindNearestNeighbors(pc,[ind,nr,al])
% === INPUT PARAMETERS ===
% pc: point cloud or vertex list
% ind: indices' default is all
% nr: number of neighbors; default is 3
% al: minimal angle for triangles; default is zero
% === OUTPUT RESULTS ======
% NIL: Neighbor index list [n x nr] = Facet list for nr==3
% DIL: Neighbor distance list [n x nr]
% OA: point cloud
% AL: Area list
% pc: point cloud
%
% EXAMPLE:
% loadweb IntelRealsense.mat % loads vertex lists from RS300 and RS415
% VLdownsample(VL_D415a); NVL=ans; whos('VL_D415a'), whos ('NVL')
% PCfindNearestNeighbors(NVL);
%
% See also: findNearestNeighbors
%
%
% Copyright 2018 Tim C. Lueth

planedistanceofT(T,VL)- returns the distance of a vertex list to a plane in HT coordinate form

planedistanceofT(T,VL)% planedistanceofT(T,VL) - returns the distance of a vertex list to a plane in HT coordinate form
% (by Tim Lueth, VLFL-Lib, 2018-OKT-07 as class: ANALYTICAL GEOMETRY)
%
% high speed fnctn
% In contrast to distT, this fnctn returns only the distance value
% (Status of: 2018-10-08)
%
% Introduced first in SolidGeometry 4.3
%
% See also: distE, distT, VLisbelowT
%
% D=planedistanceofT(T,VL)
% === INPUT PARAMETERS ===
% T: Transformationmatrix 4x4
% VL: Vertex list
% === OUTPUT RESULTS ======
% D: Distance vector
%
% EXAMPLE:
% VL=rand(10,3), planedistanceofT(TofR(rot(0,pi/2,0)),VL)
%
%
% See also: distE, distT, VLisbelowT
%
%
% Copyright 2018-2021 Tim C. Lueth

PLFLofPLalphashape(PL,r)- returns a facet list from a point list using alphashape

PLFLofPLalphashape(PL,r)% PLFLofPLalphashape(PL,r) - returns a facet list from a point list using alphashape
% (by Tim Lueth, VLFL-Lib, 2018-OKT-07 as class: SURFACES)
%
% This fnctn is helpful to
% creates a closed surface from a point list (Status of: 2018-10-08)
%
% Introduced first in SolidGeometry 4.3
%
% See also: CPLofPLalphashape
%
% [PL,FL,CPL,EL,CEL]=PLFLofPLalphashape(PL,[r])
% === INPUT PARAMETERS ===
% PL: Original Point cloud
% r: optional radius for alphashape triangulation
% === OUTPUT RESULTS ======
% PL: Point list (doubled entries removed)
% FL: Facet List
% CPL: Closed Polygon List of contour (endpoint=startpoint)
% EL: Edge list of free boundary sorted
% CEL: Contour index list
%
% EXAMPLE:
% pc=PCofSG(SGsample(25),30000); PL=pc.Location(:,1:2);
% PLFLofPLalphashape(PL);
%
% See also: CPLofPLalphashape
%
%
% Copyright 2018 Tim C. Lueth

imageofgca(h,rs)- returns the image snapshot of the currect gca

imageofgca(h,rs)% imageofgca(h,rs) - returns the image snapshot of the currect gca
% (by Tim Lueth, VLFL-Lib, 2018-OKT-05 as class: VISUALIZATION)
%
% similar to I=getframe(gca); (Status of: 2018-10-07)
%
% Introduced first in SolidGeometry 4.3
%
% See also: getframe
%
% I=imageofgca([h,rs])
% === INPUT PARAMETERS ===
% h: optional different handle than gca such as gcf
% rs: resize parameter, see imresize
% === OUTPUT RESULTS ======
% I: Image of gca
%
% EXAMPLE:
% SGsample(25);
% imageofgca; I=ans; whos I
%
% See also: getframe
%
%
% Copyright 2018 Tim C. Lueth

PCofSG(SG,nmax,vgrid,vnoise)- returns a point cloud from a SG with defined number of points and noise

PCofSG(SG,nmax,vgrid,vnoise)% PCofSG(SG,nmax,vgrid,vnoise) - returns a point cloud from a SG with defined number of points and noise
% (by Tim Lueth, VLFL-Lib, 2018-OKT-04 as class: SR300)
%
% This recursive fnctns aborts if there is no change to create more
% points.
% To speed up this recursive procedure set vgrid to zero, other wise a
% distribution of vgrid is tried.
% The sample points are created using VLFLaddfacetcenterpoints.
%
% could be improved by an addition view point vector to use only facets
% that can be seen from a view points (Status of: 2018-10-04)
%
% Introduced first in SolidGeometry 4.3
%
% See also: VLFLaddfacetcenterpoints
%
% [pc,NL]=PCofSG(SG,[nmax,vgrid,vnoise])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% nmax: expected number of points; default is 30000
% vgrid: grid size; defaults is 1/100 of sofBB; quick response with 0
% vnoise: vertex noise in percent! 1 == 1/100 of sofBB; default is 0;
% === OUTPUT RESULTS ======
% pc: point cloud
% NL: normal vector list of point cloud
%
% EXAMPLE:
% PCofSG(SGbox([30,20,10]),3000);
% PCofSG(SGsample(25),3000);
%
%
% See also: VLFLaddfacetcenterpoints
%
%
% Copyright 2018 Tim C. Lueth

VLFLaddfacetcenterpoints(VL,FL,nn,md);- creates additional vertices in the middle of each facet

VLFLaddfacetcenterpoints(VL,FL,nn,md);% VLFLaddfacetcenterpoints(VL,FL,nn,md); - creates additional vertices in the middle of each facet
% (by Tim Lueth, VLFL-Lib, 2018-OKT-03 as class: SURFACES)
%
% the number of facets is length(FL)*3
% the number of vertices is length(VL) + length(FL)*3
% Poinct cloud of SG (Status of: 2018-10-08)
%
% Introduced first in SolidGeometry 4.3
%
% See also: PCofSG
%
% [NVL,NFL,NNVL]=VLFLaddfacetcenterpoints(VL,FL,[nn,md]);
% === INPUT PARAMETERS ===
% VL: vertex list
% FL: facet list
% nn: recursive number of calls; default is 1
% md: minimum distance between old and new points; default is 0
% === OUTPUT RESULTS ======
% NVL: New vertex list
% NFL: New facet list
% NNVL:
%
% EXAMPLE:
% A=SGbox([30,20,10]); VL=A.VL; FL=A.FL;
% VLFLaddfacetcenterpoints(VL,FL);
% VLFLaddfacetcenterpoints(VL,FL,5);
%
%
% See also: PCofSG
%
%
% Copyright 2018-2020 Tim C. Lueth

iconfilesearch(sterm)- searches and shows in the original matlab directories for icon files that contain a string term

iconfilesearch(sterm)% iconfilesearch(sterm) - searches and shows in the original matlab directories for icon files that contain a string term
% (by Tim Lueth, VLFL-Lib, 2018-OKT-03 as class: USER INTERFACE)
%
% Introduced first in SolidGeometry 4.3
%
% See also: app_2012_11_09, SGwriteIcon, iconofCPL, iconlibTL
%
% fn=iconfilesearch([sterm])
% === INPUT PARAMETERS ===
% sterm: search term of cell list of icon files
% === OUTPUT RESULTS ======
% fn: list of files within the matlab directory
%
% EXAMPLE: iconfilesearch('open'); fnames=ans
% iconfilesearch(fnames)
% iconfilesearch; a=ans
% iconfilesearch(a,'stop')
%
%
% See also: app_2012_11_09, SGwriteIcon, iconofCPL, iconlibTL
%
%
% Copyright 2018-2022 Tim C. Lueth

PCofVL(VL)- returns a points cloud including NL from Vertex List

PCofVL(VL)% PCofVL(VL) - returns a points cloud including NL from Vertex List
% (by Tim Lueth, VLFL-Lib, 2018-OKT-02 as class: SR300)
%
% Introduced first in SolidGeometry 4.3
%
% See also: PCofVL, PCplot, PCfindplanes
%
% pc=PCofVL(VL)
% === INPUT PARAMETERS ===
% VL: Vertex list
% === OUTPUT RESULTS ======
% pc: point cloud including normals
%
% EXAMPLE:
% loadweb ('AAruffo_surf.mat'); pc=PCofVL(SG1.VL);
%
% See also: PCofVL, PCplot, PCfindplanes
%
%
% Copyright 2018 Tim C. Lueth

PCfindradiusangle(pc,i,amax,rmax)- returns vertices and facets of surface near a point of a point cloud

PCfindradiusangle(pc,i,amax,rmax)% PCfindradiusangle(pc,i,amax,rmax) - returns vertices and facets of surface near a point of a point cloud
% (by Tim Lueth, VLFL-Lib, 2018-OKT-02 as class: SR300)
%
% Introduced first in SolidGeometry 4.3
%
% See also: findNeighborsInRadius, findNearestNeighbors
%
% [VL,FL]=PCfindradiusangle(pc,i,[amax,rmax])
% === INPUT PARAMETERS ===
% pc: point cloud
% i: index in point cloud
% amax: allowed angle deviation of vertex in radiant; default is pi/4
% rmax: radius to consider around vertex i; default is 10000
% === OUTPUT RESULTS ======
% VL: Vertex list
% FL: Facet list
%
% EXAMPLE:
% loadweb ('AAruffo_surf.mat'); pc=PCofVL(SG1.VL);
% PCfindradiusangle (pc,7000,pi/1.3,200)
% PCfindradiusangle (pc,300)
% PCofSG(SGsample(25),3000,.2,0); pc=ans;
% PCfindradiusangle (pc,300,pi/2)
%
%
% See also: findNeighborsInRadius, findNearestNeighbors
%
%
% Copyright 2018 Tim C. Lueth

PCplot(PC)- plots a point cloud or a cell list of point clouds without any registration

PCplot(PC)% PCplot(PC) - plots a point cloud or a cell list of point clouds without any registration
% (by Tim Lueth, VLFL-Lib, 2018-OKT-01 as class: SR300)
%
% Introduced first in SolidGeometry 4.3
%
% See also: PCofVL, PCfindplanes
%
% PCplot(PC)
% === INPUT PARAMETERS ===
% PC: cell list of point clouds
%
% EXAMPLE:
% SR300getPointclouds(10); PC=ans;
% PCplot(PC)
%
% See also: PCofVL, PCfindplanes
%
%
% Copyright 2018 Tim C. Lueth

SGfiguretopbuttons(nrx,callback,bstyle,icfile,bsize,tiptext)- creates a button row in the current figure

SGfiguretopbuttons(nrx,callback,bstyle,icfile,bsize,tiptext)% SGfiguretopbuttons(nrx,callback,bstyle,icfile,bsize,tiptext) - creates a button row in the current figure
% (by Alexandra Mercader, VLFL-Lib, 2018-OKT-01 as class: USER INTERFACE)
%
% The fnctn is based on the concept of uibuttongroup and uicontrol. It
% supports the
% 'Style',
% 'CData',
% 'Callback'
% 'Tooltip'
%
% (Status of: 2018-10-01)
%
% See also: uibuttongroup, uicontrol
%
% [hf]=SGfiguretopbuttons(nrx,[callback,bstyle,icfile,bsize,tiptext])
% === INPUT PARAMETERS ===
% nrx: Nr of the
% callback: desired fnctn to call if pressed; default is 'beep'
% bstyle: button style; default is 'pushbutton'
% icfile: icon file or text
% bsize: button size
% tiptext: description text at tool tip
% === OUTPUT RESULTS ======
% [hf]:
%
% EXAMPLE:
% SGfigure;
% SGfiguretopbuttons(1:3,'','','test',100,'helptext');
% SGfiguretopbuttons(2,'','','warning.gif',100,'Makes Beep');
%
% See also: uibuttongroup, uicontrol
%

iconlibs- returns MATLAB Iconslibs

iconlibs% iconlibs - returns MATLAB Iconslibs
% (by Alexandra Mercader, VLFL-Lib, 2018-OKT-01 as class: USER INTERFACE)
%
% See also: app_2012_11_09, SGwriteIcon, iconfilesearch, iconofCPL,
% iconlibTL
%
% iconlibs
%
% See also: app_2012_11_09, SGwriteIcon, iconfilesearch, iconofCPL,
% iconlibTL
%

PCfindplanes(PC)- EXPERIMENT TO SHOW THE PLANES IN AN IMAGE

PCfindplanes(PC)% PCfindplanes(PC) - EXPERIMENT TO SHOW THE PLANES IN AN IMAGE
% (by Tim Lueth, VLFL-Lib, 2018-SEP-26 as class: EXPERIMENTS)
%
% Introduced first in SolidGeometry 4.3
%
% See also: PCofVL, PCplot
%
% PCfindplanes(PC)
% === INPUT PARAMETERS ===
% PC:
%
% See also: PCofVL, PCplot
%
%
% Copyright 2018 Tim C. Lueth

SR300getVLFL(zl)- returns a surface from the surface camera

SR300getVLFL(zl)% SR300getVLFL(zl) - returns a surface from the surface camera
% (by Tim Lueth, VLFL-Lib, 2018-SEP-26 as class: SR300)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SR300install, SR300stop, SR300start, SR300depthimage,
% SR300videoimage, SR300allimages, SR300getVL
%
% SG=SR300getVLFL([zl])
% === INPUT PARAMETERS ===
% zl: zlimitation; default is 400
% === OUTPUT RESULTS ======
% SG: Struct with vertices VL and Facets FL
%
% EXAMPLE:
% SR300getVLFL; SG=ans;
% SGfigure; SGplot(SG); view(-180,-90);
%
% See also: SR300install, SR300stop, SR300start, SR300depthimage,
% SR300videoimage, SR300allimages, SR300getVL
%
%
% Copyright 2018 Tim C. Lueth

bplot(VL,bs,)- plots grid boxes at a desired position

bplot(VL,bs,)% bplot(VL,bs,) - plots grid boxes at a desired position
% (by Tim Lueth, VLFL-Lib, 2018-SEP-25 as class: VISUALIZATION)
%
% Introduced first in SolidGeometry 4.3
%
% See also: aplot, pplot, lplot, tfplot, tlplot, slplot, plotTP, plotL,
% plotT, T2Plot, textP, textT, textVL
%
% h=bplot(VL,bs,[])
% === INPUT PARAMETERS ===
% VL: Vertex list
% bs: Box size
% === OUTPUT RESULTS ======
% h: handle to graphics object
%
% EXAMPLE:
% SGfigure; h=bplot([0 0 0],20,'m--',2); view(-30,30); pause(1); delete(h)
% VL=rand(10,3)*100; h=bplot(VL,20,'m--',2); view(-30,30);
%
% See also: aplot, pplot, lplot, tfplot, tlplot, slplot, plotTP, plotL,
% plotT, T2Plot, textP, textT, textVL
%
%
% Copyright 2018 Tim C. Lueth

VMofVL(VL,res)- returns a Voxel model from a vertex list

VMofVL(VL,res)% VMofVL(VL,res) - returns a Voxel model from a vertex list
% (by Tim Lueth, VLFL-Lib, 2018-SEP-24 as class: VOXELS)
%
% Introduced first in SolidGeometry 4.3
%
% See also: VLofVM, SGofVMdelaunay, SGofVMisosurface, SGofVMmarchcube
%
% [VM,vs,SG]=VMofVL(VL,[res])
% === INPUT PARAMETERS ===
% VL: Vertex list
% res: Optional resolution; default is 2m
% === OUTPUT RESULTS ======
% VM: Voxel model
% vs: size of voxel
% SG: optional Solid Geometry
%
% EXAMPLE:
% SR300getVL; VL=ans; SGfigure; VLplot(VL,'.'); view(0,-90);
% [a,b,c]=VMofVL(VL,5);
% SGc=SGsurfaces(c);
% for i=1:length(SGc); A(i)=SGarea(SGc{i}); end; Asum=sum(A); m=find(A==max(A))
% SGfigure; SGplot(SGc{m});
%
% See also: VLofVM, SGofVMdelaunay, SGofVMisosurface, SGofVMmarchcube
%
%
% Copyright 2018 Tim C. Lueth

figurerotate (mtime,angle)- rotates the current figure to show 3D effects

figurerotate (mtime,angle)% figurerotate (mtime,angle) - rotates the current figure to show 3D effects
% (by Tim Lueth, VLFL-Lib, 2018-SEP-24 as class: VISUALIZATION)
%
% by slowly rotation surfaces, even 2D surface are seen as 3D surfaces
% (Status of: 2022-05-04)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGfigurevideo, SGfiguremovie, viewsmooth, Videoquickrotate3D,
% animatego, drawnowvid
%
% figurerotate([mtime,angle])
% === INPUT PARAMETERS ===
% mtime: minimal rotation time; default is 1
% angle: rotation angle; default is 5 degree
%
% EXAMPLE:
% SGfigure(SGbox(3)); % Show a simple box
% figurerotate(5) % rotate for 5 seconds
%
%
% See also: SGfigurevideo, SGfiguremovie, viewsmooth, Videoquickrotate3D,
% animatego, drawnowvid
%
%
% Copyright 2018-2022 Tim C. Lueth

SR300allimages- returns a depth image 640x480 from the IntelRealSense300 camera

SR300allimages% SR300allimages - returns a depth image 640x480 from the IntelRealSense300 camera
% (by Tim Lueth, VLFL-Lib, 2018-SEP-24 as class: SR300)
%
% The IntelRealSense300 is very sensitive to bright ambient light and
% 50Hz fluctuations in ambient light. Dark ambient light is better than
% bright ambient light. (Status of: 2018-09-24)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SR300install, SR300stop, SR300start, SR300depthimage,
% SR300videoimage, SR300getVL
%
% [vimg,dimg,VL]=SR300allimages
% === OUTPUT RESULTS ======
% vimg: 1920 x 1080 x uint3 - color image
% dimg: 640x 480 x 3 uint8 - depth image
% VL: Vertex List of surface points - [n x 3]
%
% EXAMPLE:
% SR300start
% SR300allimages; [a,b,c]=SR300allimages; whos a, whos b , whos c
% VLmindist(c); view(-90,-90); VLplot(VL,'r.');
%
% See also: SR300install, SR300stop, SR300start, SR300depthimage,
% SR300videoimage, SR300getVL
%
%
% Copyright 2018 Tim C. Lueth

SR300videoimage- returns a video image 1920x1080 from the IntelRealSense300 camera

SR300videoimage% SR300videoimage - returns a video image 1920x1080 from the IntelRealSense300 camera
% (by Tim Lueth, VLFL-Lib, 2018-SEP-23 as class: SR300)
%
% The IntelRealSense300 is very sensitive to bright ambient light and
% 50Hz fluctuations in ambient light. Dark ambient light is better than
% bright ambient light. (Status of: 2018-09-24)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SR300install, SR300stop, SR300start, SR300depthimage,
% SR300allimages, SR300getVL
%
% [img,data]=SR300videoimage
% === OUTPUT RESULTS ======
% img: 920x1080x3 uint8
% data: original data of the camera
%
% EXAMPLE:
% SR300start
% SR300videoimage; a=ans; whos a, tic, b=imresize(a,[480,640]); toc, whos b
% imshow(rot90(b,-1))
%
% See also: SR300install, SR300stop, SR300start, SR300depthimage,
% SR300allimages, SR300getVL
%
%
% Copyright 2018 Tim C. Lueth

SR300stop- initializes the Intel RealSense 300 Scanner and creates a global struct IntelRealSense300

SR300stop% SR300stop - initializes the Intel RealSense 300 Scanner and creates a global struct IntelRealSense300
% (by Tim Lueth, VLFL-Lib, 2018-SEP-23 as class: SR300)
%
% Stops the pipline of global struct named: IntelRealSense300
% (Status of: 2018-09-24)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SR300install, SR300start, SR300depthimage, SR300videoimage,
% SR300allimages, SR300getVL
%
% SR300stop
%
% EXAMPLE:
% SR300start;
% SR300depthimage;
% SR300stop;
% SR300stop;
%
% See also: SR300install, SR300start, SR300depthimage, SR300videoimage,
% SR300allimages, SR300getVL
%
%
% Copyright 2018 Tim C. Lueth

matlabtoolboxdir- returns the default matlab add-on toolbox directory

matlabtoolboxdir% matlabtoolboxdir - returns the default matlab add-on toolbox directory
% (by Tim Lueth, VLFL-Lib, 2018-SEP-23 as class: FILE HANDLING)
%
% On mac: '/Users/lueth/Documents/MATLAB/Add-Ons/Toolboxes/'
% (Status of: 2018-09-23)
%
% Introduced first in SolidGeometry 4.3
%
% See also: desktopdir, pcodedirTL, smbFilename, smbPSLibname, workdir,
% expname, matlabdir
%
% mldir=matlabtoolboxdir
% === OUTPUT RESULTS ======
% mldir: default user matlab add-on toolbox directory
%
% EXAMPLE:
% matlabtoolboxdir, dir (matlabtoolboxdir)
%
% See also: desktopdir, pcodedirTL, smbFilename, smbPSLibname, workdir,
% expname, matlabdir
%
%
% Copyright 2018 Tim C. Lueth

matlabdir- returns the default matlab directory that is also used for custom toolboxes

matlabdir% matlabdir - returns the default matlab directory that is also used for custom toolboxes
% (by Tim Lueth, VLFL-Lib, 2018-SEP-23 as class: FILE HANDLING)
%
% On mac: '/Users/lueth/Documents/MATLAB/'
% (Status of: 2018-09-23)
%
% Introduced first in SolidGeometry 4.3
%
% See also: desktopdir, pcodedirTL, smbFilename, smbPSLibname, workdir,
% expname, matlabtoolboxdir
%
% mldir=matlabdir
% === OUTPUT RESULTS ======
% mldir: default user matlab directory
%
% EXAMPLE:
% matlabdir, dir (matlabdir)
%
% See also: desktopdir, pcodedirTL, smbFilename, smbPSLibname, workdir,
% expname, matlabtoolboxdir
%
%
% Copyright 2018 Tim C. Lueth

SR300depthimage- returns a depth image 640x480 from the IntelRealSense300 camera

SR300depthimage% SR300depthimage - returns a depth image 640x480 from the IntelRealSense300 camera
% (by Tim Lueth, VLFL-Lib, 2018-SEP-22 as class: SR300)
%
% The IntelRealSense300 is very sensitive to bright ambient light and
% 50Hz fluctuations in ambient light. Dark ambient light is better than
% bright ambient light. (Status of: 2018-09-24)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SR300install, SR300stop, SR300start, SR300videoimage,
% SR300allimages, SR300getVL
%
% [img,data]=SR300depthimage
% === OUTPUT RESULTS ======
% img: 480x640x3 uint8
% data: original data of the camera
%
% EXAMPLE:
% SR300start
% SR300depthimage
% [I,d]=SR300depthimage; whos I, whos d
% imshow(SR300depthimage);
%
% See also: SR300install, SR300stop, SR300start, SR300videoimage,
% SR300allimages, SR300getVL
%
%
% Copyright 2018 Tim C. Lueth

SR300install- downloads from TUM-MIMED the Intel Realsense +300 driver and installs it on MAC or WIN

SR300install% SR300install - downloads from TUM-MIMED the Intel Realsense +300 driver and installs it on MAC or WIN
% (by Tim Lueth, Christian Dietz, Samuel Detzel , VLFL-Lib, 2018-SEP-18
% as class: SR300)
%
% After calling this fnctn once (takes about 5 seconds), you should be
% able to connect the Sensor using the USB cable an to use it immedeatly
% with Matlab.
% Samuel Detzel and Christian Dietz prepared a zip file on the TUM Mimed
% www-Server that can be downloaded and automatically installed by this
% fnctn for Mac and Win.
% There are also 2 fnctns: SR300depth_example and SR300pointcloud_example
% in the downloaded ZIP file.
% Nevertheless, the SR300 is integrated into the SG-Lib 4.3 and therefor
% all other fnctn belong to the SR-Lib Toolbox.
% See also at:
% https://www.mouser.de/pdfdocs/intel_realsense_camera_sr300.pdf
% (Status of: 2018-09-24)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SR300install, SR300stop, SR300start, SR300depthimage,
% SR300videoimage, SR300allimages, SR300getVL
%
% SR300install
%
% EXAMPLE:
% SR300install
% SR300depth_example
%
% See also: SR300install, SR300stop, SR300start, SR300depthimage,
% SR300videoimage, SR300allimages, SR300getVL
%
%
% Copyright 2018 Tim C. Lueth

SR300start- initializes the Intel RealSense 300 Scanner and creates a global struct IntelRealSense300

SR300start% SR300start - initializes the Intel RealSense 300 Scanner and creates a global struct IntelRealSense300
% (by Samuel Detzel, VLFL-Lib, 2018-SEP-17 as class: SR300)
%
% (Takes at least 3 seconds!)
% This fnctn uses the "librealsense2 class library" developed by by Lior
% Ramati, lior.ramati@intel.com, which was downloaded from
% https://github.com/IntelRealSense/librealsense in September 2018.
% Some additional required file for simple Matlab inetgration on
% PC/MAC/Linux were added by Samuel Detzel and Christian Dietz at TU
% Munich. The complete package can be downloaded by the command
% SR3300install which is located at matlab crentral.
% The classe library is located in the directory +realsense.
% The global variable is named: IntelRealSense300
% (Status of: 2018-09-24)
%
% See also: SR300install, SR300stop, SR300depthimage, SR300videoimage,
% SR300allimages, SR300getVL
%
% SR300start
%
% EXAMPLE:
% SR300start
% SR300getVL
% VL=SR300getVL; SGfigure; VLplot(VL,'.'); view(0,-90);
% SGfiguremovie
% SGofVLalphaShape(VL,5)
%
% See also: SR300install, SR300stop, SR300depthimage, SR300videoimage,
% SR300allimages, SR300getVL
%

SR300getVL(zlim)- return a VL of the currect Realsesen

SR300getVL(zlim)% SR300getVL(zlim) - return a VL of the currect Realsesen
% (by Samuel Detzel and Tim Lueth, VLFL-Lib, 2018-SEP-17 as class: SR300)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SR300install, SR300stop, SR300start, SR300depthimage,
% SR300videoimage, SR300allimages
%
% [VL,VLA]=SR300getVL([zlim])
% === INPUT PARAMETERS ===
% zlim: depth limit for taken z values
% === OUTPUT RESULTS ======
% VL: Vertex List of selected depth
% VLA: Complete Vertex List
%
% EXAMPLE:
% SR300start
% SR300getVL
% VL=SR300getVL; SGfigure; VLplot(VL,'.'); view(0,-90);
% SGfiguremovie
% SGofVLalphaShape(VL,5)
%
% See also: SR300install, SR300stop, SR300start, SR300depthimage,
% SR300videoimage, SR300allimages
%
%
% Copyright 2018 Tim C. Lueth

togglefig- toggels the position of the current SGfigure

togglefig% togglefig - toggels the position of the current SGfigure
% (by Tim Lueth, VLFL-Lib, 2018-SEP-15 as class: VISUALIZATION)
%
% moves a figure by the first call to a default position and at second
% back to the original position (Status of: 2018-09-15)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGfigure, copyfig, SGfigureannotation, SGfiguremovie, subfig,
% fullview, pastego, copygo
%
% togglefig
%
% EXAMPLE:
% SGfigure; set (gcf,'Position',[100 200 300 400]);
% togglefig; pause(1); togglefig; pause(1); togglefig
%
% See also: SGfigure, copyfig, SGfigureannotation, SGfiguremovie, subfig,
% fullview, pastego, copygo
%
%
% Copyright 2018-2019 Tim C. Lueth

camlightTL- deletes all camlights and set three new

camlightTL% camlightTL - deletes all camlights and set three new
% (by Tim Lueth, VLFL-Lib, 2018-SEP-15 as class: VISUALIZATION)
%
% 2020-08-25 modified and successfully tested for Matlab2020aUpd5
% camlight('headlight','infinite'); ...
% camlight('right','infinite');...
% camlight('left','infinite');]; (Status of: 2020-07-03)
%
% Introduced first in SolidGeometry 4.3
%
% See also: camlightTL, camplot, camset, selectCameraPosition, showcam,
% tcamera, Tofcam, TofcamVLPL, VLFLcamlight, rotate3dlight
%
% h=camlightTL
% === OUTPUT RESULTS ======
% h: handle to three camlights
%
% EXAMPLE:
% SGfigure; SGplot(SGbox(4)); view(-30,30);
% camlightTL
%
% See also: camlightTL, camplot, camset, selectCameraPosition, showcam,
% tcamera, Tofcam, TofcamVLPL, VLFLcamlight, rotate3dlight
%
%
% Copyright 2018-2020 Tim C. Lueth

VLFLcheckselfintersection(VL,FL,csep)- checks an returns the number of self intersecting facets

VLFLcheckselfintersection(VL,FL,csep)% VLFLcheckselfintersection(VL,FL,csep) - checks an returns the number of self intersecting facets
% (by Tim Lueth, VLFL-Lib, 2018-SEP-14 as class: CHECKING PROCEDURES)
%
% Introduced first in SolidGeometry 4.3
%
% See also: VLFLchecknonmanifoldedges, VLFLchecknonmanifoldvertices,
% VLFLcheckmeshlab, VLofVLFLselfIntersection
%
% [n,d]=VLFLcheckselfintersection(VL,FL,[csep])
% === INPUT PARAMETERS ===
% VL: Vertex list or SG
% FL: Facet List
% csep: separate solids before check {true,false}; default is false
% === OUTPUT RESULTS ======
% n: number of facets
% d: facets list
%
% EXAMPLE:
% VLFLcheckselfintersection(SGsample(36))
% VLofVLFLselfIntersection(SGsample(17),'',true)
% VLofVLFLselfIntersection(SGsample(17),'',false)
%
% See also: VLFLchecknonmanifoldedges, VLFLchecknonmanifoldvertices,
% VLFLcheckmeshlab, VLofVLFLselfIntersection
%
%
% Copyright 2018 Tim C. Lueth

ismemberFL(FLA,FLB)- returns ismember for all three possibilities of a facet list

ismemberFL(FLA,FLB)% ismemberFL(FLA,FLB) - returns ismember for all three possibilities of a facet list
% (by Tim Lueth, VLFL-Lib, 2018-SEP-14 as class: EDGE LISTS)
%
%
%
% (Status of: 2018-09-14)
%
% Introduced first in SolidGeometry 4.3
%
% See also: ismember, ismembertol
%
% im=ismemberFL(FLA,FLB)
% === INPUT PARAMETERS ===
% FLA: Facet List A
% FLB: Facet List B
% === OUTPUT RESULTS ======
% im: ismember result
%
% EXAMPLE:
% FLA=[1 2 3; 4 5 6; 7 8 9]; FLB=[2 3 1; 6 5 4; 9 7 8];
% ismemberFL(FLA,FLB)
%
% See also: ismember, ismembertol
%
%
% Copyright 2018 Tim C. Lueth

VLNLplot(VL,NL,vi,c,w)- plots a normal vector list at a vertex list

VLNLplot(VL,NL,vi,c,w)% VLNLplot(VL,NL,vi,c,w) - plots a normal vector list at a vertex list
% (by Tim Lueth, VLFL-Lib, 2018-SEP-13 as class: ANALYTICAL GEOMETRY)
%
% Introduced first in SolidGeometry 4.3
%
% See also: VLplot, VLELplot, VLELplots, VLplotmotion, VLFLplot,
% VLFLplotfacets, PLplot, PLELplot, CVLplot, CVLplots
%
% h=VLNLplot(VL,NL,[vi,c,w])
% === INPUT PARAMETERS ===
% VL: Vertex list
% NL: Normal vector list
% vi: optional index selector
% c: optional color and line
% w: optional line thickness
% === OUTPUT RESULTS ======
% h: handle to plot
%
% EXAMPLE:
% A=SGsample(5); NL=VLFLvertexNormal(A); SGfigure; VLNLplot(A.VL,NL); view(-30,30)
% VL=rand(100,3)*10; NL=rand(100,3); SGfigure; h=VLNLplot(VL,NL,1:10,'m.-',1)
%
% See also: VLplot, VLELplot, VLELplots, VLplotmotion, VLFLplot,
% VLFLplotfacets, PLplot, PLELplot, CVLplot, CVLplots
%
%
% Copyright 2018 Tim C. Lueth

VLFLsmoothboundary(VL,FL,al,lr,al2,be)- creates facets to smoothen or closing open boundaries without adding points

VLFLsmoothboundary(VL,FL,al,lr,al2,be)% VLFLsmoothboundary(VL,FL,al,lr,al2,be) - creates facets to smoothen or closing open boundaries without adding points
% (by Tim Lueth, VLFL-Lib, 2018-SEP-12 as class: SURFACES)
%
% This fnctn is a recursive fnctn with valuable parameters.
% First Parameter 'al' is the bend angle of two edges at a corner point.
% al' indicates which is the minimum bend angle at which two edges may be
% closed by a triangle. If the angle is small, almost straight lines are
% closed by a surface.
% The second parameter "lr" excludes triangles when closing, if the edge
% lengths do not correspond to special criteria. "lr" specifies the
% maximum length ratio of the two legs of a triangle that may still be
% closed. If "lr" is less than zero, abs(lr) is the absolute maximum
% length of the trough in millimeters. If "lr" is exactly zero, then the
% longer of the two legs must not exceed the mean value of all triangular
% distances (automatic mode).
% The third parameter 'al2' also restricts the triangles to be closed.
% Triangles with too little kink angle are not closed if the knee angle
% is smaller than 'al2'.
% The fourth parameter "be" also restricts the triangles to be closed. It
% defines the surface angle difference, i.e. the orientation of the
% surface relative to the already existing surfaces. The larger the angle
% "be" is, the straighter the triangle walls are which are still allowed
% to close. If "be" > pi/1.5 is selected, there are almost only straight
% edges left. If "be" is ~ pi/2, then edges with surfaces can be closed
% at right angles.
% (Status of: 2018-09-15)
%
% Introduced first in SolidGeometry 4.3
%
% See also: VLFLremoveIntersectFacets
%
% [FL,NFL]=VLFLsmoothboundary(VL,FL,[al,lr,al2,be])
% === INPUT PARAMETERS ===
% VL: Vertex list
% FL: Facet list
% al: closing if edge angle is > al; default is pi/4
% lr: leg length maximum ratio; default is 1.5
% al2: minimal angle value for closing; default is 0;
% be: required distance angle to parallel walls
% === OUTPUT RESULTS ======
% FL: List of old and appended new facets
% NFL: List of New facets
%
% EXAMPLE:
% loadweb AAruffo_surf.mat % load some surface data sets
% A=SG1; VLFLsmoothboundary(A.VL,A.FL);
% A=SG1; VLFLsmoothboundary(A.VL,A.FL,0.01,1000,0,0); % Close all angles - too simple approach
% A=SG1; VLFLsmoothboundary(A.VL,A.FL,0.01,1000,0,pi/1.3); % Close all angles if walls are straight
% A=SG1; VLFLsmoothboundary(A.VL,A.FL,0.01,0,0,pi/1.3); % Close angles of similar size/wall straight
% A=SG1; VLFLsmoothboundary(A.VL,A.FL,0,0,0.5,pi/1.3); % Avoid closing straight lines
% A=SG1; VLFLsmoothboundary(A.VL,A.FL,0,-10,0.5,pi/1.3); % Close up tom 10mm leg length
%
% See also: VLFLremoveIntersectFacets
%
%
% Copyright 2018 Tim C. Lueth

finddoubledrows(VL)- returns the indices of the lines with copies of a earlier row

finddoubledrows(VL)% finddoubledrows(VL) - returns the indices of the lines with copies of a earlier row
% (by Tim Lueth, VLFL-Lib, 2018-SEP-11 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.3
%
% See also: flipvar
%
% c=finddoubledrows(VL)
% === INPUT PARAMETERS ===
% VL: list of rows
% === OUTPUT RESULTS ======
% c: indices of the second, third, and so on, occur to be removed
%
% EXAMPLE:
% A=[7 9 8 1 2 3 4 5 3 6 4 5]';
% finddoubledrows(A), A(ans)
%
% A=[0 0; 1 0 ; 2 0; 4 0; 1 0];
% finddoubledrows(A), A(ans,:)
%
% See also: flipvar
%
%
% Copyright 2018 Tim C. Lueth

VLFLremoveIntersectFacets(VL,FL)- removes intersecting facets from a VLFL surface

VLFLremoveIntersectFacets(VL,FL)% VLFLremoveIntersectFacets(VL,FL) - removes intersecting facets from a VLFL surface
% (by Tim Lueth, VLFL-Lib, 2018-SEP-11 as class: SURFACES)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGcheckmeshlab, SGintersectFacetPoints,
% VLFLinsertFacetPoints, SGisInterior, VLofVLFLselfIntersection
%
% [NFL,remi,nii]=VLFLremoveIntersectFacets(VL,FL)
% === INPUT PARAMETERS ===
% VL: Vertex list or SG
% FL: Facet List
% === OUTPUT RESULTS ======
% NFL: New Facet list
% remi: index of removed facets relative to FL
% nii: index of not intersecting facets relative to FL
%
% EXAMPLE:
% A=SGreadSTL('/Volumes/LUETH-WIN/WIN AIM Matlab Libraries/STL Files for SG-Lib/Herzklappe Patient.STL')
% VLFLremoveIntersectFacets(A.VL,A.FL);
%
% A=SGsample(36)
% VLFLremoveIntersectFacets(A.VL,A.FL);
%
% See also: SGcheckmeshlab, SGintersectFacetPoints,
% VLFLinsertFacetPoints, SGisInterior, VLofVLFLselfIntersection
%
%
% Copyright 2018 Tim C. Lueth

ezof3P(VL)- returns ez and R for 3 Point Rotation Matrix

ezof3P(VL)% ezof3P(VL) - returns ez and R for 3 Point Rotation Matrix
% (by Tim Lueth, VLFL-Lib, 2018-SEP-04 as class: ANALYTICAL GEOMETRY)
%
% Same as T3P and Tof3P
% x=p2-p1; ex=p2/norm(x);
% z=cross(x,p3-p1); ez=z/norm(z);
% y=cross(ez,ex); ey=y/norm(y); (Status of: 2018-09-05)
%
% Introduced first in SolidGeometry 4.3
%
% See also: TofR, TofVL, TPL, TofDPhiH, T3ofT2, T3P, T2P, Tof3P
%
% [ez,R,T]=ezof3P(VL)
% === INPUT PARAMETERS ===
% VL: Vertex List
% === OUTPUT RESULTS ======
% ez: ez vector [x y z]
% R: Rotation Matrix [ex ey ez]
% T: Transformation matrix [ex ey ez p1]
%
% EXAMPLE:
% ezof3P([0 0 0;10 0 0; 0 10 0])
%
% See also: TofR, TofVL, TPL, TofDPhiH, T3ofT2, T3P, T2P, Tof3P
%
%
% Copyright 2018-2021 Tim C. Lueth

CVLofSGfreeboundary(SG)- returns the closed vertex list for all open surfaces

CVLofSGfreeboundary(SG)% CVLofSGfreeboundary(SG) - returns the closed vertex list for all open surfaces
% (by Tim Lueth, VLFL-Lib, 2018-SEP-04 as class: SURFACES)
%
% Same as CVLofopenfaces. This fnctn is more or less for testing
% purposes. The fnctn VLFLcorrectdoubledvertex is called first, since
% otherwise it makes no sense to detect open surfaces (Status of:
% 2018-09-04)
%
% Introduced first in SolidGeometry 4.3
%
% See also: CVLofopenfaces, SGcheckboundaryedges
%
% CVL=CVLofSGfreeboundary(SG)
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% === OUTPUT RESULTS ======
% CVL: Closed Vertex List
%
% EXAMPLE:
% loadweb JACO_robot.mat; A=SGseparate(JC2,2)
% CVLofopenfaces(A.VL,A.FL);
%
% loadweb AAruffo_surf.mat % load some surface data sets
% CVLofSGfreeboundary(SG1);
%
%
% See also: CVLofopenfaces, SGcheckboundaryedges
%
%
% Copyright 2018 Tim C. Lueth

VLcheckboundaryaccuracy(VL,FL)- returns the sufficient number of digits for rounding to achieve minimal open boundaries

VLcheckboundaryaccuracy(VL,FL)% VLcheckboundaryaccuracy(VL,FL) - returns the sufficient number of digits for rounding to achieve minimal open boundaries
% (by Tim Lueth, VLFL-Lib, 2018-SEP-01 as class: SURFACES)
%
% This fnctn VLcheckboundaryaccuracy tries to round the points of the
% vertexlist (to press on a grid) in such a way that there are as few
% free / open surface edges as possible. The older fnctn
% VLcheckvertexaccuracy tries to guarantee the distance between vertices.
% otab format: [rounding digits nr-of-edges nr-of-groups] (Status of:
% 2018-09-01)
%
% Introduced first in SolidGeometry 4.3
%
% See also: VLcheckvertexaccuracy, SGchecknonmanifoldedges,
% SGchecknonmanifoldvertices, SGcheckmeshlab, SGcheckVLaccuracy
%
% [otab,SGN]=VLcheckboundaryaccuracy(VL,FL)
% === INPUT PARAMETERS ===
% VL: Original Vertex List or SG
% FL: Original Facet List
% === OUTPUT RESULTS ======
% otab: full table of significant vertex distances after rounding
% SGN: corrected Solid Geometry
%
% EXAMPLE: loadweb JACO_robot.mat
% VLcheckboundaryaccuracy(JC2);
% VLcheckboundaryaccuracy(JACO);
% otab=VLcheckboundaryaccuracy(JC2); JC2.VL=round(JC2.VL,otab(1,1));
%
%
% See also: VLcheckvertexaccuracy, SGchecknonmanifoldedges,
% SGchecknonmanifoldvertices, SGcheckmeshlab, SGcheckVLaccuracy
%
%
% Copyright 2018 Tim C. Lueth

VLcheckvertexaccuracy(VLorg)- returns the sufficient number of digits for rounding the vertex coordinates of a solid

VLcheckvertexaccuracy(VLorg)% VLcheckvertexaccuracy(VLorg) - returns the sufficient number of digits for rounding the vertex coordinates of a solid
% (by Tim Lueth, VLFL-Lib, 2018-AUG-30 as class: SURFACES)
%
% This fnctn takes time since it works iterative manner.
% Before using SGchecknonmanifoldedges, SGchecknonmanifoldvertices,
% SGcheckmeshlab it makes sense to find out what the accuracy of the STL
% generating process was. (Status of: 2018-09-01)
%
% Introduced first in SolidGeometry 4.3
%
% See also: VLcheckboundaryaccuracy, SGchecknonmanifoldedges,
% SGchecknonmanifoldvertices, SGcheckmeshlab, SGcheckVLaccuracy
%
% atab=VLcheckvertexaccuracy(VLorg)
% === INPUT PARAMETERS ===
% VLorg: Original Vertex List
% === OUTPUT RESULTS ======
% atab: full table of significant vertex distances after rounding
%
% EXAMPLE: loadweb JACO_robot.mat
% VLcheckvertexaccuracy(JC2);
% VLcheckvertexaccuracy(JC2.VL);
% atab=VLcheckvertexaccuracy(JC2.VL), JC2.VL=round(JC2.VL,atab(1,1)); % First Correction
% atab=VLcheckvertexaccuracy(JC2.VL), JC2.VL=round(JC2.VL,atab(1,1)); % No further correction
%
%
% See also: VLcheckboundaryaccuracy, SGchecknonmanifoldedges,
% SGchecknonmanifoldvertices, SGcheckmeshlab, SGcheckVLaccuracy
%
%
% Copyright 2018 Tim C. Lueth

SGshortopti(SG,otyp)- returns the vertex list with optimal number of loss less reduced vertices

SGshortopti(SG,otyp)% SGshortopti(SG,otyp) - returns the vertex list with optimal number of loss less reduced vertices
% (by Tim Lueth, VLFL-Lib, 2018-AUG-30 as class: AUXILIARY PROCEDURES)
%
% Some CAD Systems creates STL files that have different vertex
% coordinates for the same vertices because of inaccuracies. This fnctn
% uses VLcheckvertexaccuracy to find the optimal grid for loss less
% optimization
% This fnctn should be used after the first readin of an exported STL
% file. Afterwards it makes sense to check the file using SGcheckmeshlab
% (Status of: 2018-09-01)
%
% Introduced first in SolidGeometry 4.3
%
% See also: VLcheckvertexaccuracy, SGshort, VLcheckboundaryaccuracy,
% SGcheckmeshlab
%
% SGN=SGshortopti(SG,[otyp])
% === INPUT PARAMETERS ===
% SG: Original SG
% otyp: optimization type: 'vertex' or 'boundary'
% === OUTPUT RESULTS ======
% SGN: SG.VL, SG.FL with optimal number of loss less reduced vertices
%
% EXAMPLE:
% load JACO_robot.mat
% SGshortopti(JC2)
% SGshortopti(JC2,'vertex')
% SGshortopti(JC2,'boundary')
%
%
% See also: VLcheckvertexaccuracy, SGshort, VLcheckboundaryaccuracy,
% SGcheckmeshlab
%
%
% Copyright 2018 Tim C. Lueth

SGrepairnonmanifoldvertices(SG)- returns a solid without non manfold vertices

SGrepairnonmanifoldvertices(SG)% SGrepairnonmanifoldvertices(SG) - returns a solid without non manfold vertices
% (by Tim Lueth, VLFL-Lib, 2018-AUG-30 as class: EXPERIMENTS)
%
% Non manifold vertices are vertices that are shared in separate surface
% models. This can only exist if there are several separate surface
% models in a VLFL structure. SGsurfaceplot/SGseparate would display
% multiple surfaces.
% Current method: For the vertices that have been used several times, the
% respective surface normal vector is calculated separately in each
% surface and the vertex is slightly shifted in the opposite direction.
% This separates the surface when they have had a different orientation.
% ATTENTION: Meshlab consideres points with a distance less than 1e-4 as
% identical!
%
% There are different strategies to resolve the non manifold vertices.
% a) Disconnect and insert a distance
% b) Separate and slide the surfaces into each other
% c) Separate and then selectively connect using additional points to
% form a link or several common points, i.e. a link of length zero.
% (Status of: 2018-09-05)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGshortopti, exp_2018_08_25_nonmanedge,
% exp_2018_08_25_nonmanvert
%
% SGc=SGrepairnonmanifoldvertices(SG)
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% === OUTPUT RESULTS ======
% SGc: Resulting Geometries as cells
%
% EXAMPLE:
% loadweb JACO_robot.mat;
% SGrepairnonmanifoldvertices(JC3)
% SGrepairnonmanifoldvertices(SGshortopti(JC3,'boundary'))
% SGrepairnonmanifoldvertices(J63)
% SGrepairnonmanifoldvertices(SGSample(37))
%
% See also: SGshortopti, exp_2018_08_25_nonmanedge,
% exp_2018_08_25_nonmanvert
%
%
% Copyright 2018 Tim C. Lueth

VLunidirect(VL,thr)- returns a unidirected vector ist

VLunidirect(VL,thr)% VLunidirect(VL,thr) - returns a unidirected vector ist
% (by Tim Lueth, VLFL-Lib, 2018-AUG-26 as class: AUXILIARY PROCEDURES)
%
% Occasionally in a list of vectors only the direction of a vector is
% important and not its sign. This fnctn removes the duplication of
% vectors and always takes the first occurrence of this vector for
% copies. (Status of: 2018-08-28)
%
% Introduced first in SolidGeometry 4.3
%
% See also: VLnorm, VLdistance
%
% [NL,ri]=VLunidirect(VL,[thr])
% === INPUT PARAMETERS ===
% VL: Vector list
% thr: number of relevant digits for round; default is 5
% === OUTPUT RESULTS ======
% NL: Reduced Vector list
% ri: removal index list
%
% EXAMPLE:
% VL=[1 0 0;-1 0 0; 0 1 0; 0 -1 0; 0 0 1; 0 0 -1;1 -1 0; -1 1 0.00001],
% VLunidirect(VL,3)
% VLunidirect(VL,5)
%
% See also: VLnorm, VLdistance
%
%
% Copyright 2018 Tim C. Lueth

exp_2018_08_25_nonmanedge (SG)- EXPERIMENT to repair non manifold vertices of TWO OR MORE Surfaces

exp_2018_08_25_nonmanedge (SG)% exp_2018_08_25_nonmanedge (SG) - EXPERIMENT to repair non manifold vertices of TWO OR MORE Surfaces
% (by Tim Lueth, VLFL-Lib, 2018-AUG-25 as class: EXPERIMENTS)
%
% This fnctn does not handle the case of a self touching surface such as
% SGsample(35)
%
% Non manifold edges are edges that are used by two surfaces
% simultaneously, i.e. two two points are common to the connecting edge.
% In contrast to non manifold vertices, the surfaces can no longer be
% identified as separate surfaces. To solve the problem, the two points
% and the edge must be duplicated. This raises the question of which of
% the facets that connect to the edge belongs to one of the two bodies.
% Only when this question has been clarified can the bodies be separated.
%
% Current method: First, all areas hanging on all non manifold edges are
% determined. These surfaces fc are removed and the remaining surfaces of
% the original body now disintegrate into different bodies. The surfaces
% fc are now assigned to these separated bodies again. For the
% calculation of the shift vector of the points of the edge only the
% surfaces of fc are used, which are assigned to the respective body.
% Each body thus receives different displacement vectors for the two
% points. For each body and each point the sum of the shifts is
% calculated again. Then a new point is created in the VL for each body
% and point, which corresponds to a copy of the old point plus the
% displacement vector. The list of points is only extended. The
% superfluous points remain in the list. (Status of: 2018-08-27)
%
% Introduced first in SolidGeometry 4.3
%
% See also: exp_2018_08_25_nonmanvert
%
% exp_2018_08_25_nonmanedge(SG)
% === INPUT PARAMETERS ===
% SG: Solid Geometry
%
% EXAMPLE:
% exp_2018_08_25_nonmanedge(SGsample(14))
% exp_2018_08_25_nonmanedge(SGsample(37)) % one non manifold vertex of two solids
% exp_2018_08_25_nonmanedge(SGsample(38)) % one non manifold edges of two solids
% exp_2018_08_25_nonmanedge(SGsample(39)) % two non manifold edges of three solids
% exp_2018_08_25_nonmanedge(SGsample(40)) % two non manifold edges of three solids
%
% See also: exp_2018_08_25_nonmanvert
%
%
% Copyright 2018 Tim C. Lueth

exp_2018_08_25_nonmanvert(SG)- EXPERIMENT to repair non manifold vertices

exp_2018_08_25_nonmanvert(SG)% exp_2018_08_25_nonmanvert(SG) - EXPERIMENT to repair non manifold vertices
% (by Tim Lueth, VLFL-Lib, 2018-AUG-25 as class: EXPERIMENTS)
%
% Non manifold vertices are vertices that are shared in separate surface
% models. This can only exist if there are several separate surface
% models in a VLFL structure. SGsurfaceplot/SGseparate would display
% multiple surfaces.
% Current method: For the vertices that have been used several times, the
% respective surface normal vector is calculated separately in each
% surface and the vertex is slightly shifted in the opposite direction.
% This separates the surface when they have had a different orientation.
% ATTENTION: Meshlab consideres points with a distance less than 1e-4 as
% identical!
%
% There are different strategies to resolve the non manifold vertices.
% a) Disconnect and insert a distance
% b) Separate and slide the surfaces into each other
% c) Separate and then selectively connect using additional points to
% form a link or several common points, i.e. a link of length zero.
% (Status of: 2018-08-27)
%
% Introduced first in SolidGeometry 4.3
%
% See also: exp_2018_08_25_nonmanedge
%
% SGc=exp_2018_08_25_nonmanvert(SG)
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% === OUTPUT RESULTS ======
% SGc: Resulting Geometries as cells
%
% EXAMPLE:
% loadweb JACO_robot.mat;
% exp_2018_08_25_nonmanvert(JC3)
% exp_2018_08_25_nonmanvert(JC6)
% exp_2018_08_25_nonmanvert(SGsample(37))
%
% See also: exp_2018_08_25_nonmanedge
%
%
% Copyright 2018 Tim C. Lueth

VLofVLFLselfIntersection(VL,FL,sep,thr)- returns the self intersection crossing points of a Surface

VLofVLFLselfIntersection(VL,FL,sep,thr)% VLofVLFLselfIntersection(VL,FL,sep,thr) - returns the self intersection crossing points of a Surface
% (by Tim Lueth, VLFL-Lib, 2018-AUG-25 as class: SURFACES)
%
% Only original facet points are not returned
% Fnctn could be improved by returning the crossing facets (Status of:
% 2018-09-11)
%
% Introduced first in SolidGeometry 4.3
%
% See also: VLFLcheckmeshlab, SGintersectFacetPoints,
% VLFLinsertFacetPoints, SGisInterior, VLFLremoveIntersectFacets,
% VLFLcheckselfintersection
%
% [CVL,SG,CVLi,CFi]=VLofVLFLselfIntersection(VL,FL,[sep,thr])
% === INPUT PARAMETERS ===
% VL: Vertex list
% FL: Facet list
% sep: surface separation {true,false}; default is false;
% thr: rounding threshold default is 1e-7
% === OUTPUT RESULTS ======
% CVL: Faces collision points
% SG: Cell list of Separated Geometry Surfaces
% CVLi: Cell list of faces collision points
% CFi:
%
% EXAMPLE:
% SG=SGsample(15); VLofVLFLselfIntersection (SG.VL,SG.FL);
% SG=SGsample(36); VLofVLFLselfIntersection(SG.VL,SG.FL);
% SG=SGsample(17); VLofVLFLselfIntersection(SG.VL,SG.FL,true);
% SG=SGsample(17); VLofVLFLselfIntersection(SG.VL,SG.FL,false);
%
% See also: VLFLcheckmeshlab, SGintersectFacetPoints,
% VLFLinsertFacetPoints, SGisInterior, VLFLremoveIntersectFacets,
% VLFLcheckselfintersection
%
%
% Copyright 2018 Tim C. Lueth

SGcheckmeshlab(SG,inters)- performs the most important checks for STL files

SGcheckmeshlab(SG,inters)% SGcheckmeshlab(SG,inters) - performs the most important checks for STL files
% (by Tim Lueth, VLFL-Lib, 2018-AUG-24 as class: AUXILIARY PROCEDURES)
%
% This fnctn should return the same results as the output of Meshlab from
% http://vcg.isti.cnr.it
%
% Does not currently find identical faces that overlap with opposite
% normal vectors (Status of: 2020-01-10)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGchecker, VLFLchecknonmanifoldedges,
% VLFLchecknonmanifoldvertices, VLFLcheckboundaryedges, VLFLcheckmeshlab,
% SGchecknonmanifoldedges, SGchecknonmanifoldvertices,
% SGcheckboundaryedges
%
% res=SGcheckmeshlab([SG,inters])
% === INPUT PARAMETERS ===
% SG: Solid Geoemtry
% inters:
% === OUTPUT RESULTS ======
% res: [nonmanifold-Edges nonmanifold-faces openboundary-Edges
% openboundary-Groups]
%
% EXAMPLE:
% SG=SGsample(14); SGcheckmeshlab(SG)
% SG=SGsample(35); SGcheckmeshlab(SG)
%
% See also: SGchecker, VLFLchecknonmanifoldedges,
% VLFLchecknonmanifoldvertices, VLFLcheckboundaryedges, VLFLcheckmeshlab,
% SGchecknonmanifoldedges, SGchecknonmanifoldvertices,
% SGcheckboundaryedges
%
%
% Copyright 2018-2022 Tim C. Lueth

VLFLcheckmeshlab(VL,FL,vcor,intl)- performs the most important checks for STL files

VLFLcheckmeshlab(VL,FL,vcor,intl)% VLFLcheckmeshlab(VL,FL,vcor,intl) - performs the most important checks for STL files
% (by Tim Lueth, VLFL-Lib, 2018-AUG-24 as class: AUXILIARY PROCEDURES)
%
% This fnctn should return the same results as the output of Meshlab from
% http://vcg.isti.cnr.it (Status of: 2020-01-10)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGchecker, VLFLchecknonmanifoldedges,
% VLFLchecknonmanifoldvertices, VLFLcheckboundaryedges,
% SGchecknonmanifoldedges, SGchecknonmanifoldvertices,
% SGcheckboundaryedges, SGcheckmeshlab
%
% res=VLFLcheckmeshlab(VL,FL,[vcor,intl])
% === INPUT PARAMETERS ===
% VL: Vertex list
% FL: Facet list
% vcor: map to grid; default is false
% intl: number of maximum facets for self intersection tests; default is
% 3000
% === OUTPUT RESULTS ======
% res: [nonmanifold-Edges nonmanifold-faces openboundary-Edges
% openboundary-Groups]
%
% EXAMPLE:
% SG=SGsample(14); VLFLcheckmeshlab(SG.VL,SG.FL)
% SG=SGsample(35); VLFLcheckmeshlab(SG.VL,SG.FL)
%
% See also: SGchecker, VLFLchecknonmanifoldedges,
% VLFLchecknonmanifoldvertices, VLFLcheckboundaryedges,
% SGchecknonmanifoldedges, SGchecknonmanifoldvertices,
% SGcheckboundaryedges, SGcheckmeshlab
%
%
% Copyright 2018-2020 Tim C. Lueth

SGcheckboundaryedges(SG)- returns the open boundaries of the surface

SGcheckboundaryedges(SG)% SGcheckboundaryedges(SG) - returns the open boundaries of the surface
% (by Tim Lueth, VLFL-Lib, 2018-AUG-24 as class: AUXILIARY PROCEDURES)
%
% This fnctn should return the same results as the output of Meshlab from
% http://vcg.isti.cnr.it
% more or less the same as VLFLfreeboundaryfacets
% (Status of: 2018-08-26)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGchecker, VLFLchecknonmanifoldedges,
% VLFLchecknonmanifoldvertices, VLFLcheckboundaryedges, VLFLcheckmeshlab,
% SGchecknonmanifoldedges, SGchecknonmanifoldvertices, SGcheckmeshlab
%
% [EL,CEL,fi,VL,FL]=SGcheckboundaryedges(SG)
% === INPUT PARAMETERS ===
% SG: Solid Geoemtry
% === OUTPUT RESULTS ======
% EL: Edge list of open boundaries
% CEL: CEL edge list to group EL segments
% fi: facet index list of the facets
% VL: Vertex list of SG
% FL: Facet list of SG
%
% EXAMPLE:
% loadweb JACO_robot.mat;
% SG=SGshort(JC3,1e-7); SGcheckboundaryedges(SG);
% testfunctTL('SG=SGshort(JC61,#1); SGcheckboundaryedges(SG);',power(1/10,2:15))
%
% See also: SGchecker, VLFLchecknonmanifoldedges,
% VLFLchecknonmanifoldvertices, VLFLcheckboundaryedges, VLFLcheckmeshlab,
% SGchecknonmanifoldedges, SGchecknonmanifoldvertices, SGcheckmeshlab
%
%
% Copyright 2018 Tim C. Lueth

VLFLcheckboundaryedges(VL,FL)- returns the open boundaries of the surface

VLFLcheckboundaryedges(VL,FL)% VLFLcheckboundaryedges(VL,FL) - returns the open boundaries of the surface
% (by Tim Lueth, VLFL-Lib, 2018-AUG-24 as class: AUXILIARY PROCEDURES)
%
% This fnctn should return the same results as the output of Meshlab from
% http://vcg.isti.cnr.it
% more or less the same as VLFLfreeboundaryfacets
% (Status of: 2018-08-26)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGchecker, VLFLchecknonmanifoldedges,
% VLFLchecknonmanifoldvertices, SGchecknonmanifoldedges,
% SGchecknonmanifoldvertices
%
% [EL,CEL,fi]=VLFLcheckboundaryedges(VL,FL)
% === INPUT PARAMETERS ===
% VL: Vertex List
% FL: Facet List
% === OUTPUT RESULTS ======
% EL: Edge list of open boundaries
% CEL: CEL edge list to group EL segments
% fi: facet index list of the facets
%
% EXAMPLE:
% loadweb JACO_robot.mat;
% SG=SGshort(JC3,1e-7); VLFLcheckboundaryedges(SG.VL,SG.FL);
% testfunctTL('SG=SGshort(JC3,#1); VLFLcheckboundaryedges(SG.VL,SG.FL);',power(1/10,3:15))
%
% See also: SGchecker, VLFLchecknonmanifoldedges,
% VLFLchecknonmanifoldvertices, SGchecknonmanifoldedges,
% SGchecknonmanifoldvertices
%
%
% Copyright 2018 Tim C. Lueth

SGchecknonmanifoldvertices(SG)- returns the non manifold vertices, i.e. identical points used in separated surfaces

SGchecknonmanifoldvertices(SG)% SGchecknonmanifoldvertices(SG) - returns the non manifold vertices, i.e. identical points used in separated surfaces
% (by Tim Lueth, VLFL-Lib, 2018-AUG-24 as class: AUXILIARY PROCEDURES)
%
% This fnctn should return the same results as the output of Meshlab from
% http://vcg.isti.cnr.it
% (Status of: 2018-08-24)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGchecker, VLFLchecknonmanifoldedges,
% VLFLchecknonmanifoldvertices, SGchecknonmanifoldedges
%
% [vvi,fi,VL,FL]=SGchecknonmanifoldvertices(SG)
% === INPUT PARAMETERS ===
% SG: Solid Geoemtry
% === OUTPUT RESULTS ======
% vvi: Index list of non manifold vertices / multiple used vertices
% fi: index list of faces attached to non manifold vertices
% VL: Vertex list of SG
% FL: Facet list of SG
%
% EXAMPLE:
% loadweb JACO_robot.mat;
% SG=JC3; SGchecknonmanifoldvertices(SG);
%
%
% See also: SGchecker, VLFLchecknonmanifoldedges,
% VLFLchecknonmanifoldvertices, SGchecknonmanifoldedges
%
%
% Copyright 2018 Tim C. Lueth

SGchecknonmanifoldedges(SG)- returns the edges and facets with non manifold edges

SGchecknonmanifoldedges(SG)% SGchecknonmanifoldedges(SG) - returns the edges and facets with non manifold edges
% (by Tim Lueth, VLFL-Lib, 2018-AUG-24 as class: AUXILIARY PROCEDURES)
%
% This fnctn should return the same results as the output of Meshlab from
% http://vcg.isti.cnr.it
% (Status of: 2018-08-24)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGchecker, VLFLchecknonmanifoldedges,
% VLFLchecknonmanifoldvertices, SGchecknonmanifoldvertices
%
% [NMEL,FLi,VL,FL]=SGchecknonmanifoldedges(SG)
% === INPUT PARAMETERS ===
% SG: Solid Geoemtry
% === OUTPUT RESULTS ======
% NMEL: Edge list of non manifold eges
% FLi: facet index list of problematic facets
% VL: Vertex list of SG
% FL: Facet List of SG
%
% EXAMPLE:
% SG=SGsample(14); SGchecknonmanifoldedges(SG)
% SG=SGsample(35); SGchecknonmanifoldedges(SG)
%
% See also: SGchecker, VLFLchecknonmanifoldedges,
% VLFLchecknonmanifoldvertices, SGchecknonmanifoldvertices
%
%
% Copyright 2018 Tim C. Lueth

SGmeshlab (SG,colored,RBchange)- opens a solid geoemtry in an STL viewer

SGmeshlab (SG,colored,RBchange)% SGmeshlab (SG,colored,RBchange) - opens a solid geoemtry in an STL viewer
% (by Tim Lueth, VLFL-Lib, 2018-AUG-24 as class: AUXILIARY PROCEDURES)
%
% This fnctn is used to compare checking results of the SG toolbox with
% the results of the meshalb STL viewer
% SG-Lib 4.7: The Facet colors for Red and Blue are switched because of a
% Meshlab Bug wrt. to the Materialize Standard (Status of: 2019-06-29)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGchecker, VLFLchecknonmanifoldedges,
% VLFLchecknonmanifoldvertices, SGchecknonmanifoldedges,
% SGchecknonmanifoldvertices
%
% SGmeshlab(SG,[colored,RBchange])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% colored: if true; A.FC=A.FC(:,[3 2 1]); ; default is true
% RBchange:
%
% EXAMPLE:
% SG=SGsample(35); SGmeshlab(SG); VLFLchecknonmanifoldedges(SG.VL,SG.FL);
%
% See also: SGchecker, VLFLchecknonmanifoldedges,
% VLFLchecknonmanifoldvertices, SGchecknonmanifoldedges,
% SGchecknonmanifoldvertices
%
%
% Copyright 2018-2020 Tim C. Lueth

VLFLchecknonmanifoldvertices(VL,FL);- returns the non manifold vertices, i.e. identical points used in separated surfaces

VLFLchecknonmanifoldvertices(VL,FL);% VLFLchecknonmanifoldvertices(VL,FL); - returns the non manifold vertices, i.e. identical points used in separated surfaces
% (by Tim Lueth, VLFL-Lib, 2018-AUG-24 as class: AUXILIARY PROCEDURES)
%
% This fnctn should return the same results as the output of Meshlab from
% http://vcg.isti.cnr.it
% (Status of: 2018-08-24)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGchecker, VLFLchecknonmanifoldedges
%
% [vvi,fi]=VLFLchecknonmanifoldvertices(VL,FL);
% === INPUT PARAMETERS ===
% VL: Vertex list
% FL: Facet list
% === OUTPUT RESULTS ======
% vvi: Index list of non manifold vertices / multiple used vertices
% fi: index list of faces attached to non manifold vertices
%
% EXAMPLE:
% loadweb JACO_robot.mat;
% SG=JC3; VLFLchecknonmanifoldvertices(SG.VL,SG.FL);
%
%
% See also: SGchecker, VLFLchecknonmanifoldedges
%
%
% Copyright 2018 Tim C. Lueth

VLFLchecknonmanifoldedges(VL,FL);- returns the edges and facets with non manifold edges

VLFLchecknonmanifoldedges(VL,FL);% VLFLchecknonmanifoldedges(VL,FL); - returns the edges and facets with non manifold edges
% (by Tim Lueth, VLFL-Lib, 2018-AUG-24 as class: AUXILIARY PROCEDURES)
%
% This fnctn should return the same results as the output of Meshlab from
% http://vcg.isti.cnr.it (Status of: 2018-08-24)
%
% Introduced first in SolidGeometry 4.3
%
% See also: SGchecker, VLFLchecknonmanifoldvertices
%
% [NMEL,FLi]=VLFLchecknonmanifoldedges(VL,FL);
% === INPUT PARAMETERS ===
% VL: Vertex list
% FL: Facet list
% === OUTPUT RESULTS ======
% NMEL: Edge list of non manifold eges
% FLi: facet index list of problematic facets
%
% EXAMPLE:
% SG=SGsample(14); VLFLchecknonmanifoldedges(SG.VL,SG.FL)
% SG=SGsample(35); VLFLchecknonmanifoldedges(SG.VL,SG.FL)
%
% See also: SGchecker, VLFLchecknonmanifoldvertices
%
%
% Copyright 2018 Tim C. Lueth
RapidWeaver Icon

Last Change Oct 2023 for SG-Lib 5.3