Last change of this documentation page: 2022-06-02 of SolidGeometry 4.8
CPLfillonCPLcontour (CPL,n)- finds positions for circles within a contour

CPLfillonCPLcontour (CPL,n)% CPLfillonCPLcontour (CPL,n) - finds positions for circles within a contour
% (by Tim Lueth, VLFL-Lib, 2020-JAN-05 as class: CLOSED POLYGON LISTS)
%
% For negative Values the fnctn treies to find an optimal radius
% The is fnctn is very slow than. (Status of: 2020-01-05)
%
% Introduced first in SolidGeometry 4.8
%
% See also: PLonCPLcontour, CPLfillHoneycomb, CPLfillPattern
%
% CPLfillonCPLcontour(CPL,[n])
% === INPUT PARAMETERS ===
% CPL: Closed Polygon Line
% n: circle radius or if negative number of points
%
% EXAMPLE:
% CPLfillonCPLcontour(CPLsample(29)*10,+8)
% CPLfillonCPLcontour(CPLsample(29)*10,-8)
% CPLfillonCPLcontour(CPLsample(29)*10,-15)
%
% See also: PLonCPLcontour, CPLfillHoneycomb, CPLfillPattern
%
%
% Copyright 2020 Tim C. Lueth

SGtrapezoid(r,h,rad,n)- creates trapezoid pins for moulding forms

SGtrapezoid(r,h,rad,n)% SGtrapezoid(r,h,rad,n) - creates trapezoid pins for moulding forms
% (by Tim Lueth, VLFL-Lib, 2020-JAN-05 as class: SURFACES)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGbox, SGcone, SGsphere, SGarrow, SGspherelink, SGcylinder
%
% SG=SGtrapezoid([r,h,rad,n])
% === INPUT PARAMETERS ===
% r: [rin rout]
% h: height
% rad: radial edges radius
% n: number of points on the rotation circle
% === OUTPUT RESULTS ======
% SG: Solid Geometry
%
% EXAMPLE:
% SGtrapezoid(1);
% SGtrapezoid([1 2]);
% SGtrapezoid([2 1],'','',4);
% SGtrapezoid([2 1],5,2);
%
% See also: SGbox, SGcone, SGsphere, SGarrow, SGspherelink, SGcylinder
%
%
% Copyright 2020 Tim C. Lueth

CPLremdensity(CPL,dist,glob)- removes points from a CPL or a PL that

CPLremdensity(CPL,dist,glob)% CPLremdensity(CPL,dist,glob) - removes points from a CPL or a PL that
% (by Tim Lueth, VLFL-Lib, 2020-JAN-05 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.8
%
% See also: PLonCPLcontour, CPLremstraight, CPLremstraightAmin
%
% PL=CPLremdensity(CPL,[dist,glob])
% === INPUT PARAMETERS ===
% CPL: CPL or PL
% dist: minimal distance between original points
% glob: if true; All points are considered as point cloud not as CPL
% === OUTPUT RESULTS ======
% PL: CPL with minimal distances or PL in case of a cloud
%
% EXAMPLE:
% CPLremdensity(CPLsample(29),1,true)
% CPLremdensity(CPLsample(29),1)
% CPLremdensity(CPLaddauxpoints(CPLsample(29),1),1)
%
% See also: PLonCPLcontour, CPLremstraight, CPLremstraightAmin
%
%
% Copyright 2020 Tim C. Lueth

CPLsimplify(CPL)- simplifies a CPL using polyshape

CPLsimplify(CPL)% CPLsimplify(CPL) - simplifies a CPL using polyshape
% (by Tim Lueth, VLFL-Lib, 2020-JAN-04 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.8
%
% See also: CPLofpolyshape
%
% CPLN=CPLsimplify(CPL)
% === INPUT PARAMETERS ===
% CPL: CPL
% === OUTPUT RESULTS ======
% CPLN: 'repaired' or 'simplified' CPL
%
% EXAMPLE:
% CPLsimplify(PLsample(14))
%
% See also: CPLofpolyshape
%
%
% Copyright 2020 Tim C. Lueth

PLonCPLcontour(PL,dist,remo)- findet äquidistante Punkte entlang einer Kontour

PLonCPLcontour(PL,dist,remo)% PLonCPLcontour(PL,dist,remo) - findet äquidistante Punkte entlang einer Kontour
% (by Tim Lueth, VLFL-Lib, 2020-JAN-04 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.8
%
% See also: CPLofPLgrow, CPLofPLgrowline, CPLbuffer
%
% [PL,PLX]=PLonCPLcontour(PL,[dist,remo])
% === INPUT PARAMETERS ===
% PL: CPL
% dist: distance
% remo: remove overlap; 0== NO REDUCTION; 1 DEFAULT; >1 FACTOR FOR
% DISTANCE
% === OUTPUT RESULTS ======
% PL: Point List
% PLX: Missing Point list
%
% EXAMPLE:
% PLonCPLcontour(CPLofPL(CPLbuffer(CPLsample(29),-1.1)),1); CPSplot(CPLsample(29)); % NO OVERLAP
% PLonCPLcontour(CPLofPL(CPLbuffer(CPLsample(29),-1.1)),1,0); CPSplot(CPLsample(29)); % OVERLAP
% PLonCPLcontour(CPLofPL(CPLbuffer(CPLsample(29),-1.1)),1,2); CPSplot(CPLsample(29)); %DISTANCE
%
% See also: CPLofPLgrow, CPLofPLgrowline, CPLbuffer
%
%
% Copyright 2020 Tim C. Lueth

CPLofSGcutT(SG,T,pp,rh)- separates a solid similar to SGcutT but inserts connection points

CPLofSGcutT(SG,T,pp,rh)% CPLofSGcutT(SG,T,pp,rh) - separates a solid similar to SGcutT but inserts connection points
% (by Tim Lueth, VLFL-Lib, 2020-JAN-03 as class: SURFACES)
%
% The first fnctn for this purpose was written by Simon Schiele. (Status
% of: 2020-10-04)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGcutT, SGcutTinsertpins, CPLfillonCPLcontour, PLonCPLcontour
%
% [CPL,T]=CPLofSGcutT([SG,T,pp,rh])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% T: Cutting frame; Z-Achsis spearates
% pp: points that define the selected contours of the crossing CPL
% rh: radius and height of pins
% === OUTPUT RESULTS ======
% CPL: Crossing Contour, The pins are ignored
% T: HT Matrix
%
% EXAMPLE:
% SG=SGboolh('-',SGbox([30,20,10]),SGsphere(12,'','','',8,4));
% SGfigure;SGplotalpha(SG,'',0.5);view(-30,30);
% T=TofR(rot(3,-.1,-2),[-13 -10 4]);
% CPLofSGcutT(SG,T,'',.5)
% load ADAM_Amono.mat; SG=ADAM_Amono; T=TofR([pi/2,pi,0],[75 79 87])*TofR([pi/2 0 0]);
% CPLofSGcutT(SG,T) % Cuts also the hand wrists
% CPLofSGcutT(SG,T,[0 0]) % Cuts only the Torso
%
%
% See also: SGcutT, SGcutTinsertpins, CPLfillonCPLcontour, PLonCPLcontour
%
%
% Copyright 2020 Tim C. Lueth

CPLplotbufferlines(CPL,w)- plot buffer lines for a contour

CPLplotbufferlines(CPL,w)% CPLplotbufferlines(CPL,w) - plot buffer lines for a contour
% (by Tim Lueth, VLFL-Lib, 2020-JAN-03 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.8
%
% See also: CPLbufferlines, CPLfindsmalldist
%
% h=CPLplotbufferlines([CPL,w])
% === INPUT PARAMETERS ===
% CPL: CLosed Polygon Line
% w: distance between the buffer lines, default is maximal 15 lines
% === OUTPUT RESULTS ======
% h: handle to graphics
%
% EXAMPLE:
% SGfigure; CPLplotbufferlines(CPLsample(29));
% SGfigure; CPLplotbufferlines(CPLsample(25),.1);
%
% See also: CPLbufferlines, CPLfindsmalldist
%
%
% Copyright 2020 Tim C. Lueth

CPLbufferlines(CPL,w)- returns all buffer contours with an repeated reduction value

CPLbufferlines(CPL,w)% CPLbufferlines(CPL,w) - returns all buffer contours with an repeated reduction value
% (by Tim Lueth, VLFL-Lib, 2020-JAN-03 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.8
%
% See also: CPLfindsmalldist, CPLplotbufferlines
%
% CPLC=CPLbufferlines([CPL,w])
% === INPUT PARAMETERS ===
% CPL: Closed Polygon Line
% w: reduction value
% === OUTPUT RESULTS ======
% CPLC: Cell list with {reduction value and CPL} for all repeated values
%
% EXAMPLE:
% CPLbufferlines(CPLsample(29),.5)
%
% See also: CPLfindsmalldist, CPLplotbufferlines
%
%
% Copyright 2020 Tim C. Lueth

CPLisccwcorrectedCPS(CPL,keepcolinear,simplify)- returns a CPL with all CPLs in correct orientation cw/ccw

CPLisccwcorrectedCPS(CPL,keepcolinear,simplify)% CPLisccwcorrectedCPS(CPL,keepcolinear,simplify) - returns a CPL with all CPLs in correct orientation cw/ccw
% (by Tim Lueth, VLFL-Lib, 2020-JAN-02 as class: CLOSED POLYGON LISTS)
%
% ATTENTION =THIS FNCTN REMOVES AUXPOINTS
% this fnctn use polyshape( CPL(:,1), CPL(:,2), 'simplify',true) to
% correct the orientation
% it is much faster than CPLisccwcorrected. (Status of: 2020-08-29)
%
% Introduced first in SolidGeometry 4.8
%
% See also: CPLisccwinout, CPLsortinout, CPLisccw, CPLisccwcorrected,
% CPLsetallcw
%
% CPL=CPLisccwcorrectedCPS(CPL,[keepcolinear,simplify])
% === INPUT PARAMETERS ===
% CPL: Original CPL
% keepcolinear: if true; the cpl is simplified before
% simplify: UNCHANGABLE TRUE
% === OUTPUT RESULTS ======
% CPL: Corrected CPL
%
% EXAMPLE:
% CPLsample(14); CPL=ans;
% CPLisccwcorrectedCPS(CPLsetallcw(CPL),false);
%
%
% See also: CPLisccwinout, CPLsortinout, CPLisccw, CPLisccwcorrected,
% CPLsetallcw
%
%
% Copyright 2020-2021 Tim C. Lueth

SGstentradsym(xx,d,m,mag)- creates a radial symmetric stent geometry based on a given streching ratio

SGstentradsym(xx,d,m,mag)% SGstentradsym(xx,d,m,mag) - creates a radial symmetric stent geometry based on a given streching ratio
% (by Tim Lueth, VLFL-Lib, 2020-JAN-01 as class: SURFACES)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGbendedCPL, SGbending, SGstent
%
% [SG,CPL,B]=SGstentradsym([xx,d,m,mag])
% === INPUT PARAMETERS ===
% xx: list of streching ratio; default is [5 3 3 3 3 5]
% d: outer diameter of the stent
% m: thickness of the stent material
% mag: magnification factor
% === OUTPUT RESULTS ======
% SG: Solid Geometry
% CPL: Cutting pattern for Laser
% B: Solid Geometry Approximation of the final shape
%
% EXAMPLE:
% SGstentradsym([2 2 2 2 2 2 2 2 2],10,.5)
%
% See also: SGbendedCPL, SGbending, SGstent
%
%
% Copyright 2020 Tim C. Lueth

CPLsquareline(x,y,d)- creates a sequence of boxes of different x-dimensions

CPLsquareline(x,y,d)% CPLsquareline(x,y,d) - creates a sequence of boxes of different x-dimensions
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-31 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.8
%
% See also: PLsquare, CPLstentline
%
% [CPL,cp,d]=CPLsquareline(x,y,d)
% === INPUT PARAMETERS ===
% x: vector of x-dimension of squares
% y: scalar y-dimension of the squares
% d: distance between the squares
% === OUTPUT RESULTS ======
% CPL: Closed Polygon Line
% cp: center points of the boxes.
% d: dimensions of boxes that
%
% EXAMPLE:
% CPLsquareline([1 2 3 4 5],2,1);
%
% See also: PLsquare, CPLstentline
%
%
% Copyright 2019-2020 Tim C. Lueth

SGbendedCPL(CPLN,h,ol,res)- bends a CPL pattern to a cylindric solid

SGbendedCPL(CPLN,h,ol,res)% SGbendedCPL(CPLN,h,ol,res) - bends a CPL pattern to a cylindric solid
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-31 as class: SURFACES)
%
% required for example to implement patient specific stents.
% The OUTER radius is always the (y-dimension - overlap) / 2 / pi
% (Status of: 2020-01-02)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGbending, CPLstentline, CPLstent
%
% SGB=SGbendedCPL(CPLN,[h,ol,res])
% === INPUT PARAMETERS ===
% CPLN: Contour to bend
% h: height of the material in z
% ol: overlap; default is 0
% res: resolution for CPL mesh grid; default is r/10
% === OUTPUT RESULTS ======
% SGB: Solid Geometry
%
% EXAMPLE:
% CPLstent([5 5 5 5 10 5 5 5 5],2,.5,17); X=ans;
% SGbendedCPL(X,.5)
%
% See also: SGbending, CPLstentline, CPLstent
%
%
% Copyright 2019-2020 Tim C. Lueth

CPLstent(xx,hy,dxy,ny,cut)- creates a CPL pattern for a laser cutted stent

CPLstent(xx,hy,dxy,ny,cut)% CPLstent(xx,hy,dxy,ny,cut) - creates a CPL pattern for a laser cutted stent
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-31 as class: CLOSED POLYGON LISTS)
%
% written in Grindelwald after Snowboarding at First Hill (Status of:
% 2020-01-01)
%
% Introduced first in SolidGeometry 4.8
%
% See also: CPLstentline, SGbendedCPL
%
% [CPL,cp]=CPLstent([xx,hy,dxy,ny,cut])
% === INPUT PARAMETERS ===
% xx: list with x-sizes of an odd number of stent openings; such as [5 5
% 5 5 5]
% hy: y-size of the stent openings
% dxy: material thickness of the stent pattern
% ny: odd number of repeating lines such as 1, 3, 5, etc.
% cut: if true the last repeated pattern its cut; default is true;
% === OUTPUT RESULTS ======
% CPL: Pattern of the Stent that can be used in SGbendedCPL
% cp: x coordinates of the first hole line
%
% EXAMPLE:
% CPLstent([5 5 5 5 10 5 5 5 5],2,.5,17); X=ans;
%
% See also: CPLstentline, SGbendedCPL
%
%
% Copyright 2019-2020 Tim C. Lueth

CPLstentline(x,y,d)- creates a sequence of boxes of different x-dimensions

CPLstentline(x,y,d)% CPLstentline(x,y,d) - creates a sequence of boxes of different x-dimensions
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-31 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.8
%
% See also: PLsquare, CPLsquareline
%
% [CPL1,CPL2,CPLX]=CPLstentline([x,y,d])
% === INPUT PARAMETERS ===
% x: vector of x-dimension of squares
% y: scalar y-dimension of the squares
% d: distance between the squares
% === OUTPUT RESULTS ======
% CPL1: CPL of the original x-dimension boxes separated by distance d for
% CPL2: CPL of the inbetween fitting boxes separated by distance d
% CPLX: CPL of the cutting pattern open
%
% EXAMPLE:
% CPLstentline([5 15 15 10 10 10 15 15 5],2,1);
%
% See also: PLsquare, CPLsquareline
%
%
% Copyright 2019-2020 Tim C. Lueth

vectorinBB(BB,v,p)- returns a list of integer points along a vector that are inside of a BB

vectorinBB(BB,v,p)% vectorinBB(BB,v,p) - returns a list of integer points along a vector that are inside of a BB
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-28 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.8
%
% See also: Bravaislattice
%
% [n,nn,VL]=vectorinBB([BB,v,p])
% === INPUT PARAMETERS ===
% BB: Bounding Box
% v: vector to check
% p: point to start with; default is 0
% === OUTPUT RESULTS ======
% n: rows of integer [min i max i]
% nn: row [minx maxx miny maxy minz maxz]
% VL: Vertex list including p0 if possible
%
% EXAMPLE:
% vectorinBB([0 3 0 2 0 1],[.2 .2 .2],[.5 .5 .5]) % Point inside BB and solutions exist
% vectorinBB([0 3 0 2 0 1],[.2 .2 .2],[5 5 5]) % Point outside BB and solutions exist
% vectorinBB([0 3 0 2 0 1],[0 0 0],[0 5 0]) % Point outside BB and no soltion exist
% vectorinBB([0 3 0 2 0 1],[0 0 0],[.5 .5 .5]) % Point is inside BB and only p0 exist
% vectorinBB([0 3 0 2 0 1],[0 0 1],[.5 .5 .5]) % Point is inside BB and only p0 exist
%
% See also: Bravaislattice
%
%
% Copyright 2019 Tim C. Lueth

CPLcopyBravaislattice(CPL,A,CPLS,d)- copies a contour to a normed Bravais lattice

CPLcopyBravaislattice(CPL,A,CPLS,d)% CPLcopyBravaislattice(CPL,A,CPLS,d) - copies a contour to a normed Bravais lattice
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-23 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.8
%
% See also: Bravaislattice, CPLcopypatternPL
%
% CPLB=CPLcopyBravaislattice(CPL,[A,CPLS,d])
% === INPUT PARAMETERS ===
% CPL: Contour to copy
% A: col vectors if Bravais lattice vectors
% CPLS: Optional enclosing contour
% d: additional distance between the pattern
% === OUTPUT RESULTS ======
% CPLB:
%
% EXAMPLE:
% CPLcopyBravaislattice(PLcircleoval(10,'',40),[1 0 ; .5 1],PLcircle(300));
% CPLcopyBravaislattice(PLcircleoval(10,'',20),[.6 1 ; .3 0],PLcircle(245));
%
% See also: Bravaislattice, CPLcopypatternPL
%
%
% Copyright 2019 Tim C. Lueth

Bravaislattice(A,SG)- returns a vertex list for a Bravais lattice

Bravaislattice(A,SG)% Bravaislattice(A,SG) - returns a vertex list for a Bravais lattice
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-21 as class: AUXILIARY PROCEDURES)
%
% Lattice for a Bravais equation v=n1*a1 + n2*a2 + n3*a3
% ..More complicated fnctn and slower than expected.. for this definition
% type of lattices (Status of: 2019-12-29)
%
% Introduced first in SolidGeometry 4.8
%
% See also: meshgrid, meshgridofBB, vectorinBB
%
% VL=Bravaislattice([A,SG])
% === INPUT PARAMETERS ===
% A: [a1 ;a2 ;a3] three row vectors for the Bravais equation
% SG: Solid Geometry or Bounding Box to be filled by the lattice
% === OUTPUT RESULTS ======
% VL: Vertex list of the lattice
%
% EXAMPLE:
% Bravaislattice([1 0 0; .5 .2 0; 0 .5 1]);
% Bravaislattice([1 0 0; .5 .2 0; 0 .5 .2],SGsphere([3 2 .1]));
% Bravaislattice([1 0 0; .5 .2 0; 0 .5 .2],SGsphere([3 2 1]));
% Bravaislattice([1 0 0; .5 .5 0; 0 0 0]);
% Bravaislattice([1 0 0; .5 .2 0; 0 0 0]);
% Bravaislattice([1 0 0; .5 .2 0; 0 .5 .2],SGsphere(2));
% Bravaislattice([1 0 0; .5 .2 0; 0 .5 .2],SGbox([3 2 .1]);
% Bravaislattice([1 0 0; .1 .1 .5; 0 0 1],SGtransP(SGbox([30,20,10]),[10 10 10]));
%
% See also: meshgrid, meshgridofBB, vectorinBB
%
%
% Copyright 2019 Tim C. Lueth

SGreadPLY(FName,mag,res)- reads in a Point Cloud in PLY Format an creates a surface model by marching cube

SGreadPLY(FName,mag,res)% SGreadPLY(FName,mag,res) - reads in a Point Cloud in PLY Format an creates a surface model by marching cube
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-19 as class: VERTICES / CLOUDS)
%
% Introduced first in SolidGeometry 4.8
%
% See also: http://graphics.stanford.edu/data/3Dscanrep/#bunny,
% VLreadPLY, SGreadSTL
%
% [SG,VL,ptCloud]=SGreadPLY([FName,mag,res])
% === INPUT PARAMETERS ===
% FName: File Name or Empty for interactive selection
% mag: magnification of point cloud; default is 1000
% res: resolution to avoid holes; default is 4
% === OUTPUT RESULTS ======
% SG: Solid Geoemtry
% VL: Vertex list
% ptCloud: original point cloud
%
% EXAMPLE:
% SGreadPLY('/Volumes/LUETH-WIN/WIN AIM Matlab Libraries/Point Clouds/bunny/reconstruction/bun_zipper.ply')
%
% See also: http://graphics.stanford.edu/data/3Dscanrep/#bunny,
% VLreadPLY, SGreadSTL
%
%
% Copyright 2019-2020 Tim C. Lueth

VLisInteriorofBB(BB,VL)- returns the index point list for isinterior

VLisInteriorofBB(BB,VL)% VLisInteriorofBB(BB,VL) - returns the index point list for isinterior
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-19 as class: VERTICES / CLOUDS)
%
% Could also be named BBisInterior (Status of: 2019-12-20)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGisInterior, VLDLBBofVLFL, collofBBs, VLisInteriorofBBlist
%
% vi=VLisInteriorofBB(BB,VL)
% === INPUT PARAMETERS ===
% BB: Solid Geometry or BB
% VL: Vertex List
% === OUTPUT RESULTS ======
% vi: index list for isInterior: true = isinterior
%
% EXAMPLE:
% VLisInteriorofBB(SGbox(4),(rand(1000,3)-.5)*10)
% VLisInteriorofBB(SGsphere(4),(rand(1000,3)-.5)*10)
%
% See also: SGisInterior, VLDLBBofVLFL, collofBBs, VLisInteriorofBBlist
%
%
% Copyright 2019-2020 Tim C. Lueth

SGstentPeterEwert01(mag)- Solid Geometry of a Stent for Peter Ewert

SGstentPeterEwert01(mag)% SGstentPeterEwert01(mag) - Solid Geometry of a Stent for Peter Ewert
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-16 as class: SURFACES)
%
% This stent geometry is the implementation of a drawing by Peter Ewert
% on 16.12.2019 for Tim Lüth. This STL file is enlarged by factor 10.
% (Status of: 2019-12-16)
%
% Introduced first in SolidGeometry 4.8
%
% [SG,CPLN]=SGstentPeterEwert01([mag])
% === INPUT PARAMETERS ===
% mag:
% === OUTPUT RESULTS ======
% SG:
% CPLN:
%
%
% Copyright 2019-2020 Tim C. Lueth

atomiccovalentradius(Str)- returns the atomic radius or the covalent bond distance of two atoms determined from it

atomiccovalentradius(Str)% atomiccovalentradius(Str) - returns the atomic radius or the covalent bond distance of two atoms determined from it
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-13 as class: AUXILIARY PROCEDURES)
%
% In addition to the Van der Waals radius there is the simple atomic
% radius. This is used to calculate the covalent formation distance of
% two atoms. (Status of: 2019-12-15)
%
% Introduced first in SolidGeometry 4.8
%
% See also: VanDerWaalsRadius
%
% [R,SG]=atomiccovalentradius([Str])
% === INPUT PARAMETERS ===
% Str: Kovalent Bond String such as 'H-O-H'
% === OUTPUT RESULTS ======
% R: List of Atomic Radius and Van der Waals Radius
% SG: List of Solid Geometries fitting to the Radius table
%
% EXAMPLE:
% atomiccovalentradius('H-O-H')
%
% See also: VanDerWaalsRadius
%
%
% Copyright 2019 Tim C. Lueth

VanDerWaalsRadius(Str)- returns the van der Waals Radius in pcm that can be used for a Kalottenmodel

VanDerWaalsRadius(Str)% VanDerWaalsRadius(Str) - returns the van der Waals Radius in pcm that can be used for a Kalottenmodel
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-13 as class: AUXILIARY PROCEDURES)
%
% 100 pm = 1 Angström
% This fnctn will be extented to colors and atom core radi (Status of:
% 2019-12-13)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGofDNAcode
%
% [r,E]=VanDerWaalsRadius([Str])
% === INPUT PARAMETERS ===
% Str: String abbreviation of the element such as 'H' or "He' etc.
% === OUTPUT RESULTS ======
% r: radius if exisiting for the element
% E: Solid Geometry of the V-d-W-Sphere
%
% EXAMPLE:
% VanDerWaalsRadius('Xe') % Xenon
% VanDerWaalsRadius('H')
% [~,O]=VanDerWaalsRadius('O')
% [~,H]=VanDerWaalsRadius('H')
% H=SGtransP(H,[96 0 0]);
% SGfigure; SGplotalpha(H); SGplotalpha(O);
%
% See also: SGofDNAcode
%
%
% Copyright 2019 Tim C. Lueth

matrixfillborder(M,neighb)- fills a matrix similiar as matrixdistanceofCPL but with discrete values

matrixfillborder(M,neighb)% matrixfillborder(M,neighb) - fills a matrix similiar as matrixdistanceofCPL but with discrete values
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-13 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.8
%
% See also: GPLofmatrix, matrixdistanceofCPL, ELofmatrixneigbors,
% ELofmatrixneigborweight, matrixlocalminmax, matrixskeleton,
% matrixfilldistance
%
% MM=matrixfillborder(M,[neighb])
% === INPUT PARAMETERS ===
% M: Matrix with nan as untouchable regions
% neighb: '8' oder '4' as neighborhood; default is '8'
% === OUTPUT RESULTS ======
% MM: Matrix with discrete distance values
%
% EXAMPLE:
% [M,GPL,~,ax]=matrixdistanceofCPL(CPLsample(29),100);
% SGfigure; matrixplot(M); colorbar;
% matrixfillborder(M);
%
% See also: GPLofmatrix, matrixdistanceofCPL, ELofmatrixneigbors,
% ELofmatrixneigborweight, matrixlocalminmax, matrixskeleton,
% matrixfilldistance
%
%
% Copyright 2019-2020 Tim C. Lueth

ELofmatrixneigbors8(rc)- creates a complete edge list for a edgelist 8x8 neighborhood of a matrix

ELofmatrixneigbors8(rc)% ELofmatrixneigbors8(rc) - creates a complete edge list for a edgelist 8x8 neighborhood of a matrix
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-13 as class: VOXELS)
%
% =======================================================================
% OBSOLETE (2019-12-13) - USE 'ELofmatrixneigbors' INSTEAD
% =======================================================================
%
% This fnctn has been integrated into ELofmatrixneigbors!
% This fnctn creates edge lists related to the single index use of a
% matrix:
% N=reshape(M,'',1) or simply use M(i)
% Use matrixneighbors for single entries (Status of: 2019-12-13)
%
% Introduced first in SolidGeometry 4.8
%
% See also: [ ELofmatrixneigbors ] ; GPLofmatrix, matrixdistanceofCPL,
% ELofmatrixneigbors, matrixneighbors, ELofmatrixneigborweight,
% matrixlocalminmax
%
% [EL4,EL8]=ELofmatrixneigbors8(rc)
% === INPUT PARAMETERS ===
% rc: 2D Matrix or [rows cols]
% === OUTPUT RESULTS ======
% EL4: straight neighbor edge list related to reshape(M,'',1)
% EL8: diagonal neighbor edge list related to reshape(M,'',1)
%
% EXAMPLE:
% [M,GPL,~,ax]=matrixdistanceofCPL(CPLsample(3),30); whos M, whos GPL, SGfigure; matrixplot(M,'',ax);
% [EL4,EL8]=ELofmatrixneigbors8(M); EL=[EL4;EL8]; whos EL
% SGfigure; VLELplots(GPL,EL,'g-'); CPSplot(CPLsample(3));
%
% See also: [ ELofmatrixneigbors ] ; GPLofmatrix, matrixdistanceofCPL,
% ELofmatrixneigbors, matrixneighbors, ELofmatrixneigborweight,
% matrixlocalminmax
%
%
% Copyright 2019 Tim C. Lueth

matrixfilldistance(M,lst);- fills a potential field

matrixfilldistance(M,lst);% matrixfilldistance(M,lst); - fills a potential field
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-11 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.8
%
% See also: GPLofmatrix, matrixdistanceofCPL, ELofmatrixneigbors,
% ELofmatrixneigborweight, matrixlocalminmax, matrixskeleton
%
% MM=matrixfilldistance(M,lst);
% === INPUT PARAMETERS ===
% M: Matrix
% lst: start point list
% === OUTPUT RESULTS ======
% MM: Distancematrix
%
% EXAMPLE:
% m=100; M=circshift(reshape(1:m*m,m,[]),[floor(randminv(m)),floor(randminv(m))])
% n=m; for i=1:n; M(floor(randminv(m)),floor(randminv(m)))=nan; end; M
% matrixfilldistance(M,[ceil(rand*m*m), ceil(rand*m*m)])
%
% See also: GPLofmatrix, matrixdistanceofCPL, ELofmatrixneigbors,
% ELofmatrixneigborweight, matrixlocalminmax, matrixskeleton
%
%
% Copyright 2019 Tim C. Lueth

matrixskeleton(M,)- creates the skeleton path for a matrix

matrixskeleton(M,)% matrixskeleton(M,) - creates the skeleton path for a matrix
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-11 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.8
%
% See also: GPLofmatrix, matrixdistanceofCPL, ELofmatrixneigbors,
% ELofmatrixneigborweight, matrixlocalminmax
%
% SEL=matrixskeleton(M,[])
% === INPUT PARAMETERS ===
% M: Matrix
% === OUTPUT RESULTS ======
% SEL: Skeleton Edge List
%
% EXAMPLE:
% [M,GPL,~,ax]=matrixdistanceofCPL(CPLsample(29),100); whos M, whos GPL, SGfigure; matrixplot(M,'',ax);
% matrixskeleton(M)
%
% See also: GPLofmatrix, matrixdistanceofCPL, ELofmatrixneigbors,
% ELofmatrixneigborweight, matrixlocalminmax
%
%
% Copyright 2019 Tim C. Lueth

matrixlocalminmax(M,ELtyp)- returns the local Minima and Maxima of a mtrix

matrixlocalminmax(M,ELtyp)% matrixlocalminmax(M,ELtyp) - returns the local Minima and Maxima of a mtrix
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-11 as class: AUXILIARY PROCEDURES)
%
% +/- 3 => Global Maxima or Minima
% +/- 2 => Local Maxima or Minima
% +/- 1 => Local plateau Maxima or Minima
% 0 equal neigbors (Status of: 2019-12-13)
%
% Introduced first in SolidGeometry 4.8
%
% See also: GPLofmatrix, matrixdistanceofCPL, ELofmatrixneigbors,
% ELofmatrixneigborweight
%
% [Min,Max,MM,EL]=matrixlocalminmax(M,[ELtyp])
% === INPUT PARAMETERS ===
% M: Original Matrix
% ELtyp: default is 'max'
% === OUTPUT RESULTS ======
% Min: List of Minima
% Max: List of Maxima
% MM: Full minimum maximum matrix
% EL: EL list containing ELtype of ELofmatrixneigborweight
%
% EXAMPLE:
% [M,GPL,~,ax]=matrixdistanceofCPL(CPLsample(14),100); whos M, whos GPL, SGfigure; matrixplot(M,'',ax);
% matrixlocalminmax(M); [Min,Max]=matrixlocalminmax(M)
%
% See also: GPLofmatrix, matrixdistanceofCPL, ELofmatrixneigbors,
% ELofmatrixneigborweight
%
%
% Copyright 2019 Tim C. Lueth

ELofmatrixneigborweight(M,method,neighb)- creates a weighted edge list for a 4x4 neighborhood wrt to weight criteria

ELofmatrixneigborweight(M,method,neighb)% ELofmatrixneigborweight(M,method,neighb) - creates a weighted edge list for a 4x4 neighborhood wrt to weight criteria
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-10 as class: VOXELS)
%
% This fnctn creates edge lists related to the single index use of a
% matrix:
% N=reshape(M,'',1) or simply use M(i) (Status of: 2019-12-13)
%
% Introduced first in SolidGeometry 4.8
%
% See also: GPLofmatrix, matrixdistanceofCPL, ELofmatrixneigbors,
% matrixlocalminmax
%
% EL=ELofmatrixneigborweight(M,[method,neighb])
% === INPUT PARAMETERS ===
% M: 2D Matrix or [rows cols]
% method: such as 'abs'
% neighb: '8' or '4'; default ist '8'
% === OUTPUT RESULTS ======
% EL: Edge list related to reshape(M,'',1)
%
% EXAMPLE:
% [M,GPL,~,ax]=matrixdistanceofCPL(CPLsample(3),30); whos M, whos GPL, SGfigure; matrixplot(M,'',ax);
% EL=ELofmatrixneigborweight(M); whos EL
% SGfigure; VLELplots(GPL,EL,'g-'); CPSplot(CPLsample(3));
%
% See also: GPLofmatrix, matrixdistanceofCPL, ELofmatrixneigbors,
% matrixlocalminmax
%
%
% Copyright 2019 Tim C. Lueth

ELofmatrixneigbors(rc)- creates a complete edge list for a edgelist 4x4 neighborhood of a matrix

ELofmatrixneigbors(rc)% ELofmatrixneigbors(rc) - creates a complete edge list for a edgelist 4x4 neighborhood of a matrix
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-10 as class: VOXELS)
%
% This fnctn creates edge lists related to the single index use of a
% matrix:
% N=reshape(M,'',1) or simply use M(i)
% Use matrixneighbors for single entries (Status of: 2019-12-13)
%
% Introduced first in SolidGeometry 4.8
%
% See also: GPLofmatrix, matrixdistanceofCPL, matrixneighbors,
% ELofmatrixneigborweight, matrixlocalminmax
%
% [EL4,EL8]=ELofmatrixneigbors(rc)
% === INPUT PARAMETERS ===
% rc: 2D Matrix or [rows cols]
% === OUTPUT RESULTS ======
% EL4: straight neighbor edge list related to reshape(M,'',1)
% EL8: diagonal neighbor edge list related to reshape(M,'',1)
%
% EXAMPLE:
% r=4;c=5; M=reshape(1:r*c,r,[])
% ELofmatrixneigbors(M)
% ELofmatrixneigbors(size(M))
% EL=sortrows(ELofmatrixneigbors(M)); EL(1:15,:)
% [M,GPL,~,ax]=matrixdistanceofCPL(CPLsample(3),30); whos M, whos GPL, SGfigure; matrixplot(M,'',ax);
% EL=ELofmatrixneigbors(M); whos EL
% SGfigure; VLELplots(GPL,EL,'g-'); CPSplot(CPLsample(3));
%
% See also: GPLofmatrix, matrixdistanceofCPL, matrixneighbors,
% ELofmatrixneigborweight, matrixlocalminmax
%
%
% Copyright 2019 Tim C. Lueth

matrixdistanceofCPL(CPL,nrc)- returns a simple matrix containing the distance to the contour CPL

matrixdistanceofCPL(CPL,nrc)% matrixdistanceofCPL(CPL,nrc) - returns a simple matrix containing the distance to the contour CPL
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-10 as class: CLOSED POLYGON LISTS)
%
% GPLpotentialpointsCPS
% GPLdistancegridpointsofCPL
% GPLdistancetoCPL
% matrixdistanceofCPL (Status of: 2019-12-13)
%
% Introduced first in SolidGeometry 4.8
%
% See also: GPLofmatrix, ELofmatrixneigbors, matrixneighbors,
% ELofmatrixneigborweight, matrixlocalminmax
%
% [M,GPL,insout,ax]=matrixdistanceofCPL(CPL,[nrc])
% === INPUT PARAMETERS ===
% CPL: Closed Polygon Line
% nrc: [nx ny] or [dx dy] if [dx,dy]<10 mm
% === OUTPUT RESULTS ======
% M: Matrix containing distance values
% GPL: Grid point list for matrix values
% insout: inside outside values of matrix values
% ax: [xmin xmax ymin ymax]
%
% EXAMPLE:
% matrixdistanceofCPL(CPLsample(3),100); M=ans, whos M
% matrixdistanceofCPL(CPLsample(3),1); M=ans, whos M
% [M,GPL,~,ax]=matrixdistanceofCPL(CPLsample(3),100); whos M, whos GPL, SGfigure; matrixplot(M,'',ax)
%
% See also: GPLofmatrix, ELofmatrixneigbors, matrixneighbors,
% ELofmatrixneigborweight, matrixlocalminmax
%
%
% Copyright 2019 Tim C. Lueth

SGbatchdelete(cmd)- deletes the global SGBatchIDtable of the SGbatch fncts

SGbatchdelete(cmd)% SGbatchdelete(cmd) - deletes the global SGBatchIDtable of the SGbatch fncts
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-08 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.8
%
% See also: batch, SGbatchjob, wait, fetchOutputs, SGbatchresult,
% stringfnctresult
%
% SGbatchdelete(cmd)
% === INPUT PARAMETERS ===
% cmd:
%
% EXAMPLE:
% SGbatchdelete
% job=SGbatchjob('VMreadnifti(''/Volumes/LUETH-WIN/WIN AIM Matlab Libraries/Medical Data/004MITK - Klinikum Süd/004Lumbal vertebral body 1.nii'');');
% job=SGbatchjob('[rand(1e3,1e3)*rand(1e3,1e3)]');
% wait(job) % Not required
% SGbatchresult(job); whos ans
%
%
% See also: batch, SGbatchjob, wait, fetchOutputs, SGbatchresult,
% stringfnctresult
%
%
% Copyright 2019 Tim C. Lueth

SGbatchresult(cmd)- returns the results of a job if it is finished or stores it in the workspace

SGbatchresult(cmd)% SGbatchresult(cmd) - returns the results of a job if it is finished or stores it in the workspace
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-07 as class: AUXILIARY PROCEDURES)
%
% checks wehter the job is already finished and tansports the results
% into the workspace (Status of: 2019-12-08)
%
% Introduced first in SolidGeometry 4.8
%
% See also: batch, SGbatchjob, wait, fetchOutputs, stringfnctresult,
% SGbatchdelete
%
% SGbatchresult(cmd)
% === INPUT PARAMETERS ===
% cmd: ID or job or command string
%
% EXAMPLE:
% SGbatchdelete
% job=SGbatchjob('VMreadnifti(''/Volumes/LUETH-WIN/WIN AIM Matlab Libraries/Medical Data/004MITK - Klinikum Süd/004Lumbal vertebral body 1.nii'');');
% job=SGbatchjob('[rand(1e3,1e3)*rand(1e3,1e3)]');
% wait(job) % Not required
% SGbatchresult(job); whos ans
%
%
% See also: batch, SGbatchjob, wait, fetchOutputs, stringfnctresult,
% SGbatchdelete
%
%
% Copyright 2019 Tim C. Lueth

SGbatchjob(cmd)- creates a job from a string using matlab's batch command and

SGbatchjob(cmd)% SGbatchjob(cmd) - creates a job from a string using matlab's batch command and
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-07 as class: AUXILIARY PROCEDURES)
%
% This fnctn is useful if very large fnctns should be executed in the
% background
%
% batch('SGG=SGremsurfedgepoints(SG)'); jj=ans; load (jj,'SGG');
% SGfigure(SGG);
% (Status of: 2019-12-08)
%
% Introduced first in SolidGeometry 4.8
%
% See also: batch, wait, fetchOutputs, SGbatchresult, stringfnctresult,
% SGbatchdelete
%
% job=SGbatchjob(cmd)
% === INPUT PARAMETERS ===
% cmd: matlab command to execute as parallel job
% === OUTPUT RESULTS ======
% job: parallel job
%
% EXAMPLE:
% SGbatchdelete
% job=SGbatchjob('VMreadnifti(''/Volumes/LUETH-WIN/WIN AIM Matlab Libraries/Medical Data/004MITK - Klinikum Süd/004Lumbal vertebral body 1.nii'');');
% job=SGbatchjob('[rand(1e3,1e3)*rand(1e3,1e3)]');
% wait(job) % Not required
% SGbatchresult(job); whos ans
%
%
% See also: batch, wait, fetchOutputs, SGbatchresult, stringfnctresult,
% SGbatchdelete
%
%
% Copyright 2019-2022 Tim C. Lueth

stringfnctresult(str)- creates the cell list of output parameters of a batch call

stringfnctresult(str)% stringfnctresult(str) - creates the cell list of output parameters of a batch call
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-07 as class: AUXILIARY PROCEDURES)
%
% This fnctn supports the collection of results within a batch job
% workspace
% job=SGbatch('clear all; ZZZ=1+1'); wait(job); res=fetchOutputs(job);
% res{1} (Status of: 2019-12-08)
%
% Introduced first in SolidGeometry 4.8
%
% See also: batch, SGbatchjob, wait, fetchOutputs, SGbatchresult,
% SGbatchdelete
%
% [le,re]=stringfnctresult(str)
% === INPUT PARAMETERS ===
% str: fnctn equation string
% === OUTPUT RESULTS ======
% le: list of narout
% re: equation
%
% EXAMPLE:
% stringfnctresult('sqrt(4)')
% stringfnctresult('A=sqrt(4)')
% stringfnctresult('[A,B,C]=sqrt(4)')
%
% See also: batch, SGbatchjob, wait, fetchOutputs, SGbatchresult,
% SGbatchdelete
%
%
% Copyright 2019 Tim C. Lueth

SGsurfacessort(SG,cmd)- sorts the independent surfaces of a cell surface list

SGsurfacessort(SG,cmd)% SGsurfacessort(SG,cmd) - sorts the independent surfaces of a cell surface list
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-07 as class: SURFACES)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGsurfacessort, SGsurfaces, SGsurfaceplot, SGsurfaceplot,
% SGplotcell, SGplotsurfaces
%
% [SG,sl]=SGsurfacessort(SG,[cmd])
% === INPUT PARAMETERS ===
% SG: Solid Geometry as cell list
% cmd: optional sort command such as 'face', 'vertex', 'bbvol'
% === OUTPUT RESULTS ======
% SG: Solid Geometry
% sl: sorting list
%
% EXAMPLE:
% SGsurfacessort(SGboxsphere,'bbvol'); [a,b]=SGsurfacessort(SGboxsphere,'bbvol'); b
% SGsurfacessort(SGboxsphere,'fl'); [a,b]=SGsurfacessort(SGboxsphere,'fl'); b
%
% See also: SGsurfacessort, SGsurfaces, SGsurfaceplot, SGsurfaceplot,
% SGplotcell, SGplotsurfaces
%
%
% Copyright 2019-2020 Tim C. Lueth

dicomCollectionSeparation(DirName,FName)- selects the fitting other files for a stack of images or a directory

dicomCollectionSeparation(DirName,FName)% dicomCollectionSeparation(DirName,FName) - selects the fitting other files for a stack of images or a directory
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-04 as class: VOXELS)
%
% This fnctn selects the file stack fitting to a single file, or collects
% the information of this directory or moves the files of several stacks
% into individual directory name using the SeriesInstanceUID of the stack.
% This fnctn creates a global variable "GlobaldicomCollectionTable"
% There are different modes to call the fnctn:
% A=dicomCollectionSeparation % Opens a
% browser dialog to select a path or a file
% dicomCollectionSeparation(GlobaldicomCollectionTable) % Calls the
% fnctn using the existing Table
% [A,FL]=dicomCollectionSeparation(A,<>) % Calls the
% fnctn using a Table and a File Name
% [~,FL]=dicomCollectionSeparation(GlobaldicomCollectionTable) % If there
% is only one stack in the table
% (Status of: 2019-12-05)
%
% Introduced first in SolidGeometry 4.8
%
% See also: dicomBrowser, dicomCollection, dicomreadVolume
%
% [A,FL]=dicomCollectionSeparation([DirName,FName])
% === INPUT PARAMETERS ===
% DirName: empty for selection or directory name or file name
% FName: optional file name or cmd suc as 'separated'
% === OUTPUT RESULTS ======
% A: table of dicomCollection of this directory
% FL: fitting file list for using dicomreadVolume
%
% EXAMPLE:
% A=dicomCollectionSeparation; % creates the table of dicomCollection
% dicomCollectionSeparation(A,'separate'); % separates all file into the SeriesInstanceUID
% [A,FL]=dicomCollectionSeparation; % creates the table of dicomCollection
% VM=squeeze(dicomreadVolume(FL));
%
% See also: dicomBrowser, dicomCollection, dicomreadVolume
%
%
% Copyright 2019 Tim C. Lueth

VMaxis(V)- simply returns the minimal and maximal intensity values of a Voxel Model

VMaxis(V)% VMaxis(V) - simply returns the minimal and maximal intensity values of a Voxel Model
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-04 as class: VOXELS)
%
% Introduced first in SolidGeometry 4.8
%
% See also: VMcaxis, axis
%
% vax=VMaxis(V)
% === INPUT PARAMETERS ===
% V: Voxel model
% === OUTPUT RESULTS ======
% vax: [min max]
%
% EXAMPLE:
% VMaxis(V)
%
% See also: VMcaxis, axis
%
%
% Copyright 2019 Tim C. Lueth

VMreadnifti(fname)- reads in a nifty volumentric file

VMreadnifti(fname)% VMreadnifti(fname) - reads in a nifty volumentric file
% (by Tim Lueth, VLFL-Lib, 2019-DEZ-03 as class: VOXELS)
%
% a nifty file is an already segmented file consisting of 0 and 1
% with additonal parameter similar to a standard dicom file (Status of:
% 2019-12-03)
%
% Introduced first in SolidGeometry 4.8
%
% See also: VMreaddicom, VMreaddicomdir
%
% [VM,vs]=VMreadnifti([fname])
% === INPUT PARAMETERS ===
% fname: filename
% === OUTPUT RESULTS ======
% VM: Voxel Model
% vs: voxel size
%
% EXAMPLE:
% VMreadnifti()
%
% See also: VMreaddicom, VMreaddicomdir
%
%
% Copyright 2019 Tim C. Lueth

indofrc(Ms,PL)- converts an index list into a rows cols list

indofrc(Ms,PL)% indofrc(Ms,PL) - converts an index list into a rows cols list
% (by Tim Lueth, VLFL-Lib, 2019-NOV-25 as class: AUXILIARY PROCEDURES)
%
% call a matrix with a running index or search in a 2D matrix such as
% isnan returns a scalar value. This fnctn converst the scalar value into
% rows and cols wrt the matlab rules. (Status of: 2019-11-25)
%
% Introduced first in SolidGeometry 4.8
%
% See also: GPLofmatrix, matrixneighbors, matrixvalues,
% matrixdistancefield, rcofind
%
% ind=indofrc(Ms,PL)
% === INPUT PARAMETERS ===
% Ms: size of matrix
% PL: rc list
% === OUTPUT RESULTS ======
% ind: index list
%
% EXAMPLE:
% m=5; M=reshape(1:m*m,m,[])
% n=m; for i=1:n; M(floor(randminv(m)),floor(randminv(m)))=nan; end; M
% l=find(isnan(M))
% rcofind(size(M),l)
% rcofind(size(M),l')
% indofrc(size(M),ans)
%
% See also: GPLofmatrix, matrixneighbors, matrixvalues,
% matrixdistancefield, rcofind
%
%
% Copyright 2019 Tim C. Lueth

rcofind(s,il)- converts an index list into a rows cols list

rcofind(s,il)% rcofind(s,il) - converts an index list into a rows cols list
% (by Tim Lueth, VLFL-Lib, 2019-NOV-24 as class: AUXILIARY PROCEDURES)
%
% call a matrix with a running index or search in a 2D matrix such as
% isnan returns a scalar value. This fnctn converst the scalar value into
% rows and cols wrt the matlab rules. (Status of: 2019-12-13)
%
% Introduced first in SolidGeometry 4.8
%
% See also: GPLofmatrix, matrixneighbors, matrixvalues,
% matrixdistancefield, indofrc
%
% RCL=rcofind(s,il)
% === INPUT PARAMETERS ===
% s: size of matrix
% il: index list
% === OUTPUT RESULTS ======
% RCL: Roews cols list
%
% EXAMPLE:
% m=5; M=circshift(reshape(1:m*m,m,[]),[floor(randminv(m)),floor(randminv(m))])
% n=m; for i=1:n; M(floor(randminv(m)),floor(randminv(m)))=nan; end; M
% l=find(isnan(M))
% rcofind(size(M),l)
% rcofind(size(M),l')
%
% See also: GPLofmatrix, matrixneighbors, matrixvalues,
% matrixdistancefield, indofrc
%
%
% Copyright 2019 Tim C. Lueth

matrixdistancefield(M,st)- calculates a matrix distancefield based on a start point and optional end point

matrixdistancefield(M,st)% matrixdistancefield(M,st) - calculates a matrix distancefield based on a start point and optional end point
% (by Tim Lueth, VLFL-Lib, 2019-NOV-24 as class: AUXILIARY PROCEDURES)
%
% There are different methods to calculate the neigborhood mask and the
% distance
% - the distance can be calculated just based on the table distance (1 2
% 3 4)
% - the distance can be calculated based on the value differences
% (potentials)
% (Status of: 2019-12-13)
%
% Introduced first in SolidGeometry 4.8
%
% See also: GPLofmatrix, matrixneighbors, matrixvalues, rcofn
%
% DM=matrixdistancefield(M,st)
% === INPUT PARAMETERS ===
% M: Matrix
% st: Start points of value zeros
% === OUTPUT RESULTS ======
% DM: Matrix-Distancefield
%
% See also: GPLofmatrix, matrixneighbors, matrixvalues, rcofn
%
%
% Copyright 2019 Tim C. Lueth

matrixneighbors(Ms,RCL,masktyp,noncirc)- returns the coordinates for matrix neigbors

matrixneighbors(Ms,RCL,masktyp,noncirc)% matrixneighbors(Ms,RCL,masktyp,noncirc) - returns the coordinates for matrix neigbors
% (by Tim Lueth, VLFL-Lib, 2019-NOV-24 as class: AUXILIARY PROCEDURES)
%
% There are many different methods to implement search algorithms on
% matrices. This set of fnctns
% matrixvalues
% matrixneighbors
% support simple local implementation methods (Status of: 2019-12-13)
%
% Introduced first in SolidGeometry 4.8
%
% See also: GPLofmatrix, matrixvalues, matrixdistancefield, rcofn
%
% RCN=matrixneighbors(Ms,RCL,[masktyp,noncirc])
% === INPUT PARAMETERS ===
% Ms: size(Matrix)
% RCL: [row col] coordinate
% masktyp: '4' or '8' as mask type
% noncirc: noncircular or circular neighborhood; default is true
% === OUTPUT RESULTS ======
% RCN: row cols neighbors; nan for non existing
%
% EXAMPLE:
% m=5; M=circshift(reshape(1:m*m,m,[]),[floor(randminv(m)),floor(randminv(m))])
% mn=matrixneighbors(size(M),[1 1])
% matrixvalues(M,mn)
%
% See also: GPLofmatrix, matrixvalues, matrixdistancefield, rcofn
%
%
% Copyright 2019 Tim C. Lueth

matrixvalues(M,el)- returns the values of a matrix from a list of coordinate entries

matrixvalues(M,el)% matrixvalues(M,el) - returns the values of a matrix from a list of coordinate entries
% (by Tim Lueth, VLFL-Lib, 2019-NOV-24 as class: AUXILIARY PROCEDURES)
%
% most probably there is a faster an simpler method in matlab (Status of:
% 2019-12-13)
%
% Introduced first in SolidGeometry 4.8
%
% See also: GPLofmatrix, matrixneighbors, matrixdistancefield, rcofn
%
% Res=matrixvalues(M,el)
% === INPUT PARAMETERS ===
% M: Matrix
% el: list of [r c] coordinates
% === OUTPUT RESULTS ======
% Res: Result
%
% EXAMPLE:
% m=5; M=circshift(reshape(1:m*m,m,[]),[floor(randminv(m)),floor(randminv(m))])
% matrixvalues(M,[1 1; 2 2; 3 3;1 4])
%
%
% See also: GPLofmatrix, matrixneighbors, matrixdistancefield, rcofn
%
%
% Copyright 2019 Tim C. Lueth

matrixrand(M,n)- returns random values for coordinates of a matrix

matrixrand(M,n)% matrixrand(M,n) - returns random values for coordinates of a matrix
% (by Tim Lueth, VLFL-Lib, 2019-NOV-24 as class: AUXILIARY PROCEDURES)
%
% .. more or less for testing path planning ..
% currently just 2D (Status of: 2019-12-13)
%
% Introduced first in SolidGeometry 4.8
%
% See also: GPLofmatrix, randminv, rand
%
% PLrc=matrixrand(M,[n])
% === INPUT PARAMETERS ===
% M: Matrix
% n: number of random coordianates
% === OUTPUT RESULTS ======
% PLrc: coordinate list for matrix M
%
% EXAMPLE:
% M=zeros(5,10), matrixrand(M,6)
%
% See also: GPLofmatrix, randminv, rand
%
%
% Copyright 2019-2020 Tim C. Lueth

VLplotGraphics(VL,obj,col,alp)- more generic version of VL scatter

VLplotGraphics(VL,obj,col,alp)% VLplotGraphics(VL,obj,col,alp) - more generic version of VL scatter
% (by Tim Lueth, VLFL-Lib, 2019-NOV-24 as class: USER INTERFACE)
%
% can be very slow for large lists of VL (Status of: 2019-11-24)
%
% Introduced first in SolidGeometry 4.8
%
% See also: VLscatter
%
% h=VLplotGraphics(VL,[obj,col,alp])
% === INPUT PARAMETERS ===
% VL: Vertex list
% obj: radius, CPL, CPS, Solid
% col: color of the plot; either scalar or
% alp: alpha value for solids or polyshapes; not implemented yet
% === OUTPUT RESULTS ======
% h: handle to graphics
%
% EXAMPLE:
% cla; VLplotGraphics(rand(100,3)*1000,PLstar(10)); shg
% cla; VLplotGraphics(rand(100,3)*1000,10*PLstar(10,'','','','',.5)); shg
%
% See also: VLscatter
%
%
% Copyright 2019 Tim C. Lueth

matrixplot(M,flpud,ax,txtsize,plotnan)- plots a 2D matrix as grid point list with coordinates

matrixplot(M,flpud,ax,txtsize,plotnan)% matrixplot(M,flpud,ax,txtsize,plotnan) - plots a 2D matrix as grid point list with coordinates
% (by Tim Lueth, VLFL-Lib, 2019-NOV-23 as class: VOXELS)
%
% will be extended in future for 3D grids
% add a colorbar if desired
% use colormap(jet) to see extrem values better
% NaN is plotted as square (Status of: 2019-11-25)
%
% Introduced first in SolidGeometry 4.8
%
% See also: ELdistanceofmatrixneighbors, VMofVL, matrixneighbors,
% matrixvalues, matrixdistancefield, rcofn
%
% h=matrixplot(M,[flpud,ax,txtsize,plotnan])
% === INPUT PARAMETERS ===
% M: Matrix (n x m)
% flpud: flipud for rows values; default is true
% ax: [xmin xmax ymin ymax]; default is [1 size(M,2) 1 size(M,1)]
% txtsize: text size; default is 0;
% plotnan: true => nan plotted as square; default is false
% === OUTPUT RESULTS ======
% h: handle to graphics objects
%
% EXAMPLE:
% m=16; M=circshift(reshape(1:m*m,m,[]),[floor(randminv(m)),floor(randminv(m))])
% n=m; for i=1:n; M(floor(randminv(m)),floor(randminv(m)))=nan; end; M
% close all; figure; view(0,90); matrixplot(M), axis equal
% close all; figure; view(0,90); matrixplot(M,'',[0 1 0 1]), axis equal
% close all; figure; view(0,90); matrixplot(M,'',[0 1 0 1],'',true), axis equal
%
% See also: ELdistanceofmatrixneighbors, VMofVL, matrixneighbors,
% matrixvalues, matrixdistancefield, rcofn
%
%
% Copyright 2019 Tim C. Lueth

strhyperlink(text,url)- returns a simple html hyperlink text for fprintf

strhyperlink(text,url)% strhyperlink(text,url) - returns a simple html hyperlink text for fprintf
% (by Tim Lueth, VLFL-Lib, 2019-NOV-23 as class: AUXILIARY PROCEDURES)
%
% WARNING: With this feature you can cause terribly negative things like
% Trojans, viruses, hard disk deletions etc. by the user. Never press
% links without looking at the resolution in the footer.
%
% Simple Macro fom Matlab help text
% sprintf('%s',url,text);
%
% This fnctn is useful to create hyperlinks in text output for automatic
% design
% for example to open also files, directories or to start programms
% be aware, that the behavior of the default matlab browser is different
% and does not support the fnctnaly yet of Safari, FireFox, Opera, etc.
% (Status of: 2020-10-18)
%
% Introduced first in SolidGeometry 4.8
%
% See also: sprintfilehyperlink, sprintfhyperlinktab, SGexplain,
% evalhyperlinktab
%
% hlstr=strhyperlink(text,url)
% === INPUT PARAMETERS ===
% text: text string
% url: url of link
% === OUTPUT RESULTS ======
% hlstr: html string to use even in fprintf
%
% EXAMPLE:
% strhyperlink('test','http://www.mimed.de')
% fprintf('>>>>%s<<<<\n',strhyperlink('TUM Mimed','http://www.mimed.de'))
% fprintf('At %s you will find a lot of STL Files.\n',strhyperlink('Grabcad','https://grabcad.com'))
% fprintf('You can read the file "%s" in the Matlab browser.\n',strhyperlink('strhyperlink.m','file:///Volumes/LUETH-WIN/WIN%20AIM%20Matlab%20Libraries/SolidGeometry-Code/strhyperlink.m'))
% fprintf('You can open the file "%s" at line #2, in the matlab or execute any matlab command.\n',strhyperlink('strhyperlink.m','matlab: opentoline(''/Volumes/LUETH-WIN/WIN AIM Matlab Libraries/SolidGeometry-Code/strhyperlink.m'',2)'))
% fprintf('You can execute any matlab commando from the printout such as: "%s".\n',strhyperlink('what is 1+1?','matlab: 1+1'))
% fprintf('You can execute any matlab commando from the printout such as: "%s".\n',strhyperlink('Create a Cylinder?','matlab: SGofCPLcommand(''c 4, h 5'')'))
%
% See also: sprintfilehyperlink, sprintfhyperlinktab, SGexplain,
% evalhyperlinktab
%
%
% Copyright 2019-2022 Tim C. Lueth

SGcheckcode(FN,warnid,depend)- Auxilary fnct for finding error lines

SGcheckcode(FN,warnid,depend)% SGcheckcode(FN,warnid,depend) - Auxilary fnct for finding error lines
% (by Tim Lueth & Simon Laudahn, VLFL-Lib, 2019-NOV-22 as class:
% AUXILIARY PROCEDURES)
%
% This fnctn was motivated by Simon Laudahn's statement in the Monday
% session.
% checkcode - finds warnings/errors in code
% opentoline - open the file at the desired line
% url = 'https://www.mathworks.com'; sitename = 'The MathWorks Web Site';
% fprintf('%s\n',url,sitename) (Status of: 2019-11-23)
%
% Introduced first in SolidGeometry 4.8
%
% See also: mlintrpt, checkcode, opentoline
%
% R=SGcheckcode(FN,[warnid,depend])
% === INPUT PARAMETERS ===
% FN: File Name
% warnid: search for a specific warning/error ID
% depend: search complete dependence tree; default is false
% === OUTPUT RESULTS ======
% R: Result of checkcode
%
% EXAMPLE:
% SGcheckcode('SGcheckcode');
% SGcheckcode('SGcheckcode','NOPRT');
%
% See also: mlintrpt, checkcode, opentoline
%
%
% Copyright 2019 Tim C. Lueth

GPLofmatrix(M,flpud,ax)- creates for a 2D matrix a grid point list with coordinates

GPLofmatrix(M,flpud,ax)% GPLofmatrix(M,flpud,ax) - creates for a 2D matrix a grid point list with coordinates
% (by Tim Lueth, VLFL-Lib, 2019-NOV-22 as class: VOXELS)
%
% will be extended in future for 3D grids
% add a colorbar if desired
% use colormap(jet) to see extrem values better
% NaN is plotted as square (Status of: 2019-11-25)
%
% Introduced first in SolidGeometry 4.8
%
% See also: ELdistanceofmatrixneighbors, VMofVL, matrixplot,
% matrixneighbors, matrixvalues, matrixdistancefield, rcofn
%
% [GPL,X,Y]=GPLofmatrix(M,[flpud,ax])
% === INPUT PARAMETERS ===
% M: Matrix (n x m)
% flpud: flipud for rows values; default is true
% ax: [xmin xmax ymin ymax]; default is [1 size(M,2) 1 size(M,1)]
% === OUTPUT RESULTS ======
% GPL: GPL coordiate list; sorted 1:numel(M)
% X: X coordiate of GPL; sorted 1:numel(M)
% Y: Y coordiate of GPL; sorted 1:numel(M)
%
% EXAMPLE:
% m=16; M=circshift(reshape(1:m*m,m,[]),[floor(randminv(m)),floor(randminv(m))])
% n=m; for i=1:n; M(floor(randminv(m)),floor(randminv(m)))=0; end; M
% GPLofmatrix(M(1:10,1:8),false,[5 25 4 67]);
% GPLofmatrix(M(1:10,1:8),true,[5 25 4 67]);
% GPLofmatrix(M,false);
% GPLofmatrix(M,true); M
% n=3; for i=1:n; M(floor(randminv(m)),floor(randminv(m)))=nan; end; M
% GPLofmatrix(M,true); M
%
% See also: ELdistanceofmatrixneighbors, VMofVL, matrixplot,
% matrixneighbors, matrixvalues, matrixdistancefield, rcofn
%
%
% Copyright 2019 Tim C. Lueth

SGcutTinsertpins(SG,T,rh)- separates a solid similar to SGcutT but inserts connection points

SGcutTinsertpins(SG,T,rh)% SGcutTinsertpins(SG,T,rh) - separates a solid similar to SGcutT but inserts connection points
% (by Tim Lueth & Simon Schiele, VLFL-Lib, 2019-NOV-21 as class: SURFACES)
%
% The first fnctn for this purpose was written by Simon Schiele and
% Yannick Krieger mentioned his solution. (Status of: 2020-01-06)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGcutT, CPLofSGcutT
%
% [SGB,SGA,SGP,CPL,PL,T]=SGcutTinsertpins([SG,T,rh])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% T: Cutting frame; Z-Achsis spearates
% rh: radius and height of pins
% === OUTPUT RESULTS ======
% SGB: Solid with Pins
% SGA: Solid with Holes
% SGP: Just the Pins
% CPL: cutting Contour
% PL: Point list for Pins
% T: HT matrix to transform PL to VL
%
% EXAMPLE:
% SGboolh('-',SGbox([30,20,10]),SGsphere(12,'','','',8,4)); SG=ans;
% SGcutTinsertpins(SGboolh('-',SGbox([30,20,10]),SGsphere(12,'','','',8,4)))
% SGcutTinsertpins(SG,TofR(rot(1e-2,1e-2,1e-2),[0 0 0]),[-4])
%
% See also: SGcutT, CPLofSGcutT
%
%
% Copyright 2019-2020 Tim C. Lueth

CPLskeleton(CPL,nn,ri)- returns a skeleton with equal distances to all wall sizes

CPLskeleton(CPL,nn,ri)% CPLskeleton(CPL,nn,ri) - returns a skeleton with equal distances to all wall sizes
% (by Tim Lueth, VLFL-Lib, 2019-NOV-21 as class: CLOSED POLYGON LISTS)
%
% Programmed in 2019 (4.8) but released in 2022 (5.2)
% Works with potential field with 1 percent accuracy (100 x 100)
% gridpoints (Status of: 2022-02-26)
%
% Introduced first in SolidGeometry 4.8
%
% See also: CPLskeletonsearch, matrixskeleton, matrixdistanceofCPL,
% matrixfilldistance
%
% [PLA,ELA]=CPLskeleton(CPL,[nn,ri])
% === INPUT PARAMETERS ===
% CPL: Contour
% nn: number of grid points; default is 100
% ri: Amin for point removeal; default is -1
% === OUTPUT RESULTS ======
% PLA: Point list of Skeleton
% ELA: Edge list of Skeleton
%
% EXAMPLE:
% CPLskeleton(CPLsample(40))
% CPLskeleton([CPLsample(3);nan nan;PLcircle(2)])
% CPLskeleton([CPLsample(3)])
% CPLskeleton([CPLsample(3);nan nan;PLcircle(3)],100,.1); % Accuracy 1/1mm
%
% See also: CPLskeletonsearch, matrixskeleton, matrixdistanceofCPL,
% matrixfilldistance
%
%
% Copyright 2019-2022 Tim C. Lueth

SGtextTUM(fs,h)- return a solid for the TUM logo

SGtextTUM(fs,h)% SGtextTUM(fs,h) - return a solid for the TUM logo
% (by Simon Schiele, VLFL-Lib, 2019-NOV-20 as class: SURFACES)
%
% See also: SGoftext, SGtext, CPLtextimage
%
% [SG]=SGtextTUM(fs,h)
% === INPUT PARAMETERS ===
% fs: font size; default is 16 mm
% h: height; default is 1 mm
% === OUTPUT RESULTS ======
% [SG]: Solid Geometry
%
% EXAMPLE:
% SGtextTUM(16,5) % 16 mm size
% SGtextTUM(16*0.35,2) % 16 Point size
%
% See also: SGoftext, SGtext, CPLtextimage
%

solveequations(eq,srch,givn)- returns the symbolic solutions for a give set of equations - What we learn in math

solveequations(eq,srch,givn)% solveequations(eq,srch,givn) - returns the symbolic solutions for a give set of equations - What we learn in math
% (by Tim Lueth, VLFL-Lib, 2019-NOV-11 as class: SYMBOLICS COMPUTATION)
%
% This fnctn should take over a long list of equations in physics and
% solve problems in a similar manner as humans do for different domain.
% (Status of: 2019-11-12)
%
% Introduced first in SolidGeometry 4.8
%
% See also: symsofequation
%
% res=solveequations([eq,srch,givn])
% === INPUT PARAMETERS ===
% eq: equation, use '==' for equal sign and ',' for separation
% srch: symbols your are looking for
% givn: optional given values % not supported yet
% === OUTPUT RESULTS ======
% res: result as struct
%
% EXAMPLE:
% solveequations('U==R*I, P==U*I, W==P*t','P I t'); % requested Parameter
% solveequations('U==R*I, P==U*I, W==P*t','', 'P I t'); % Given Parameter
% solveequations('U==1/C*int(I,t), P==U*I, W==P*t','', 'C I t');
% solveequations('U==R*I, P==U*I', '', 'I U'); % Known Parameter
% solveequations('U==R*I, P==U*I','I U',''); % Unknown Parameter
% solveequations('U==R*I, P==U*I, W==P*t', '', 'I U'); % Partial Solutions
%
% See also: symsofequation
%
%
% Copyright 2019 Tim C. Lueth

symsofequation(eq)- returns or defines the symbols of a equation system

symsofequation(eq)% symsofequation(eq) - returns or defines the symbols of a equation system
% (by Tim Lueth, VLFL-Lib, 2019-NOV-11 as class: SYMBOLICS COMPUTATION)
%
% if there is no output, the symbols are defined using
% evalin('caller',ev) in the calling workspace (Status of: 2019-11-12)
%
% Introduced first in SolidGeometry 4.8
%
% See also: syms, symvar
%
% [S,v,ev]=symsofequation([eq])
% === INPUT PARAMETERS ===
% eq: equation systems to analyze
% === OUTPUT RESULTS ======
% S: String of Symbols
% v: cell list of Symbols
% ev: evaluation string
%
% EXAMPLE:
% symsofequation('U==R*I, P==U*I, W==P*t');
%
% See also: syms, symvar
%
%
% Copyright 2019 Tim C. Lueth

dimpowercable(P,U,d)- returns the required dimension for a motor power cable or the number of required power cables

dimpowercable(P,U,d)% dimpowercable(P,U,d) - returns the required dimension for a motor power cable or the number of required power cables
% (by Tim Lueth, VLFL-Lib, 2019-NOV-10 as class: AUXILIARY PROCEDURES)
%
% Based on standard cupper cable.
% If the third parameter, diameter, is used, the number of cables is
% returned to transport the required power, instead of the diameter in mm
% May be the connectors need an independent fnctn (Status of: 2019-11-10)
%
% Introduced first in SolidGeometry 4.8
%
% [d,dw,text,vend]=dimpowercable([P,U,d])
% === INPUT PARAMETERS ===
% P: Power in Watt; default 10 W
% U: Voltage in Volt; default is 5 V
% d: optional existing diameter;
% === OUTPUT RESULTS ======
% d: diameter of cable or number of cables
% dw: loss of power by cable heating / resistor
% text: printable text string that contains the specification to order
% cable and connectors
% vend: printable text string that contains a vendor for the required
% components if known
%
%
% Copyright 2019 Tim C. Lueth

SGturnfaces(SG)- rotates a solid wrt to the largest orthogonal feature surfaces

SGturnfaces(SG)% SGturnfaces(SG) - rotates a solid wrt to the largest orthogonal feature surfaces
% (by Tim Lueth, VLFL-Lib, 2019-OKT-25 as class: KINEMATICS AND FRAMES)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGrotateservo
%
% SG=SGturnfaces(SG)
% === INPUT PARAMETERS ===
% SG: Original Solid Gometry
% === OUTPUT RESULTS ======
% SG: Turned and Centered Solid Geometry
%
% EXAMPLE:
% SGturnfaces(SGservosample2)
% SGturnfaces(SGtransR(SGservosample(2),rot(pi/4,pi/8,pi/10)))
%
% See also: SGrotateservo
%
%
% Copyright 2019 Tim C. Lueth

SGdimofFilename(fn)- returns the volume and size sorted dimensions from a SGarchivefilename

SGdimofFilename(fn)% SGdimofFilename(fn) - returns the volume and size sorted dimensions from a SGarchivefilename
% (by Tim Lueth, VLFL-Lib, 2019-OKT-25 as class: AUXILIARY PROCEDURES)
%
% Filenames mut fullfi the format:
%
% 'VOL=49540.5[54.5x45.0x20.2]V=1978F=4000' (Status of: 2019-10-25)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGarchivefilename, SGwriteSTLarchive, SGsizeofFilename
%
% nvf=SGdimofFilename(fn)
% === INPUT PARAMETERS ===
% fn: filename in directory found by search
% === OUTPUT RESULTS ======
% nvf: returns the volume and size sorted dimensions is containing this
% information
%
% EXAMPLE:
% fn=SGarchivefilename(SGservosample(3))
% SGdimofFilename(fn), a=ans; a(2:end)
%
% See also: SGarchivefilename, SGwriteSTLarchive, SGsizeofFilename
%
%
% Copyright 2019 Tim C. Lueth

SGsizeofFilename(fn)- returns the number of vertices and facets from a SGarchivefilename

SGsizeofFilename(fn)% SGsizeofFilename(fn) - returns the number of vertices and facets from a SGarchivefilename
% (by Tim Lueth, VLFL-Lib, 2019-OKT-24 as class: AUXILIARY PROCEDURES)
%
% Filenames mut fullfil the format:
%
% 'VOL=49540.5[54.5x45.0x20.2]V=1978F=4000' (Status of: 2019-10-25)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGarchivefilename, SGwriteSTLarchive, SGdimofFilename
%
% nvf=SGsizeofFilename(fn)
% === INPUT PARAMETERS ===
% fn: filename in directory found by search
% === OUTPUT RESULTS ======
% nvf: returns the V+ and F= values if the filename is containing this
% information
%
% EXAMPLE:
% fn=SGarchivefilename(SGservosample(3))
% SGsizeofFilename(fn),
%
%
% See also: SGarchivefilename, SGwriteSTLarchive, SGdimofFilename
%
%
% Copyright 2019 Tim C. Lueth

SGarchivefilename(SG)- returns a filename for fast access to similar geometries

SGarchivefilename(SG)% SGarchivefilename(SG) - returns a filename for fast access to similar geometries
% (by Tim Lueth, VLFL-Lib, 2019-OKT-24 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGwriteSTLarchive, SGsizeofFilename, SGisidentical
%
% [fn,fndim,fngeo]=SGarchivefilename(SG)
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% === OUTPUT RESULTS ======
% fn: filename without STL
% fndim: part for dimension comparison (Volumen and X*Y*Z)
% fngeo: part for geometry comparision (VL/FL)
%
% EXAMPLE:
% SGarchivefilename(SGservosample(3))
%
% See also: SGwriteSTLarchive, SGsizeofFilename, SGisidentical
%
%
% Copyright 2019 Tim C. Lueth

SGuniquesurfaces(SG)- returns unique surfaces from a solid geometry

SGuniquesurfaces(SG)% SGuniquesurfaces(SG) - returns unique surfaces from a solid geometry
% (by Tim Lueth, Video-Lib, 2019-OKT-23 as class: SURFACES)
%
% This fnctn uses the SGisidentical fnctn to assign the surfaces
% generated by the SGsurfaces fnctn to unique surfaces and to determine
% their relative transformation matrix.
% (Status of: 2019-10-23)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGisidentical, SGsurfaces
%
% [SGC,UL,T]=SGuniquesurfaces(SG)
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% === OUTPUT RESULTS ======
% SGC: Cell list of Solid Geometries
% UL: List of elements with the same geometry
% T: List of 4x4 HT matrices for spatial transformation
%
% EXAMPLE:
% SGuniquesurfaces(SGservosample(1)) % without patchreduction identification is possible
% SGuniquesurfaces(SGservosample(2)) % patchreduction destroys identity
%
% See also: SGisidentical, SGsurfaces
%
%
% Copyright 2019 Tim C. Lueth

SGisidentical(SGA,SGB)- try to compare two solids to find equality as fast as possible

SGisidentical(SGA,SGB)% SGisidentical(SGA,SGB) - try to compare two solids to find equality as fast as possible
% (by Tim Lueth, VLFL-Lib, 2019-OKT-21 as class: SURFACES)
%
% Two solids are identical if
% - they have the same number of facets
% - the difference of the area lists of all facets is near zero
% (Status of: 2022-04-25)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGisconvex, SGisInterior
%
% [fdiff,TBA,TAB]=SGisidentical(SGA,SGB)
% === INPUT PARAMETERS ===
% SGA: Solid A; or a file name for a solid
% SGB: Solid B; or a file name for a solid
% === OUTPUT RESULTS ======
% fdiff: logical true or false for identity
% TBA: HT matrix to transfer B into the coordinate system of A
% TAB: HT matrix to transfer A into the coordinate system of B
%
% EXAMPLE:
% loadweb JACO_robot.mat
% SGisidentical(JCF,SGtransR(JCF,rot(pi/3,pi/2,pi/6)))
%
% fname=SGwriteSTL(JC1,'JC1_tmp'), SGisidentical(JC1,fname)
% fname=SGwriteSTL(JC2,'JC2_tmp'), SGisidentical(JC1,fname)
%
% A=SGbox; B=SGtransT(SGtetramesh(A),TofPez([10 10 10],[-1 -1 1]));
% SGfigure(-30,30); SGplotalpha(A,'r','','r'); SGplotalpha(B,'g','','g');
% SGisidentical(A,SGremsurfedgepoints(B))
%
% See also: SGisconvex, SGisInterior
%
%
% Copyright 2019-2022 Tim C. Lueth

SGwriteSTLarchive(SG,atype,nmax)- Creates an archive directory for separated solids and surfaces of different Solids/STL files

SGwriteSTLarchive(SG,atype,nmax)% SGwriteSTLarchive(SG,atype,nmax) - Creates an archive directory for separated solids and surfaces of different Solids/STL files
% (by Tim Lueth, VLFL-Lib, 2019-OKT-21 as class: SURFACES)
%
% With the introduction of larger module libraries for STL files from
% some robot manufacturers such as HEBI, it makes sense to separate the
% relevant STL files and automatically divide them into types such as 8 x
% 16 Allen screws.
% This fnctn creates an archive for separate surfaces within STL files
% (Status of: 2019-10-25)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGseparate, SGsurfaces, SGgrabcad, SGisidentical
%
% II=SGwriteSTLarchive([SG,atype,nmax])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% atype: 'solid' or 'surfaces' depending on separating demand
% nmax:
% === OUTPUT RESULTS ======
% II:
%
% See also: SGseparate, SGsurfaces, SGgrabcad, SGisidentical
%
%
% Copyright 2019 Tim C. Lueth

SGvenacavainferiorring(DA,dmin,dmax)- creates a ring for the Vena Carva Inferior

SGvenacavainferiorring(DA,dmin,dmax)% SGvenacavainferiorring(DA,dmin,dmax) - creates a ring for the Vena Carva Inferior
% (by Tim Lueth, VLFL-Lib, 2019-OKT-09 as class: SURFACES)
%
% At the request of Professor Dr. Peter Ewert, German Heart Center Munich
% (Status of: 2019-10-09)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGcontourtube2, SGspring, SGstent
%
% [SGr,SGvci]=SGvenacavainferiorring([DA,dmin,dmax])
% === INPUT PARAMETERS ===
% DA: Diameter of the Carva Inferior vein
% dmin: minimal diameter of the ring
% dmax: maximal diameter of the ring
% === OUTPUT RESULTS ======
% SGr: Solid of Ring to placed through catheter
% SGvci: Solid Geometry of Carva Inferior vein
%
% EXAMPLE:
% SGvenacavainferiorring(12,1,2)
%
% See also: SGcontourtube2, SGspring, SGstent
%
%
% Copyright 2019 Tim C. Lueth

ELangleofLATAP(Wlat,Wap)- returns the bending angle for a katheter based on LAT and AP angles

ELangleofLATAP(Wlat,Wap)% ELangleofLATAP(Wlat,Wap) - returns the bending angle for a katheter based on LAT and AP angles
% (by Tim Lueth, VLFL-Lib, 2019-OKT-09 as class: ANALYTICAL GEOMETRY)
%
% At the request of Professor Dr. Peter Ewert, German Heart Center Munich
% (Status of: 2019-10-09)
%
% Introduced first in SolidGeometry 4.8
%
% EL=ELangleofLATAP([Wlat,Wap])
% === INPUT PARAMETERS ===
% Wlat: LAT angle in degree
% Wap: AP angle in degree
% === OUTPUT RESULTS ======
% EL: Elevation bending angle
%
% EXAMPLE:
% ELangleofLATAP(10,40)
%
%
% Copyright 2019 Tim C. Lueth

TofVLFL(VL,FL,fi)- creates a T vector for surface

TofVLFL(VL,FL,fi)% TofVLFL(VL,FL,fi) - creates a T vector for surface
% (by Tim Lueth, VLFL-Lib, 2019-SEP-12 as class: SURFACES)
%
% In contrast to TofVL, this fnctn uses the direction of a facet to
% define the ez-vector. The center points is still calculated using
% centerVL.
% IN SG-LIB 5.0 we have to following concepts:
% - (2010) - T3P: T - right hand system from 3 Point. Origin is p1
% - (2012) - TofVL: T - Eigenvalues and Center of convexhull of VL
% - (2015) - PLofVL: T - ex is the longest distance of mean(VL)
% - (2016) - TofPez: T - ey has no x dimension or ex=[0 0 1]
% - (2019) - TofVLFL:T - ez is calucated from the face normals, o=mean(VL)
% - (2020) - VLeigenvect - same as TofVL but no convex hull and faster
% - (2020) - TofCVL: T - ez is calucated from the edge normals, o=mean(VL)
% (Status of: 2020-09-14)
%
% Introduced first in SolidGeometry 4.8
%
% See also: TofVLFL, VLeigenvect, TofVL, T3P, TofPez, PLofVL, TofCVL,
% centerVL
%
% [T,ez]=TofVLFL(VL,FL,[fi])
% === INPUT PARAMETERS ===
% VL: Vertex List
% FL: Facet List
% fi: optional facet index list
% === OUTPUT RESULTS ======
% T: HT Matrix of the surface
% ez: ez vector of the surface
%
% EXAMPLE:
% SG=SGservosample(1); FLofSGz(SG,'zmin'); FLi=find(ans);
% TofVLFL(SG.VL,SG.FL,FLi)
%
%
% See also: TofVLFL, VLeigenvect, TofVL, T3P, TofPez, PLofVL, TofCVL,
% centerVL
%
%
% Copyright 2019-2020 Tim C. Lueth

SGservoshaft(SG,h,T)- separates Solid Geoemetry of Servo and Servoshaft

SGservoshaft(SG,h,T)% SGservoshaft(SG,h,T) - separates Solid Geoemetry of Servo and Servoshaft
% (by Tim Lueth, VLFL-Lib, 2019-SEP-12 as class: SURFACES)
%
% The separation of Servomotor and Servoshaft is required if the shaft is
% not symmetric and its geometry has to be take into account as swept
% solid geometry for collision avoidance ==> SGsweepTproj (Status of:
% 2019-09-13)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGservosample, SGsweepTproj
%
% [SGB,SGA]=SGservoshaft(SG,[h,T])
% === INPUT PARAMETERS ===
% SG: Solid Geoemtry
% h: height of shaft; default is 2.9 mm
% T: HT Matrix or Name for from' default is 'Shaft'
% === OUTPUT RESULTS ======
% SGB: Solid Geometry of Shaft
% SGA: Solid Geometry of Servo without shaft
%
% EXAMPLE:
% n=4; SGservosample(n); SG=ans; SGservoshaft(SG); SGS=ans; SGsweepTproj(SGS)
%
% See also: SGservosample, SGsweepTproj
%
%
% Copyright 2019 Tim C. Lueth

SGsweepTproj(SG,wt,T,b)- sweeps the outer contour of a solid to create a swept solid

SGsweepTproj(SG,wt,T,b)% SGsweepTproj(SG,wt,T,b) - sweeps the outer contour of a solid to create a swept solid
% (by Tim Lueth, VLFL-Lib, 2019-SEP-10 as class: SURFACES)
%
% Introduced first in SolidGeometry 4.8
%
% See also: CPLsweep, CPLofSGhull
%
% SGS=SGsweepTproj(SG,[wt,T,b])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% wt: angle interval [wmin wmax]
% T: sweeping z-axis or HT Matrix or Frame char
% b: buffer to increase swept volume
% === OUTPUT RESULTS ======
% SGS: Swept Solid Geometry
%
% EXAMPLE:
% SGsweepTproj(SGservosample(1),'',[1 0 0],2)
% SGsweepTproj(SGservosample(1),'',[0 1 0],2)
% SGsweepTproj(SGservosample(1),'',[0 0 1],2) % default
%
% See also: CPLsweep, CPLofSGhull
%
%
% Copyright 2019 Tim C. Lueth

SGservomounting(SG,h1,h2)- shows how to create servo motor mounting sets

SGservomounting(SG,h1,h2)% SGservomounting(SG,h1,h2) - shows how to create servo motor mounting sets
% (by Tim Lueth, VLFL-Lib, 2019-SEP-06 as class: AUTOMATIC DESIGN)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGservosample, SGservoshaft, SGsweepTproj, SGmotorG50V6
%
% SGservomounting(SG,[h1,h2])
% === INPUT PARAMETERS ===
% SG: STL of Servo
% h1: height of shaft
% h2: height of housing
%
% EXAMPLE:
% SGservosample(6); SG=ans;
% SGservomounting(SG,3,20)
%
%
% See also: SGservosample, SGservoshaft, SGsweepTproj, SGmotorG50V6
%
%
% Copyright 2019-2020 Tim C. Lueth

SGservosample(n,cmd,SGN)- returns STL Solids of Servomotors

SGservosample(n,cmd,SGN)% SGservosample(n,cmd,SGN) - returns STL Solids of Servomotors
% (by Tim Lueth, VLFL-Lib, 2019-SEP-04 as class: SURFACES)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGsample, PLsample, SGmotorG50V6
%
% SG=SGservosample(n,[cmd,SGN])
% === INPUT PARAMETERS ===
% n: number or name string
% cmd: optional command such as 'add' or 'rm'
% SGN: Servo solid to add if 'add' is used
% === OUTPUT RESULTS ======
% SG:
%
% EXAMPLE:
% SGservosample('919')
% SGservosample(7)
%
% See also: SGsample, PLsample, SGmotorG50V6
%
%
% Copyright 2019-2020 Tim C. Lueth

FLofSGz(SG,z,tol)- returns the planar faces for a z value and the faces that have edges for this z value

FLofSGz(SG,z,tol)% FLofSGz(SG,z,tol) - returns the planar faces for a z value and the faces that have edges for this z value
% (by Tim Lueth, VLFL-Lib, 2019-SEP-04 as class: SURFACES)
%
% Similar to SGslicercheck (Status of: 2019-09-12)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGslicercheck
%
% [FLi,z,ELi]=FLofSGz(SG,[z,tol])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% z: z scalar value for slicing; or 'max' or 'min'
% tol: tolerance for z difference; default is 1e-3
% === OUTPUT RESULTS ======
% FLi: index list of planar faces
% z: index list of faces with edges in the z plane
% ELi: Edge list index with 2 in the plane
%
% EXAMPLE:
% FLofSGz(SGbox([30,20,10]),0)
% FLofSGz(SGbox([30,20,10]),-5)
% FLofSGz(SGbox([30,20,10]),+5)
%
%
% See also: SGslicercheck
%
%
% Copyright 2019 Tim C. Lueth

SGslicercheck(SG,z)- checks for problems with faces and edges in the slicing plane

SGslicercheck(SG,z)% SGslicercheck(SG,z) - checks for problems with faces and edges in the slicing plane
% (by Tim Lueth, VLFL-Lib, 2019-SEP-03 as class: SURFACES)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGslicer, CPLofSGslice, SGcut
%
% [n,F,L1,L2,L3]=SGslicercheck(SG,[z])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% z: z value for slicing
% === OUTPUT RESULTS ======
% n: [number of faces, number of edges] empty if there are no problems
% F: index list of faces
% L1: index list of edge 1-2
% L2: index list of edge 2-3
% L3: index list of edge 3-1
%
% EXAMPLE:
% SGslicercheck(SGbox([30,20,10]),-5)
% SGslicercheck(SGbox([30,20,10]),+5)
% SGslicercheck(SGbox([30,20,10]),0)
%
% See also: SGslicer, CPLofSGslice, SGcut
%
%
% Copyright 2019 Tim C. Lueth

SGmirrorTxy (SG,T)- mirrors a solid at the xy plane of a HT matrix

SGmirrorTxy (SG,T)% SGmirrorTxy (SG,T) - mirrors a solid at the xy plane of a HT matrix
% (by Tim Lueth and Yilun Sun, VLFL-Lib, 2019-SEP-03 as class: SURFACES)
%
% based on a request of Yilun Sun, who implemented his own solution first.
% Supports ez vectors as char 'x' with SGlib 5.1 and cells of SG
% Since SG-lib 5.2 this fnctn also mirrows frames (Status of: 2022-05-01)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGcopyrotZ, SGcopyVL, SGpatternXYZ, SGpatternRotz, ezofchar
%
% SGmirrorTxy(SG,[T])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% T: HT matrix or ez vector of char
%
% EXAMPLE:
% SGtransP(SGbox,[40 40 40]); SG=ans; SGfigure(SG);
% SGtransP(SGbox,[10 10 10]); SG=ans; SGfigure(SG);
% SGmirrorTxy(SG,TofR(rot(pi/5,pi/5,pi/5)))
% SGmirrorTxy(SG,TofR(eul2rotm([0,0,0],'XYZ')))
% SGmirrorTxy(SG,TofR(eul2rotm([pi/2,0,0],'XYZ')))
%
% See also: SGcopyrotZ, SGcopyVL, SGpatternXYZ, SGpatternRotz, ezofchar
%
%
% Copyright 2019-2022 Tim C. Lueth

SGjacohand- returns the JACO hand with fingers

SGjacohand% SGjacohand - returns the JACO hand with fingers
% (by Tim Lueth, VLFL-Lib, 2019-AUG-29 as class: MODELING PROCEDURES)
%
% compiles the hand and the fingers from mat file "JACO_robot.mat"
% (Status of: 2020-09-24)
%
% Introduced first in SolidGeometry 4.8
%
% See also: SGjacosample, SGTframeChain, SGTchain
%
% SGn=SGjacohand
% === OUTPUT RESULTS ======
% SGn: CEll list of hand plus 3 fingers
%
% EXAMPLE:
% loadweb JACO_robot.mat
% SGjacohand; SGH=ans
%
% See also: SGjacosample, SGTframeChain, SGTchain
%
%
% Copyright 2019-2020 Tim C. Lueth

VLFL_Toolbox_revision (chngdate)- creates m and p file for minor changes of after a release

VLFL_Toolbox_revision (chngdate)% VLFL_Toolbox_revision (chngdate) - creates m and p file for minor changes of after a release
% (by Tim Lueth, VLFL-Lib, 2019-AUG-23 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.8
%
% See also: lasttouchedSG, pcodeTL, VLFL_Toolbox_make
%
% VLFL_Toolbox_revision([chngdate])
% === INPUT PARAMETERS ===
% chngdate: date of last release
%
% See also: lasttouchedSG, pcodeTL, VLFL_Toolbox_make
%
%
% Copyright 2019-2022 Tim C. Lueth
RapidWeaver Icon

Last Change Oct 2023 for SG-Lib 5.3