Last change of this documentation page: 2022-06-02 of SolidGeometry 4.7
SGfigurepapermode- removes picture title and increases font size for publications

SGfigurepapermode% SGfigurepapermode - removes picture title and increases font size for publications
% (by Tim Lueth and Yilun Sun, VLFL-Lib, 2019-AUG-12 as class: USER
% INTERFACE)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGfigureeval
%
% SGfigurepapermode
%
% EXAMPLE:
% SGfigure(SGbox)
% SGfigurepapermode
%
% See also: SGfigureeval
%
%
% Copyright 2019 Tim C. Lueth

PoseofCPLui(CPLP,CPLB,CPLW)- allows the interactive move of poses of contours

PoseofCPLui(CPLP,CPLB,CPLW)% PoseofCPLui(CPLP,CPLB,CPLW) - allows the interactive move of poses of contours
% (by Tim Lueth, VLFL-Lib, 2019-AUG-05 as class: KINEMATICS AND FRAMES)
%
% Introduced first in SolidGeometry 4.7
%
% See also: Poseofimageui, Poseorderchange, Posetransui
%
% PS=PoseofCPLui(CPLP,[CPLB,CPLW])
% === INPUT PARAMETERS ===
% CPLP: Effektor contour
% CPLB: Background Contour
% CPLW: Warning/Blocked Contour
% === OUTPUT RESULTS ======
% PS: Pose Struct include A, B, CPLE, CPLB, CPLW
%
% EXAMPLE:
% CPL=PLcircle(70,'','',80); CPLW=PLcircle(60,'','',70); CPL=[CPL; nan nan; CPLW];
% SGfigure; CPLplot(CPL,'r-'); CPS=polyshape(CPL); CPSplot(CPS);
% [CPLB,CPLE]=CPLsplitbool(CPL);cla; CPSplot(CPLE,'g'); CPSplot(CPLB,'k');
% PoseofCPLui (CPLE,CPLB,CPLW); PS=ans
%
% See also: Poseofimageui, Poseorderchange, Posetransui
%
%
% Copyright 2019-2020 Tim C. Lueth

smlDeleteall(asys,typ)- delete all lines and block of a block diagram

smlDeleteall(asys,typ)% smlDeleteall(asys,typ) - delete all lines and block of a block diagram
% (by Tim Lueth, VLFL-Lib, 2019-AUG-04 as class: SIMMECHANICS)
%
% Introduced first in SolidGeometry 4.7
%
% See also: smbDeleteUnconnectedLines
%
%
% smlDeleteall([asys,typ])
% === INPUT PARAMETERS ===
% asys: default is gcs
% typ: default is {'line','block}
%
% EXAMPLE:
% new_system('SGLib_Arduino_Example','FromFile','Example_Arduino.slx'); open_system('SGLib_Arduino_Example');
% smlDeleteall(gcs,'line')
%
% See also: smbDeleteUnconnectedLines
%
%
%
% Copyright 2019 Tim C. Lueth

smlhelp- simply open the help page for programmatic model editing

smlhelp% smlhelp - simply open the help page for programmatic model editing
% (by Tim Lueth, VLFL-Lib, 2019-AUG-03 as class: SIMMECHANICS)
%
% Introduced first in SolidGeometry 4.7
%
% See also: smbhelp
%
% smlhelp
%
% See also: smbhelp
%
%
% Copyright 2019 Tim C. Lueth

smlArduinoexample- creates a servo motor simulink model for stand-alone application on arduino

smlArduinoexample% smlArduinoexample - creates a servo motor simulink model for stand-alone application on arduino
% (by Tim Lueth, VLFL-Lib, 2019-AUG-03 as class: SIMMECHANICS)
%
% This fnctn creates programmatically the simulink sheet for servo motor
% control
%
% This information was collected by Andreas Schroeffer in August 2019.
% Use the ADD-ONS/MANAGE-ADD-ONs button in the HOME menu of the command
% window. Install the MATLAB Support Package for Arduino Hardware first.
% Install the MATLAB Simulink Support Package for Arduino Hardware
% afterwards. For "setup", the Arduino must be connected to a USB port.
% The computer should have less than 16 USB ports during the
% installation. Remove all USB hubs from the Matlab computer.
% For PC and MAC tested by Andreas Schroeffer, Christoph Rehekampff,
% Yilun Sun, Tim Lueth
%
% There are three challanges for this fnctn
% 1) Programmatical Block Diagramm Design
% 2) Parameterization of the Solver for the Simulation
% 3) Parameterization of the Coder for the stand-alone-Programm on Arduino
% Currently for (2) and (3) a .slx file is used that was created for
% arduino by Mathwork staff
% (Status of: 2019-08-22)
%
% Introduced first in SolidGeometry 4.7
%
% See also: smlNewSystem, smlArduinohelp
%
% smlArduinoexample
%
% EXAMPLE:
% smlArduinoexample
%
% See also: smlNewSystem, smlArduinohelp
%
%
% Copyright 2019-2020 Tim C. Lueth

smlNewSystem(SName,Coder)- opens a new simulink sheet - overwrites an exiting one

smlNewSystem(SName,Coder)% smlNewSystem(SName,Coder) - opens a new simulink sheet - overwrites an exiting one
% (by Tim Lueth, VLFL-Lib, 2019-AUG-03 as class: SIMMECHANICS)
%
% The Coder parameters are taken from a file named 'Example_Arduino.slx'.
% If this file is missing, try loadweb ('Example_Arduino.slx',true);
% (Status of: 2019-08-05)
%
% Introduced first in SolidGeometry 4.7
%
% See also: smbNewSystem
%
% smlNewSystem([SName,Coder])
% === INPUT PARAMETERS ===
% SName: Name of the new system such as
% Coder: Name of Sheet Example; default is 'arduino'
%
% EXAMPLE:
% smlNewSystem('SGLib_Arduino_Example')
%
%
% See also: smbNewSystem
%
%
% Copyright 2019 Tim C. Lueth

smbhelp- This fnct is intended to provide a quick and efficient introduction to the programmable interface of simulink and simscape.

smbhelp% smbhelp - This fnct is intended to provide a quick and efficient introduction to the programmable interface of simulink and simscape.
% (by Tim Lueth, VLFL-Lib, 2019-AUG-02 as class: SIMMECHANICS)
%
% Introduced first in SolidGeometry 4.7
%
% See also: slhelp
%
% smbhelp
%
% See also: slhelp
%
%
% Copyright 2019 Tim C. Lueth

SGscale2dim(SG,dim,scc,T)- scales a solid to fit into a box with given dimensions

SGscale2dim(SG,dim,scc,T)% SGscale2dim(SG,dim,scc,T) - scales a solid to fit into a box with given dimensions
% (by Tim Lueth, VLFL-Lib, 2019-AUG-02 as class: SURFACES)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGgrowoutsideFS, SGgrow, SGmagnifyVL, SGshrinktofit
%
% SGN=SGscale2dim(SG,[dim,scc,T])
% === INPUT PARAMETERS ===
% SG: Solid Geoemtry
% dim: size in [x y z]
% scc: dimensions to consider default is 'xyz'
% T: optional Coordinate system or frame name that defines x y zdefault
% is ''
% === OUTPUT RESULTS ======
% SGN: New Geometry
%
% EXAMPLE:
% SGscale2dim(SGbox,[10 10 10],'yz')
%
% See also: SGgrowoutsideFS, SGgrow, SGmagnifyVL, SGshrinktofit
%
%
% Copyright 2019-2020 Tim C. Lueth

SGselectGroupofBBvol(SGorg,gtyp)- returns the solid ordered by volumes

SGselectGroupofBBvol(SGorg,gtyp)% SGselectGroupofBBvol(SGorg,gtyp) - returns the solid ordered by volumes
% (by Tim Lueth, VLFL-Lib, 2019-AUG-02 as class: AUTOMATIC DESIGN)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGselectGroupofT
%
% [SGN,SGall,vol,bb]=SGselectGroupofBBvol(SGorg,[gtyp])
% === INPUT PARAMETERS ===
% SGorg: Original Solid
% gtyp: group method for SGanalyzePenetration
% === OUTPUT RESULTS ======
% SGN: largest Solid
% SGall: All Solids sorted by volume of bb
% vol: vol of bb
% bb: bounding box
%
% EXAMPLE:
% SGselectGroupofBBvol(SGsample(17))
% SGselectGroupofBBvol(SGsample(17),'box')
%
% See also: SGselectGroupofT
%
%
% Copyright 2019 Tim C. Lueth

smlArduinohelp(request)- help to connect an arduino to matlab since 2018b

smlArduinohelp(request)% smlArduinohelp(request) - help to connect an arduino to matlab since 2018b
% (by Tim Lueth, VLFL-Lib, 2019-AUG-01 as class: USB INTERFACE)
%
% Andreas Schroeffer motivated this fnctn. Information was collected by
% For PC and MAC by Andreas Schroeffer, Christoph Rehekampff, Yilun Sun,
% Tim Lueth for PC and MAC.
% (Status of: 2019-08-03)
%
% Introduced first in SolidGeometry 4.7
%
% See also: USBhelp, smlArduinoexample
%
% smlArduinohelp([request])
% === INPUT PARAMETERS ===
% request:
%
% See also: USBhelp, smlArduinoexample
%
%
% Copyright 2019 Tim C. Lueth

SGselectGroupofT(SG,T,gmethod)- returns the part of the solid that contains a point, or a frame center

SGselectGroupofT(SG,T,gmethod)% SGselectGroupofT(SG,T,gmethod) - returns the part of the solid that contains a point, or a frame center
% (by Tim Lueth, VLFL-Lib, 2019-AUG-01 as class: SURFACES)
%
% ATTENTION: SGselectGroupofT is based on SGanalyzeGroupParts is based on
% SGanalyzePenetration is based on VLFLinpolyhedron. VLFLinpolyhedron has
% a some bug such as the problem to interprete multi-surface solids
% (Status of: 2019-08-02)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGselect3d, SGanalyzePenetration, SGanalyzeGroupParts
%
%
% SGN=SGselectGroupofT(SG,T,[gmethod])
% === INPUT PARAMETERS ===
% SG: Solid
% T: Frame or point
% gmethod: default is 'box'
% === OUTPUT RESULTS ======
% SGN: Selected Groups of Solids
%
% EXAMPLE:
% SGselectGroupofT(SGsample(17),[0 0 5]) % wrong result
% SGselectGroupofT(SGsample(17),[1 1 5]) % correct result
%
% See also: SGselect3d, SGanalyzePenetration, SGanalyzeGroupParts
%
%
%
% Copyright 2019 Tim C. Lueth

dbprintf(var2base)- like printf but shows the calling fnct and with dbprintmode also an hyperlink

dbprintf(var2base)% dbprintf(var2base) - like printf but shows the calling fnct and with dbprintmode also an hyperlink
% (by Tim Lueth, VLFL-Lib, 2019-AUG-01 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.7
%
% See also: dbreturn, dbexit, dbsave, dbprintmode, debugTL, fprintf,
% sprintf, fprintfvec, fprintfvec2, str2codelines, sprintfvec
%
% dbprintf([var2base])
% === INPUT PARAMETERS ===
% var2base: parameter such as of printf
%
% EXAMPLE:
% dbprintf('test')
%
% See also: dbreturn, dbexit, dbsave, dbprintmode, debugTL, fprintf,
% sprintf, fprintfvec, fprintfvec2, str2codelines, sprintfvec
%
%
% Copyright 2019-2021 Tim C. Lueth

thisfuncname- just returns the name of the calling fnct

thisfuncname% thisfuncname - just returns the name of the calling fnct
% (by Tim Lueth, VLFL-Lib, 2019-AUG-01 as class: AUXILIARY PROCEDURES)
%
% very similar to titleofcaller (Status of: 2019-08-01)
%
% Introduced first in SolidGeometry 4.7
%
% See also: titleofcaller
%
% [t,td]=thisfuncname
% === OUTPUT RESULTS ======
% t: name of calling fnctn
% td:
%
% EXAMPLE:
% thisfuncname
%
% See also: titleofcaller
%
%
% Copyright 2019 Tim C. Lueth

SGTcopynames(SGA,SGB,ListB,ListA,Overw)- copies Frames from one Solid into another one

SGTcopynames(SGA,SGB,ListB,ListA,Overw)% SGTcopynames(SGA,SGB,ListB,ListA,Overw) - copies Frames from one Solid into another one
% (by Tim Lueth, VLFL-Lib, 2019-JUL-31 as class: KINEMATICS AND FRAMES)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGTset, SGTremove, SGTcopy, SGTui, SGTget, SGTplot,
% SGTframeplot, SGTsetofFS
%
% SGA=SGTcopynames(SGA,SGB,[ListB,ListA,Overw])
% === INPUT PARAMETERS ===
% SGA: Solid to receive frames
% SGB: Solid to cope frames from
% ListB: optional list of frames to copy
% ListA: optional new name of frames to copy
% Overw: if true; force overwrite
% === OUTPUT RESULTS ======
% SGA: Modified Solid with unique framenames
%
% EXAMPLE:
% SG=JACOsample(1)
% SGTcopynames(SGTremove(SG,{'B'}),SG,{'F','B'},{'F','Y'},false)
%
%
%
% See also: SGTset, SGTremove, SGTcopy, SGTui, SGTget, SGTplot,
% SGTframeplot, SGTsetofFS
%
%
% Copyright 2019 Tim C. Lueth

SGjacosample(n,m)- creates magnified solids in the workspace

SGjacosample(n,m)% SGjacosample(n,m) - creates magnified solids in the workspace
% (by Tim Lueth, VLFL-Lib, 2019-JUL-31 as class: SURFACES)
%
% Introduced first in SolidGeometry 4.7
%
% See also: JACOmodel, jaco05
%
% SG=SGjacosample([n,m])
% === INPUT PARAMETERS ===
% n: number of link or string of link such as 'JCF'
% m: magnification size; default is .48
% === OUTPUT RESULTS ======
% SG: Solid Geometry of the JACO robot module in magnification size m
%
% EXAMPLE:
% % SGjacosample
% JC0=SGjacosample('JC0'); JC1=SGjacosample('JC1');
% SGTconnectingplug(JC0,JC1,{'F','B'},10)
%
% See also: JACOmodel, jaco05
%
%
% Copyright 2019 Tim C. Lueth

SGprintPreForm(SG,ptyp)- sends an SG to the PreForm app of Formlab

SGprintPreForm(SG,ptyp)% SGprintPreForm(SG,ptyp) - sends an SG to the PreForm app of Formlab
% (by Tim Lueth, VLFL-Lib, 2019-JUL-31 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGmeshlab
%
% SG=SGprintPreForm(SG,[ptyp])
% === INPUT PARAMETERS ===
% SG: Solid Geoemetry to print
% ptyp: 'arrange', 'box', 'pack', 'sep'
% === OUTPUT RESULTS ======
% SG:
%
% EXAMPLE:
% SGprintPreForm(SGbox)
%
% See also: SGmeshlab
%
%
% Copyright 2019 Tim C. Lueth

volofBB(BB)- simply returns the volume of a bounding box or a cell list of bounding boxes

volofBB(BB)% volofBB(BB) - simply returns the volume of a bounding box or a cell list of bounding boxes
% (by Tim Lueth, VLFL-Lib, 2019-JUL-30 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.7
%
% See also: sofBB, BBofCPL, BBofCPS, BBofPose, BBofPS, BBofSG,
% BBofSGcutT, BBofT, BBofVL
%
% V=volofBB(BB)
% === INPUT PARAMETERS ===
% BB: Bounding Boxes
% === OUTPUT RESULTS ======
% V: Volume
%
% EXAMPLE:
% volofBB(SGbox)
%
% See also: sofBB, BBofCPL, BBofCPS, BBofPose, BBofPS, BBofSG,
% BBofSGcutT, BBofT, BBofVL
%
%
% Copyright 2019 Tim C. Lueth

VMofSGweight(SG,d)- returns a voxel model of a Solid Geoemtry using SGweight/SGisinterior

VMofSGweight(SG,d)% VMofSGweight(SG,d) - returns a voxel model of a Solid Geoemtry using SGweight/SGisinterior
% (by Tim Lueth, VLFL-Lib, 2019-JUL-30 as class: VOXELS)
%
% The voxel size is adjusted automatically to maximize the resolution.
% The absolute position in space is lost. The orientation is unchanged.
% (Status of: 2019-07-30)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGweight, SGvolume, SGisInterior, VMofSG, SGofVMdelaunay,
% SGofVMmarchcube, VMofSG, VMplot
%
% [VM,sz,SGN,xl,yl,zl]=VMofSGweight(SG,[d])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% d: size of voxel
% === OUTPUT RESULTS ======
% VM: Voxel Model
% sz: Voxel size
% SGN: Optional Solid by marching cube
% xl: list of x values of the Voxel Model
% yl: list of x values of the Voxel Model
% zl: list of x values of the Voxel Model
%
% EXAMPLE:
% VMofSGweight(SGsample(27),.5); VM=ans; whos VM
% % VMdistancetoSG(VM)
%
% See also: SGweight, SGvolume, SGisInterior, VMofSG, SGofVMdelaunay,
% SGofVMmarchcube, VMofSG, VMplot
%
%
% Copyright 2019 Tim C. Lueth

SGmeshtetrahedron(SG,h)- creates a tetramesh of a Solid Geometry - same as SGmeshtetrahedron

SGmeshtetrahedron(SG,h)% SGmeshtetrahedron(SG,h) - creates a tetramesh of a Solid Geometry - same as SGmeshtetrahedron
% (by Tim Lueth, VLFL-Lib, 2019-JUL-30 as class: FEM/PDE)
%
% USE SGshortopti before to remove oben boundaries and non manifold
% vertices
% This fnctn uses the importGeometry and generateMesh fnctns of the
% PDE-Toolbox to create a mesh of the solid an creates a triangualatin
% from this data.
% ATTENTION: SGtetramesh WILL NOT MELT SEPERATED SOLIDS, They are still
% independent surfaces
% In contrast to the normal PDE mesh, the linear mode is used here to
% create the 4-facet meshes directly
%
% If SGtetramesh fails with error: "The input mesh is invalid" =>
% SGcheckmeshlab
% If SGtetramesh fails with error: "Meshing failed with a Hmax of" =>
% Self intrusion! (Status of: 2022-05-23)
%
% Introduced first in SolidGeometry 4.7
%
% See also: pdemodelofSG, SGtetramesh, SGaddfacetcenterpoints
%
%
% [SGn,VL,FL,TR]=SGmeshtetrahedron(SG,[h])
% === INPUT PARAMETERS ===
% SG: Solid Geoemtry
% h: maximum mesh length; default is sofBB/20
% === OUTPUT RESULTS ======
% SGn: Solid Geoemtry based on a PDE mesh
% VL: Vertex list
% FL: Facet list
% TR: Tetrahedron triangulation
%
% EXAMPLE:
% SGtetramesh(SGsample(17))
% SGtetramesh(SGsample(17),3)
% SGtetramesh(SGsample(35)) % failes because of non manifold
% SGtetramesh(SGsample(36)) % failes because of self intrusion
%
% See also: pdemodelofSG, SGtetramesh, SGaddfacetcenterpoints
%
%
%
% Copyright 2019-2022 Tim C. Lueth

VMdistancetoSG(SG,d,invert,frame)- Creates a Voxel model with distance values from the surface

VMdistancetoSG(SG,d,invert,frame)% VMdistancetoSG(SG,d,invert,frame) - Creates a Voxel model with distance values from the surface
% (by Tim Lueth, VLFL-Lib, 2019-JUL-29 as class: SURFACES)
%
% Same as GPLdistancetoCPL in 3D (Status of: 2019-07-29)
%
% Introduced first in SolidGeometry 4.7
%
% See also: GPLdistancetoCPL
%
% [VM,VMi]=VMdistancetoSG(SG,[d,invert,frame])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% d: grid distance
% invert:
% frame:
% === OUTPUT RESULTS ======
% VM: Integer Voxel Model for
% VMi: Logical Voxel Model for iswall
%
% EXAMPLE:
% M=repmat(eye(5),[1 1 5]);
% M=repmat(eye(50),[1 1 50]); VMdistancetoSG(M);
% M=repmat(eye(50),[1 1 50]); VMdistancetoSG(M,'',false,true); VMM=ans;
% SGfigure; view(-30,30); VMscatter(VMM(:,:,1:25));
%
% See also: GPLdistancetoCPL
%
%
% Copyright 2019 Tim C. Lueth

VMscatter(VM,)- Plots a 3D matrix as particle model

VMscatter(VM,)% VMscatter(VM,) - Plots a 3D matrix as particle model
% (by Tim Lueth, VLFL-Lib, 2019-JUL-29 as class: VOXELS)
%
% h=VLscatter(VLofVM(VM),VM(VM>0),varargin{:});
% (Status of: 2019-07-30)
%
% Introduced first in SolidGeometry 4.7
%
% See also: VLscatter, SGofVMdelaunay, SGofVMisosurface, SGofVMmarchcube
%
% h=VMscatter(VM,[])
% === INPUT PARAMETERS ===
% VM: 3D Matrix to plot
% === OUTPUT RESULTS ======
% h: handle to graphics object
%
% See also: VLscatter, SGofVMdelaunay, SGofVMisosurface, SGofVMmarchcube
%
%
% Copyright 2019 Tim C. Lueth

VMneighborhood(M,nn)- returns of a n x m or n x m x k 2D or 3D Matrix the neighborhood values

VMneighborhood(M,nn)% VMneighborhood(M,nn) - returns of a n x m or n x m x k 2D or 3D Matrix the neighborhood values
% (by Tim Lueth, VLFL-Lib, 2019-JUL-28 as class: AUXILIARY PROCEDURES)
%
% This auxiliary fnctn is used to create filter for 2D and 3D matrices
% Learn also about "Structuring Elements of Matlab" (Status of:
% 2019-07-29)
%
% Introduced first in SolidGeometry 4.7
%
% See also: strel, strel2nhood
%
% [NH,ni]=VMneighborhood([M,nn])
% === INPUT PARAMETERS ===
% M: Matrix, the neighborhood is desired
% nn: neigborhood
% === OUTPUT RESULTS ======
% NH: Matrix of size [size(M) n] consisting already all neighbors
% ni: Neighborhoodindex for the use like M(ni), which is the same as NH
%
% EXAMPLE:
% M=nan(4,4); M(2:3,2:3)=eye(2)
% M=nan(5,5,5); M(2:4,2:4,2:4)= reshape(1:27,3,3,3); M=M*10
% M=nan(5,5,5); M(2:4,2:4,2:4)= reshape(floor(rand(1,27)*100),3,3,3); M=M
% NH=neighborhood(M,'4'); M, NH
% M=nan(4,4); M(2:3,2:3)=eye(2); NH=VMneighborhood(M,'4'); M, (sum(NH,3,'omitnan'))
% M=nan(4,4); M(2:3,2:3)=eye(2); NH=VMneighborhood(M,'4'); M, (mean(NH,3,'omitnan'))
% M=nan(4,4); M(2:3,2:3)=reshape(1:4,2,2)'; NH=VMneighborhood(M,'4'); M, (sum(NH,3,'omitnan'))
% M=nan(4,4); M(2:3,2:3)=reshape(1:4,2,2)'; NH=VMneighborhood(M,'4'); M, (mean(NH,3,'omitnan'))
% M=nan(4,4); M(2:3,2:3)=reshape(1:4,2,2)'; NH=VMneighborhood(M,'4'); M, (max(NH,'',3,'omitnan'))
% M=nan(4,4); M(2:3,2:3)=reshape(1:4,2,2)'; NH=VMneighborhood(M,'4'); M, (min(NH,'',3,'omitnan'))
% M=nan(4,4); M(2:3,2:3)=reshape(1:4,2,2)'; NH=VMneighborhood(M,'8'); M, (sum(NH,3,'omitnan'))
% M=nan(4,4); M(2:3,2:3)=reshape(1:4,2,2)'; NH=VMneighborhood(M,'4'); M, (sum(NH,3,'omitnan'))
% M=nan(4,4); M(2:3,2:3)=reshape(1:4,2,2)'; NH=VMneighborhood(M,'4'); M, IN=sum(isnan(NH),3)
% M=nan(4,4); M(2:3,2:3)=reshape(1:4,2,2)'; NH=VMneighborhood(M,'4'); M, IN=sum(isnan(NH),3), M=(sum(NH,3,'omitnan'))./(4-IN)
%
% See also: strel, strel2nhood
%
%
% Copyright 2019 Tim C. Lueth

Graphplot(G,GPL,M)- plot a graph with coodinates

Graphplot(G,GPL,M)% Graphplot(G,GPL,M) - plot a graph with coodinates
% (by Tim Lueth, VLFL-Lib, 2019-JUL-26 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.7
%
% See also: PLplot, VLplot, VLELplot, PLELplot, CPLplot, CPSplot
%
% h=Graphplot(G,[GPL,M])
% === INPUT PARAMETERS ===
% G: Graph
% GPL: optional Node Coordinates
% M: optional Color Values
% === OUTPUT RESULTS ======
% h: handle to graphics object
%
% See also: PLplot, VLplot, VLELplot, PLELplot, CPLplot, CPSplot
%
%
% Copyright 2019 Tim C. Lueth

SGTconnectingplug(SGA,SGB,FA,FB,h,ATyp,BTyp)- returns a solid part that can be used to connect both solids by a positive connection

SGTconnectingplug(SGA,SGB,FA,FB,h,ATyp,BTyp)% SGTconnectingplug(SGA,SGB,FA,FB,h,ATyp,BTyp) - returns a solid part that can be used to connect both solids by a positive connection
% (by Tim Lueth, VLFL-Lib, 2019-JUL-26 as class: AUTOMATIC DESIGN)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGTconnect, SGTcopy, SGcolorcopy, SGTconnectingplug
%
%
% SGTconnectingplug(SGA,SGB,[FA,FB,h,ATyp,BTyp])
% === INPUT PARAMETERS ===
% SGA: Solid A with a hole/cavity in direction of Frame FA
% SGB: Solid B with a hole/cavity in direction of Frame FB
% FA: Frame Name of a Frame at Solid SGA; default is 'F'
% FB: Frame Name of a Frame at Solid SGB; default is 'B'
% h: height
% ATyp: SGA Positive Connection Type for SGTconnect; default is 'plug'
% BTyp: SGB Positive Connection Type for SGTconnect; default is 'plug'
%
% EXAMPLE:
% A=SGsample(16); SGTset(A,'F',TofFS(A,[0 0 1])); A=ans;
% B=SGsample(7); SGTset(B,'B',TofFS(B,[0 0 1])); B=ans;
% SGTconnectingplug(B,A,'B','F')
%
% loadweb JACO_robot.mat; A=JC0, B=JC1
% SGTconnectingplug(A,B)
%
% See also: SGTconnect, SGTcopy, SGcolorcopy, SGTconnectingplug
%
%
%
% Copyright 2019 Tim C. Lueth

GPLnearestpoint(GPL,p)- returns the nearest point index within a Grid point list

GPLnearestpoint(GPL,p)% GPLnearestpoint(GPL,p) - returns the nearest point index within a Grid point list
% (by Tim Lueth, VLFL-Lib, 2019-JUL-25 as class: VOXELS)
%
% d=vecnormr(GPL-p); i=find(d==min(d)); i=i(1);
% (Status of: 2019-07-25)
%
% Introduced first in SolidGeometry 4.7
%
% See also: GPLdistancetoCPL
%
% [i,p]=GPLnearestpoint(GPL,[p])
% === INPUT PARAMETERS ===
% GPL: Grid Point List
% p: point to check
% === OUTPUT RESULTS ======
% i: nearest point
% p: point coordinates
%
% EXAMPLE:
% CPL=CPLsample(13); GPLdistancetoCPL(CPL,.1,'','','','',true);
% [GPL,k]=GPLdistancetoCPL(CPL,.1,'','','','',true);
% GPLnearestpoint(GPL)
%
% See also: GPLdistancetoCPL
%
%
% Copyright 2019 Tim C. Lueth

ELdistanceofmatrixneighbors(M,n)- Calculates from a potential field consisting of doubles and nan the neighborhood weights

ELdistanceofmatrixneighbors(M,n)% ELdistanceofmatrixneighbors(M,n) - Calculates from a potential field consisting of doubles and nan the neighborhood weights
% (by Tim Lueth, VLFL-Lib, 2019-JUL-25 as class: AUXILIARY PROCEDURES)
%
% This fnctn is used to create weighted edge lists for graphs for search
% algorithms
% 1 2 3
% 4 5 6
% 7 8 9
% (Status of: 2019-07-26)
%
% Introduced first in SolidGeometry 4.7
%
% See also: GPLdistancetoCPL
%
% [EL,iM,G]=ELdistanceofmatrixneighbors(M,[n])
% === INPUT PARAMETERS ===
% M: potential
% n: default is 4 neighborhood
% === OUTPUT RESULTS ======
% EL: Edge List [Start End Distance]
% iM: indices of Matrix
% G: weighted graph
%
% EXAMPLE:
% M=nan(4,4); M(2:3,2:3)=eye(2)
% M=nan(5,5); M(2:4,2:4)= reshape(1:9,[],3)'; M
% GPLdistancetoCPL(CPLsample(13),.1,'','','',true);
% [GPL,M]=GPLdistancetoCPL(CPLsample(13),.5,'','','',true);
% [EL,G]=ELdistanceofmatrixneighbors(M);
% ai=GPLnearestpoint(GPL), bi=GPLnearestpoint(GPL), pli=shortestpath(G,ai,bi); PLplot(GPL(pli,:))
%
% See also: GPLdistancetoCPL
%
%
% Copyright 2019 Tim C. Lueth

GPLparameters(x,y,z)- Auxiliary fnct to calculate xmin ymin dx and dy from a given meshrid or VL

GPLparameters(x,y,z)% GPLparameters(x,y,z) - Auxiliary fnct to calculate xmin ymin dx and dy from a given meshrid or VL
% (by Tim Lueth, VLFL-Lib, 2019-JUL-25 as class: AUXILIARY PROCEDURES)
%
% xmin=min(x,[],1:3)
% ymin=min(y,[],1:3)
% dx=x(1,2)-x(1,1)
% dy=y(2,1)-y(1,1)
% (Status of: 2019-07-25)
%
% Introduced first in SolidGeometry 4.7
%
% [orgp,delt,ux,uy,uz]=GPLparameters([x,y,z])
% === INPUT PARAMETERS ===
% x: GPL of x of meshgrid
% y: empty or y of meshgrid
% z: empty or y of meshgrid
% === OUTPUT RESULTS ======
% orgp: [minx miny minz]
% delt: [dx dy dz]
% ux: unique of x values usable for meshrid
% uy: unique of y values usable for meshrid
% uz: unique of z values usable for meshrid
%
% EXAMPLE:
% GPL=GPLauxgridpointsCPS(PLsquare(30,10),1);
% GPLparameters(GPL)
%
%
% Copyright 2019 Tim C. Lueth

GPLdistancetoCPL(CPL,GPL,k,x,y,cdown,cins)- returns for a grid point list the point distance insider or outside of a contour

GPLdistancetoCPL(CPL,GPL,k,x,y,cdown,cins)% GPLdistancetoCPL(CPL,GPL,k,x,y,cdown,cins) - returns for a grid point list the point distance insider or outside of a contour
% (by Tim Lueth, VLFL-Lib, 2019-JUL-24 as class: CLOSED POLYGON LISTS)
%
% This fnctn is required for path planning with maximal distance to
% contour walls
% For Solid Geometries use VMdistancetoSG instead (Status of: 2019-07-26)
%
% Introduced first in SolidGeometry 4.7
%
% See also: GPLauxgridpointsCPS, GPLdistancepointsCPS,
% GPLpotentialpointsCPS, VMdistancetoSG
%
% [GPL,k,x,y]=GPLdistancetoCPL(CPL,[GPL,k,x,y,cdown,cins])
% === INPUT PARAMETERS ===
% CPL: Contour to use
% GPL: grid distance or Grid point list
% k: inside outside analysis if existing
% x: x mesh grid
% y: y mesh grid
% cdown: distance to wall or distance to center
% cins: inside or outside contour
% === OUTPUT RESULTS ======
% GPL: Grid point list
% k: distance list; nan for prohibited areas
% x: x mesh grid
% y: y mesh grid
%
% EXAMPLE:
% CPL=PLsquare(40,10)
% GPLdistancetoCPL(CPL,.05,'','','','',true);
% CPL=CPLsample(13);
% GPLdistancetoCPL(CPL,.1,'','','','',true);
% GPLdistancetoCPL(CPLsample(13),.1,'','','',true);
% GPLdistancetoCPL(CPLsample(13),.1,'','','',false);
%
% See also: GPLauxgridpointsCPS, GPLdistancepointsCPS,
% GPLpotentialpointsCPS, VMdistancetoSG
%
%
% Copyright 2019 Tim C. Lueth

TRofCPL(CPL)- just returns a 2D triangulation

TRofCPL(CPL)% TRofCPL(CPL) - just returns a 2D triangulation
% (by Tim Lueth, VLFL-Lib, 2019-JUL-24 as class: SURFACES)
%
% same as delaunay triangulation
% [PL,EL]=PLELofCPL(CPL); TR2=delaunayTriangulation(PL,EL);
% (Status of: 2019-07-26)
%
% Introduced first in SolidGeometry 4.7
%
% See also: delaunayTriangulation, VLFLofCPL
%
%
% TR2=TRofCPL(CPL)
% === INPUT PARAMETERS ===
% CPL: CLosed Polygon list
% === OUTPUT RESULTS ======
% TR2: 2D Triangulation
%
% EXAMPLE:
% TRofCPL(CPLsample(16))
%
% See also: delaunayTriangulation, VLFLofCPL
%
%
%
% Copyright 2019 Tim C. Lueth

jaco05- returns all the parts fo the jaco robot in specified geometry

jaco05% jaco05 - returns all the parts fo the jaco robot in specified geometry
% (by Tim Lueth, VLFL-Lib, 2019-JUL-22 as class: MODELING PROCEDURES)
%
% Simple linear scaling at the moment (Status of: 2019-07-22)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGboxpacking
%
% SGn=jaco05
% === OUTPUT RESULTS ======
% SGn: Solid Geometry containing all parts and the box for printing
%
% EXAMPLE:
% jaco05
%
% See also: SGboxpacking
%
%
% Copyright 2019 Tim C. Lueth

CPLofSGThull(SG,T)- Creates the CPLofSGhull after an transformation relative to a frame

CPLofSGThull(SG,T)% CPLofSGThull(SG,T) - Creates the CPLofSGhull after an transformation relative to a frame
% (by Tim Lueth, VLFL-Lib, 2019-JUL-22 as class: KINEMATICS AND FRAMES)
%
% Introduced first in SolidGeometry 4.7
%
% See also: CPLofSGhull
%
% [CPL,T,CVL]=CPLofSGThull(SG,[T])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% T: Frame char or HT matrix
% === OUTPUT RESULTS ======
% CPL: CPL of contour (XY after transformation)
% T: HT matrix of transformation
% CVL: CVL of the spatial transformed CPL
%
% See also: CPLofSGhull
%
%
% Copyright 2019 Tim C. Lueth

TofFSui(SG,FS,rz,fe)- returns the frames of a touched surface

TofFSui(SG,FS,rz,fe)% TofFSui(SG,FS,rz,fe) - returns the frames of a touched surface
% (by Tim Lueth, VLFL-Lib, 2019-JUL-22 as class: KINEMATICS AND FRAMES)
%
% Based on SGTui
% TofFS - uses a ez vector or a number for indentification
% TofFSui - uses a user interaction for identification
% (Status of: 2019-07-29)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGTui, TofFS
%
% T=TofFSui(SG,[FS,rz,fe])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% FS: Selector such as 'R1'
% rz: optional ez rotation
% fe: optional feature angle
% === OUTPUT RESULTS ======
% T: HT Matrix of the Frame
%
% EXAMPLE:
% SGbox; A=ans;
% TofFS(A,2) % Selection by Number
% TofFS(A,[0 0 1]) % Selection by ez-Vector
% TofFSui(A) % Selection by User interaction
%
% See also: SGTui, TofFS
%
%
% Copyright 2019 Tim C. Lueth

CPLremoveregionsholes(CPL,sline)- removes CPLs of small areas and small holes using the polyshape class

CPLremoveregionsholes(CPL,sline)% CPLremoveregionsholes(CPL,sline) - removes CPLs of small areas and small holes using the polyshape class
% (by Tim Lueth, VLFL-Lib, 2019-JUL-19 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.7
%
% See also: CPLregionsholes, CPLremstraightAmin, CPLremstraight,
% CPLremovearea, imofimsketch
%
% CPLN=CPLremoveregionsholes(CPL,[sline])
% === INPUT PARAMETERS ===
% CPL: Original CPL
% sline: minimal length (not area)
% === OUTPUT RESULTS ======
% CPLN: CPL without removed areas
%
% EXAMPLE:
% I=rgbsketch; imshow(I); shg;
% imshow(imofimsketch(I));shg
% CPLremovearea(CPLofimage(I))
% CPLremovearea(CPLofimage(imofimsketch(I)))
%
% See also: CPLregionsholes, CPLremstraightAmin, CPLremstraight,
% CPLremovearea, imofimsketch
%
%
% Copyright 2019 Tim C. Lueth

SGcapontop(SG,b,T,ctyp,cpos,offs)- returns a solid that covers the geometry from top to a specified length

SGcapontop(SG,b,T,ctyp,cpos,offs)% SGcapontop(SG,b,T,ctyp,cpos,offs) - returns a solid that covers the geometry from top to a specified length
% (by Tim Lueth, VLFL-Lib, 2019-JUL-17 as class: PARAMETRIC DESIGN)
%
% This fnctn is a good example for automated design in comparision with
% parametric design. It is used to create positive connection to solids
% from above or in the direction of a z-axis of a Frame. Those parts can
% be connected by SGTconnect to create couplings between two solids by
% means of a positive connection.
% Connection type under development are:
% 'Simple' - For a positive connection of the outer shape
% 'Plug' - For a positive connection of the innver shape
% 'Full' - For a positive connection of outer and inner shape ('default')
% There is a simpler version based on projection also:
% "SGcapontopprojection" (Status of: 2020-08-11)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGTconnect, SGcap2, SGtorquefuse, SGcapontopprojection
%
% [SGC,SG,CPLh,CPL]=SGcapontop([SG,b,T,ctyp,cpos,offs])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% b: [z and w] depth and wall thickness
% T: Optional frame relative to SG (Char) to specify upwards
% ctyp: cover type; default is 'default' Try 'plug' or 'full', or 'simple'
% cpos: reference for coverage 'none', 'frame' , 'surface'
% offs: used for plug to make sure that the plug looks outside
% === OUTPUT RESULTS ======
% SGC: Solid Geometry that covers SG from the top with Frames 'F' and 'B'
% SG: Solid Geometry with modified Frame 'F' to adjust to Cap
% CPLh: Convex hull contour
% CPL:
%
% EXAMPLE:
% SGservosample(4); SG=ans;
% SGcapontop(SG,[3 1.5]
% SGmotorN20('encoder'); SG=ans;
%
% See also: SGTconnect, SGcap2, SGtorquefuse, SGcapontopprojection
%
%
% Copyright 2019-2021 Tim C. Lueth

exp_2019_07_16_cap- CPLofCVLz(CVL,top/

exp_2019_07_16_cap% exp_2019_07_16_cap - CPLofCVLz(CVL,top/
% (by Tim Lueth, VLFL-Lib, 2019-JUL-16)
%
% Die maximale Außenkontur muss erreicht werden danach geht die Kappe
% senkrecht nach unten. Gibt es keine Veränderung mehr, kann die
% Außenkappe auch optional an dieser Z-grenze beendet werden.
% Die Außenkonturen von oben werden durch tieferliegenden Konturen
% erweitert
%
% Die innenkonturen von oben werden durch die tieferliegenden Konturen
% beschnitten!
% Es gibt zwei Typen von Kappen: DIe Kappen die eine Innenkontur besitzen
% und die Kappen die eine Außenkontur besiten. Zuerst wird die Haut
% gebaut und dann die Kappe nach oben hin eventuell AUSSEN auf die
% maximalkontur erweitert.
%
% (Status of: 2019-07-16)
%
% Introduced first in SolidGeometry 4.7
%
% exp_2019_07_16_cap
%
%
% Copyright 2019 Tim C. Lueth

SGbitISO1173(n,l,d)- Bite Geometry related to Bit DIN 3126 ISO 1173

SGbitISO1173(n,l,d)% SGbitISO1173(n,l,d) - Bite Geometry related to Bit DIN 3126 ISO 1173
% (by Tim Lueth, VLFL-Lib, 2019-JUL-15 as class: SURFACES)
%
% NEVER PRINT BITS => THEY WILL BRAKE AND DESTROY THE WRENCH (Status of:
% 2019-07-15)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGsnaprivet, SGtorquelimiter, SGtorquefuse
%
% SG=SGbitISO1173([n,l,d])
% === INPUT PARAMETERS ===
% n:
% l:
% d:
% === OUTPUT RESULTS ======
% SG: Solid Geometry
%
% EXAMPLE:
% SGbitISO1173
% SGbitISO1173(4)
%
% See also: SGsnaprivet, SGtorquelimiter, SGtorquefuse
%
%
% Copyright 2019-2020 Tim C. Lueth

SGTconnect(SGA,SGB,TNA,TNB,d)- connects the geometries of two solids based on surfaces that are identified by frame names

SGTconnect(SGA,SGB,TNA,TNB,d)% SGTconnect(SGA,SGB,TNA,TNB,d) - connects the geometries of two solids based on surfaces that are identified by frame names
% (by Tim Lueth, VLFL-Lib, 2019-JUL-14 as class: SURFACES)
%
% Simplified Frame Name Based version of SGconnect2FS
% (Status of: 2019-07-15)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGTconnect, SGtransrelSG
%
% SGC=SGTconnect(SGA,SGB,TNA,TNB,[d])
% === INPUT PARAMETERS ===
% SGA: Solid A
% SGB: Solid B
% TNA: Frame Name A
% TNB: Frame Name B
% d: distance in z
% === OUTPUT RESULTS ======
% SGC: Final solid with copied frame names
%
% EXAMPLE:
% SGsample(17); A=ans; SGTset(A,'M',[1 0 0]); A=ans; SGTset(A,'B',[-1 0 0]); A=ans
% SGtorquefuse; B=ans
% SGTconnect(A,B,'M','B',10); C=ans;
% SGTconnect(C,B,'F','B',10);
%
% See also: SGTconnect, SGtransrelSG
%
%
% Copyright 2019 Tim C. Lueth

SGTcopy(SGA,SGB,Framenames)- copies Frames from one Solid into another one

SGTcopy(SGA,SGB,Framenames)% SGTcopy(SGA,SGB,Framenames) - copies Frames from one Solid into another one
% (by Tim Lueth, VLFL-Lib, 2019-JUL-13 as class: KINEMATICS AND FRAMES)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGTcopynames, SGTset, SGTremove, SGTui, SGTget, SGTplot,
% SGTframeplot, SGTsetofFS
%
% SGA=SGTcopy(SGA,SGB,[Framenames])
% === INPUT PARAMETERS ===
% SGA: Solid to receive frames
% SGB: Solid to cope frames from
% Framenames: optional list of frames to copy
% === OUTPUT RESULTS ======
% SGA: Modified Solid with unique framenames
%
% EXAMPLE:
% SGofCPLz(PLstar(10),5); A=ans;
% SGofCPLz(PLcircle(10),5); B=ans; SGtransrelSG(B,A,'ontop',5,'transx',3); B=ans
% SGTset(A,'M',[0 0 1]); A=ans;
% SGTset(B,'S',[0 0 -1]); B=ans;
% SGTcopy(A,B,'S')
%
% See also: SGTcopynames, SGTset, SGTremove, SGTui, SGTget, SGTplot,
% SGTframeplot, SGTsetofFS
%
%
% Copyright 2019 Tim C. Lueth

findfacetsinSG(SGA,SGB)- creates a correlation index list of the facets in FLA and FLB

findfacetsinSG(SGA,SGB)% findfacetsinSG(SGA,SGB) - creates a correlation index list of the facets in FLA and FLB
% (by Tim Lueth, VLFL-Lib, 2019-JUL-13 as class: SURFACES)
%
% same as findfacetsinVLFL
% (Status of: 2019-07-13)
%
% Introduced first in SolidGeometry 4.7
%
% See also: ismemberFL, maprows, findfacetsinVLFL, PLcorrelation,
% SGcolorcopy
%
% cc=findfacetsinSG(SGA,SGB)
% === INPUT PARAMETERS ===
% SGA: Solid A
% SGB: Solid B
% === OUTPUT RESULTS ======
% cc: facet correlation index list [ai bi]
%
% EXAMPLE:
% SGofCPLz(PLstar(10),5); A=ans;
% SGofCPLz(PLcircle(10),5); B=ans; SGtransrelSG(B,A,'ontop',5,'transx',3); B=ans
% SGTset(A,'M',[0 0 1]); A=ans;
% SGTset(B,'M',[0 0 -1]); B=ans;
% SGconnect2FS(A,B,FSofSGfacet(A,31),TofFS(B,[0 0 -1]))
% findfacetsinSG(A,C)
%
% See also: ismemberFL, maprows, findfacetsinVLFL, PLcorrelation,
% SGcolorcopy
%
%
% Copyright 2019 Tim C. Lueth

findfacetsinVLFL(VLA,FLA,VLB,FLB,order,flips)- creates a correlation index list of the facets in FLA and FLB

findfacetsinVLFL(VLA,FLA,VLB,FLB,order,flips)% findfacetsinVLFL(VLA,FLA,VLB,FLB,order,flips) - creates a correlation index list of the facets in FLA and FLB
% (by Tim Lueth, VLFL-Lib, 2019-JUL-13 as class: SURFACES)
%
% Change in SG-Lib 4.9: Supports order and direction
% slow(up to 6 recursive calls) (Status of: 2019-07-13)
%
% Introduced first in SolidGeometry 4.7
%
% See also: ismemberFL, maprows, PLcorrelation, SGcolorcopy
%
% cc=findfacetsinVLFL(VLA,FLA,VLB,FLB,[order,flips])
% === INPUT PARAMETERS ===
% VLA: Vertex list Solid A
% FLA: Facet list Solid A
% VLB: Vertex list Solid B
% FLB: Facet list Solid B
% order: if true the vertex order is ignored; default is false
% flips: if true the facet direction is ignored; default is false
% === OUTPUT RESULTS ======
% cc: facet correlation index list [ai bi]
%
% EXAMPLE:
% SGofCPLz(PLstar(10),5); A=ans;
% SGofCPLz(PLcircle(10),5); B=ans; SGtransrelSG(B,A,'ontop',5,'transx',3); B=ans
% SGTset(A,'M',[0 0 1]); A=ans;
% SGTset(B,'M',[0 0 -1]); B=ans;
% SGconnect2FS(A,B,FSofSGfacet(A,31),TofFS(B,[0 0 -1])); C=ans
% findfacetsinVLFL(A.VL,A.FL,C.VL,C.FL)
%
% findfacetsinVLFL(A.VL,A.FL,C.VL,C.FL(:,[2 3 1]),false)
% findfacetsinVLFL(A.VL,A.FL,C.VL,C.FL(:,[2 3 1]),true) % finds even in other order
%
% findfacetsinVLFL(A.VL,A.FL,C.VL,C.FL(:,[1 3 2]),'',false)
% findfacetsinVLFL(A.VL,A.FL,C.VL,C.FL(:,[1 3 2]),'',true) % finds even in flip surface normal
%
%
% See also: ismemberFL, maprows, PLcorrelation, SGcolorcopy
%
%
% Copyright 2019-2020 Tim C. Lueth

SGcolorcopy(SGA,SGB)- copies facet colors of a reference solid to a requreste

SGcolorcopy(SGA,SGB)% SGcolorcopy(SGA,SGB) - copies facet colors of a reference solid to a requreste
% (by Tim Lueth, VLFL-Lib, 2019-JUL-13 as class: SURFACES)
%
% Since many operations modify facet lists it is very difficult to
% maintain facet related colors during the operations. Therefor, this
% fnctn copies the colors of a solid that are used in another one. Facet
% are considered as identical if they use the same vertices in the same
% order (Status of: 2019-07-13)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGcolorfaces, SGcolorseparation
%
% SGA=SGcolorcopy(SGA,SGB)
% === INPUT PARAMETERS ===
% SGA: Solid to be colored
% SGB: Colored reference solid
% === OUTPUT RESULTS ======
% SGA: Solid with copied colors
%
% EXAMPLE:
% SGofCPLz(PLstar(10),5); A=ans;
% SGofCPLz(PLcircle(10),5); B=ans; SGtransrelSG(B,A,'ontop',5,'transx',3); B=ans
% SGTset(A,'M',[0 0 1]); A=ans;
% SGTset(B,'M',[0 0 -1]); B=ans;
% SGconnect2FS(A,B,FSofSGfacet(A,31),TofFS(B,[0 0 -1])); C=ans
% B=SGcolorfaces(B,'g')
% SGcolorcopy(C,B)
%
% See also: SGcolorfaces, SGcolorseparation
%
%
% Copyright 2019 Tim C. Lueth

SGtextstamp(SG,stext,ez,col)- adds a textstring on the surface

SGtextstamp(SG,stext,ez,col)% SGtextstamp(SG,stext,ez,col) - adds a textstring on the surface
% (by Tim Lueth, VLFL-Lib, 2019-JUL-12 as class: SURFACES)
%
% Since SG 5.1 only outside Surfaces are detected (Status of: 2021-03-10)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGtext, SGoftext, VLFLtextimage, SGofCPLz, CPLoftext,
% SGtextbanner, CPLtextbanner, CPLtextimage
%
% [SGS,B]=SGtextstamp(SG,[stext,ez,col])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% stext: text for stamp
% ez: orientation for surface, or Frame name to turn!
% col: color; default is none
% === OUTPUT RESULTS ======
% SGS: New solid with stamp
% B: Just the Text Solid
%
% EXAMPLE:
% A=SGbox;
% SGtextstamp(A,'test',[0 -1 0]);
% SGtextstamp(A,'test',[0 -1 0],'b');
% SGtextstamp(A,'','','r')
%
% See also: SGtext, SGoftext, VLFLtextimage, SGofCPLz, CPLoftext,
% SGtextbanner, CPLtextbanner, CPLtextimage
%
%
% Copyright 2019-2021 Tim C. Lueth

SGcenter(SG,cstr)- centers a solid on the x y or z axis

SGcenter(SG,cstr)% SGcenter(SG,cstr) - centers a solid on the x y or z axis
% (by Tim Lueth, VLFL-Lib, 2019-JUL-12 as class: SURFACES)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGrotate, SGTransT
%
% SG=SGcenter(SG,[cstr])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% cstr: center string such as 'xyz'
% === OUTPUT RESULTS ======
% SG: Centered Solid
%
% EXAMPLE:
% SGbox; A=ans; SGtrans1(A); B=ans;
% SGcenter(B,'x')
% SGcenter(B,'xz')
% SGcenter(SGoftext('test'),'xyz')
%
% See also: SGrotate, SGTransT
%
%
% Copyright 2019-2020 Tim C. Lueth

FSofSGT(SG,T,dz,alpha,dr)- returns the facet index list of a Feature Surface for a given coordinate system

FSofSGT(SG,T,dz,alpha,dr)% FSofSGT(SG,T,dz,alpha,dr) - returns the facet index list of a Feature Surface for a given coordinate system
% (by Tim Lueth, VLFL-Lib, 2019-JUL-10 as class: SURFACES)
%
% Attention ORDER of parameters changed in 4.9
% This fnctn is useful if the feature surface of a HT matrix or an
% already used Letter should be recalculated.
% It does work for T vectors that are near a surface.
% It does work for T vectors that are ontop of a bore hole
% (Status of: 2020-08-09)
%
% Introduced first in SolidGeometry 4.7
%
% See also: FSnormalofSG, FSofSG, FSofSGfacet, FSplot, FSselect,
% crosspointVLFL
%
% [FIL,fcl]=FSofSGT(SG,[T,dz,alpha,dr])
% === INPUT PARAMETERS ===
% SG: Solid Geoemtry
% T: Frame Name or HT matrix
% dz: optional backward distance for ez to find the ez-crossed facet index
% alpha: if an alpha angle is used, the FS will be recalculated anyway
% dr: optional orthogonal distance to ez to find the radial ez-crossing
% facets; not implemented yet
% === OUTPUT RESULTS ======
% FIL: Facet index list for one feature surface
% fcl: facet connectionlist
%
% EXAMPLE:
% SGtorquefuse; SG=ans;
% SG=SGbox
% FSofSGT(SGbox,'Y-','',0.76) % up to angle .76
% FSofSGT(SGbox,'Y-','', 1.6) % up to angle 1.6
% FSofSGT(SGsample(45),'Y-') % just the plane surface
% FSofSGT(SGsample(45),'F') % just the bore hole
%
% See also: FSnormalofSG, FSofSG, FSofSGfacet, FSplot, FSselect,
% crosspointVLFL
%
%
% Copyright 2019-2020 Tim C. Lueth

CPLisidenticalcontour(CPL1,CPL2,thr)- returns whether two contours overlap the same area

CPLisidenticalcontour(CPL1,CPL2,thr)% CPLisidenticalcontour(CPL1,CPL2,thr) - returns whether two contours overlap the same area
% (by Tim Lueth, VLFL-Lib, 2019-JUL-09 as class: CLOSED POLYGON LISTS)
%
% Sliced solids create in each slice a different CPL even if the cross
% section is identic.
% This fnctn does not compare the points of a contour but the overlapping
% area (Status of: 2019-07-10)
%
% Introduced first in SolidGeometry 4.7
%
% See also: CPLbool
%
% [b,a,CPLD]=CPLisidenticalcontour(CPL1,CPL2,[thr])
% === INPUT PARAMETERS ===
% CPL1: CPL of contour 1
% CPL2: CPL of contour 2
% thr: threshold; default is 1e-3
% === OUTPUT RESULTS ======
% b: logical value
% a: area difference
% CPLD:
%
% EXAMPLE:
% PL1=PLcircle(10); PL2=PLtransR(PL1,rot(pi/3));
% CPLisidenticalcontour(PL1,PL2)
% CPLisidenticalcontour(PL1,PL2+.1)
%
% SGofCPLz(PLstar(10),10); A=ans;
% CPLofSGslice(A,3); CPL1=ans;
% CPLofSGslice(A,7); CPL2=ans;
% cla; CPLplot(CPL1,'r*-',4); CPLplot(CPL2,'g*'); shg
% CPLisidenticalcontour(CPL1,CPL2)
%
%
% See also: CPLbool
%
%
% Copyright 2019-2020 Tim C. Lueth

SGtorquefuse(dim,wt)- returns a SG consisting of three parts to implement a clutch

SGtorquefuse(dim,wt)% SGtorquefuse(dim,wt) - returns a SG consisting of three parts to implement a clutch
% (by Tim Lueth, VLFL-Lib, 2019-JUL-09 as class: PARAMETRIC DESIGN)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGof2T, SGof2SGT, SGsnaprivet, SGtorquelimiter
%
% SGC=SGtorquefuse([dim,wt])
% === INPUT PARAMETERS ===
% dim:
% wt:
% === OUTPUT RESULTS ======
% SGC: Clutch Geometry
%
% EXAMPLE:
% SGtorquefuse
%
% See also: SGof2T, SGof2SGT, SGsnaprivet, SGtorquelimiter
%
%
% Copyright 2019 Tim C. Lueth

CPLofSGpinholes(SG,ez,ms,wt)- returns the Geometry

CPLofSGpinholes(SG,ez,ms,wt)% CPLofSGpinholes(SG,ez,ms,wt) - returns the Geometry
% (by Tim Lueth, VLFL-Lib, 2019-JUL-09 as class: PARAMETRIC DESIGN)
%
% This fnctn is a step towards automatic design:
% In general I would like to use standardized frame that belong to
% surfaces of the motors
% S - for Shaft of the motor
% M - for Mounting Flange of the motor (Status of: 2019-07-11)
%
% Introduced first in SolidGeometry 4.7
%
% See also: CPLofSGboreholes, CPLpinholesinCPL
%
% [CPLB,CPLA]=CPLofSGpinholes(SG,[ez,ms,wt])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% ez:
% ms:
% wt:
% === OUTPUT RESULTS ======
% CPLB:
% CPLA:
%
% See also: CPLofSGboreholes, CPLpinholesinCPL
%
%
% Copyright 2019 Tim C. Lueth

SGconnect2FS(SGA,SGB,FLAi,FLBi)- returns the connecting straight solid structure between two surfaces of two solids

SGconnect2FS(SGA,SGB,FLAi,FLBi)% SGconnect2FS(SGA,SGB,FLAi,FLBi) - returns the connecting straight solid structure between two surfaces of two solids
% (by Tim Lueth, VLFL-Lib, 2019-JUL-09 as class: SURFACES)
%
% There are two possible vertex lists as output
% VLA2 - is vertex list of A extended by the boundary vertices of FLBi
% VLA3 - is vertex list of A extended by the full list of vertices of VLB
% VLC - is just the vertices of FLAi and FLBi
% FLC - is just the wall facets of the connecting structure wrt. VLC
% FLA2 - is just the wall facets of the connecting structure wrt. VLA2
%
% (Status of: 2020-08-13)
%
% Introduced first in SolidGeometry 4.7
%
% See also: FLofPLcorrelation, SGof2SGT, SGconnect, SGconnect2T
%
% [SGC,FLAC,FLBC,FLNC,SGN]=SGconnect2FS(SGA,SGB,FLAi,FLBi)
% === INPUT PARAMETERS ===
% SGA: Solid A with VL and FL
% SGB: Solid B with VL and FL
% FLAi: Feature Surface index list at Solid A, or Frame Name or HT-Matrix
% FLBi: Feature Surface index list at Solid B or Frame Name or HT-Matrix
% === OUTPUT RESULTS ======
% SGC: Combined Solid Geometry without Frames and
% FLAC: Facet list of A without FLAi related to SGC.VL
% FLBC: Facet list of B without FLBi related to SGC.VL
% FLNC: Facet list of new wall related to SGC.VL
% SGN: Solid Geometry only of the open wall
%
% EXAMPLE:
% SGofCPLz(PLstar(10),5); A=ans;
% SGofCPLz(PLcircle(10),5); B=ans; SGtransrelSG(B,A,'ontop',5,'transx',3); B=ans
% SGTset(A,'M',[0 0 1]); A=ans;
% SGTset(B,'M',[0 0 -1]); B=ans;
% SGconnect2FS(A,B,'M','M')
% SGconnect2FS(A,B,'M',TofFS(B,[0 0 -1]))
% SGconnect2FS(A,B,[31,33],TofFS(B,[0 0 -1]))
% SGconnect2FS(A,B,FSofSGfacet(A,31),TofFS(B,[0 0 -1]))
%
%
% See also: FLofPLcorrelation, SGof2SGT, SGconnect, SGconnect2T
%
%
% Copyright 2019-2020 Tim C. Lueth

circlearoundPL(CPLZ)- returns radius and center point of the surrounding circle

circlearoundPL(CPLZ)% circlearoundPL(CPLZ) - returns radius and center point of the surrounding circle
% (by Tim Lueth, VLFL-Lib, 2019-JUL-08 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.7
%
% See also: centerCPL, centerPL
%
% [r,cp]=circlearoundPL(CPLZ)
% === INPUT PARAMETERS ===
% CPLZ: CPL
% === OUTPUT RESULTS ======
% r: Radius
% cp: center point
%
% EXAMPLE:
% circlearoundPL(CPLsample(13))
%
% See also: centerCPL, centerPL
%
%
% Copyright 2019 Tim C. Lueth

unsortNaN(CPL)- change the order the entries of a NaN separted list

unsortNaN(CPL)% unsortNaN(CPL) - change the order the entries of a NaN separted list
% (by Tim Lueth, VLFL-Lib, 2019-JUL-08 as class: AUXILIARY PROCEDURES)
%
% mainly for testing other NaN fnctns (Status of: 2019-07-08)
%
% Introduced first in SolidGeometry 4.7
%
% See also: selectNaN, lengthNaN, replaceNaN, cellofNaN, separateNaN,
% uniqueNaN
%
% CPLU=unsortNaN(CPL)
% === INPUT PARAMETERS ===
% CPL: Original nan separated list
% === OUTPUT RESULTS ======
% CPLU: Unsorted nan separated list
%
% EXAMPLE:
% CPLsample(13); CPL=ans;
% hideingca('text'); unsortNaN(CPL); CPL=ans; textCVL(ans); shg
%
% See also: selectNaN, lengthNaN, replaceNaN, cellofNaN, separateNaN,
% uniqueNaN
%
%
% Copyright 2019 Tim C. Lueth

uniqueNaN(CPL)- finds copies of lists such as CPL with in a nan separted list

uniqueNaN(CPL)% uniqueNaN(CPL) - finds copies of lists such as CPL with in a nan separted list
% (by Tim Lueth, VLFL-Lib, 2019-JUL-08 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.7
%
% See also: selectNaN, lengthNaN, replaceNaN, cellofNaN, separateNaN,
% uniqueNaN
%
%
% [CPLU,ai]=uniqueNaN(CPL)
% === INPUT PARAMETERS ===
% CPL: Original NaN sperated list
% === OUTPUT RESULTS ======
% CPLU: Reduced Nan separted list with unique entries
% ai: indes list for
%
% EXAMPLE:
% CPL=[CPLsample(13);nan nan;CPLsample(13)]
% [a,b]=uniqueNaN(CPL)
%
% See also: selectNaN, lengthNaN, replaceNaN, cellofNaN, separateNaN,
% uniqueNaN
%
%
%
% Copyright 2019 Tim C. Lueth

SGreadMAT(FName)- loads a Solid Geometry or other struct as mat file on disk

SGreadMAT(FName)% SGreadMAT(FName) - loads a Solid Geometry or other struct as mat file on disk
% (by Tim Lueth, VLFL-Lib, 2019-JUL-07 as class: FILE HANDLING)
%
% ..see SGwriteMAT..
% This fnctn allow to read in a SG struct with a generated information
% that would disappear since the STL format does not support Frames etc.
% (Status of: 2019-07-07)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGwriteMAT, SGreadSTL, SGreadOBJ
%
% SG=SGreadMAT([FName])
% === INPUT PARAMETERS ===
% FName: Filename of mat file to read
% === OUTPUT RESULTS ======
% SG: struct read from file
%
% EXAMPLE:
% SGbox([30,20,10]); SG=ans;
% SGTsetofFS(SG,2,'F'); SG=ans
% fn=SGwriteMAT(SG,'test')
% zzz=SGreadMAT(fn)
% SGfigure; view(-30,30); SGTplot(zzz)
%
% See also: SGwriteMAT, SGreadSTL, SGreadOBJ
%
%
% Copyright 2019 Tim C. Lueth

SGwriteMAT(SG,FNAME);- saves a Solid Geometry or other struct as mat file on disk

SGwriteMAT(SG,FNAME);% SGwriteMAT(SG,FNAME); - saves a Solid Geometry or other struct as mat file on disk
% (by Tim Lueth, VLFL-Lib, 2019-JUL-07 as class: FILE HANDLING)
%
% at JHU Baltimore
% In case of complex solid geometries, this is the only standard to
% include frames, names and other fields into the written file for export
% and import using matlab.
% In contrast to 'save', this fnctn allows the call without giving the
% file name as string (Status of: 2019-07-07)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGreadMAT, STLwriteSTL, STLwriteOBJ, STLwriteVRML
%
% FNAME=SGwriteMAT(SG,[FNAME]);
% === INPUT PARAMETERS ===
% SG: Solid Geometry variable name
% FNAME: optinale file name for desktop write
% === OUTPUT RESULTS ======
% FNAME: Complete filename path name extension
%
% EXAMPLE:
% SGbox([30,20,10]); SG=ans;
% SGTsetofFS(SG,2,'F'); SG=ans
% fn=SGwriteMAT(SG,'test')
% zzz=SGreadMAT(fn)
% SGfigure; view(-30,30); SGTplot(zzz)
%
% See also: SGreadMAT, STLwriteSTL, STLwriteOBJ, STLwriteVRML
%
%
% Copyright 2019 Tim C. Lueth

CPLpinholesinCPL(CPL,rmin,bord)- returns the CPLs of the pins that would fit into bore holes of servos or PCB

CPLpinholesinCPL(CPL,rmin,bord)% CPLpinholesinCPL(CPL,rmin,bord) - returns the CPLs of the pins that would fit into bore holes of servos or PCB
% (by Tim Lueth, , 2019-JUL-06)
%
% .. on the flight JHU, Baltimore..
% support real holes or structures at the outer (Status of: 2019-07-07)
%
% Introduced first in SolidGeometry 4.7
%
% See also: CPLofSGboreholes, CPLofSGhull
%
% CPLH=CPLpinholesinCPL(CPL,[rmin,bord])
% === INPUT PARAMETERS ===
% CPL: CPL created by CPLofSGboreholes
% rmin: minimal radius to consider; default 2 mm
% bord: border of the outer contour that should not be touched by the
% pins; default 1mm
% === OUTPUT RESULTS ======
% CPLH: CPL of pins that fit into the bore holes
%
% EXAMPLE:
% SGcmdsample('3156'); C=ans;
% CPLofSGboreholes(C,'',1.5); CPLC=ans; CPLplot(CPLC,'m',4);
% CPLpinholesinCPL(CPLC,1);CPLH=ans;
% bb=BBofSG(C), SGofCPLz(CPLH,bb([5:6])), SGplotalpha(C,'r',0.2);
%
% See also: CPLofSGboreholes, CPLofSGhull
%
%
% Copyright 2019 Tim C. Lueth

CPLplotcwccw(CPL)- plots a CPL in different colors depending on the orientation

CPLplotcwccw(CPL)% CPLplotcwccw(CPL) - plots a CPL in different colors depending on the orientation
% (by Tim Lueth, VLFL-Lib, 2019-JUL-06 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.7
%
% See also: CPLisccw, CPLplotinout, CPLisccwinout, CPLsortinout,
% CPLisccw, CPLisccwcorrected, CPLsetallcw
%
% h=CPLplotcwccw(CPL)
% === INPUT PARAMETERS ===
% CPL: Closed Polygon Line
% === OUTPUT RESULTS ======
% h: handle to drawing and annotation
%
% EXAMPLE:
% CPL=CPLsample(13);
% SGfigure; CPLplotcwccw(CPL); textCVL(CPL);
% SGfigure; CPLplotcwccw(CPLflipud(CPL)); textCVL(CPL);
%
% See also: CPLisccw, CPLplotinout, CPLisccwinout, CPLsortinout,
% CPLisccw, CPLisccwcorrected, CPLsetallcw
%
%
% Copyright 2019 Tim C. Lueth

CPLflipud(CPL)- flips one by one the CPL up and down to change the ordner cw / ccw

CPLflipud(CPL)% CPLflipud(CPL) - flips one by one the CPL up and down to change the ordner cw / ccw
% (by Tim Lueth, VLFL-Lib, 2019-JUL-06 as class: CLOSED POLYGON LISTS)
%
% In contrast to simply calling flipud, this fnctn does not change the
% order of the contours within CPL. (Status of: 2019-07-06)
%
% Introduced first in SolidGeometry 4.7
%
% See also: flipud, CPLisccwinout, CPLsortinout, CPLisccw,
% CPLisccwcorrected, CPLsetallcw
%
% CPLflipud(CPL)
% === INPUT PARAMETERS ===
% CPL: Closed Polygon Line; contours separated by nan nan
%
% EXAMPLE:
% CPLflipud(CPLsample(13))
% CPLflipud(flipud(CPLsample(13)))
%
% See also: flipud, CPLisccwinout, CPLsortinout, CPLisccw,
% CPLisccwcorrected, CPLsetallcw
%
%
% Copyright 2019 Tim C. Lueth

CPLsetallcw(CPL)- sets all contours of a CPL to cw

CPLsetallcw(CPL)% CPLsetallcw(CPL) - sets all contours of a CPL to cw
% (by Tim Lueth, VLFL-Lib, 2019-JUL-05 as class: CLOSED POLYGON LISTS)
%
% this fnctn can be used to show the effect of polybuffer or polyshape
% (Status of: 2019-07-05)
%
% Introduced first in SolidGeometry 4.7
%
% See also: CPLisccwinout, CPLsortinout, CPLisccw, CPLisccwcorrected
%
% CPL=CPLsetallcw(CPL)
% === INPUT PARAMETERS ===
% CPL: CPL
% === OUTPUT RESULTS ======
% CPL: CPL with all polygons in cw
%
% EXAMPLE:
% CPL=CPLsample(13)
% CPLisccw(CPL)
% CPLsetallcw(CPL); X=ans;
% CPLbuffer(X,.5)
%
% See also: CPLisccwinout, CPLsortinout, CPLisccw, CPLisccwcorrected
%
%
% Copyright 2019 Tim C. Lueth

CPLremoveoverlap(CPL)- For each contour of CPL the polyshape is simplified

CPLremoveoverlap(CPL)% CPLremoveoverlap(CPL) - For each contour of CPL the polyshape is simplified
% (by Tim Lueth, VLFL-Lib, 2019-JUL-04 as class: CLOSED POLYGON LISTS)
%
% Some fnctns such as SGofCPLZ require CPL contours that have no
% selfcrossing/overlap
% CPLrepair,
% CPLremoveoverlap,
% CPLregionsholes,
% CPLrecontour
% CPLremnoise
% CPLfft
% CPLoutercontour (Status of: 2019-07-04)
%
% Introduced first in SolidGeometry 4.7
%
% See also: CPLrepair, CPLregionsholes, CPLrecontour, CPLremnoise,
% CPLfft, CPLoutercontour
%
% CPL=CPLremoveoverlap(CPL)
% === INPUT PARAMETERS ===
% CPL: Original CPL
% === OUTPUT RESULTS ======
% CPL: CPL without overlapping areas
%
% EXAMPLE:
% CPLremoveoverlap([CPLsample(25)]);
% CPLoutercontour(CPLsample(25))
%
% See also: CPLrepair, CPLregionsholes, CPLrecontour, CPLremnoise,
% CPLfft, CPLoutercontour
%
%
% Copyright 2019 Tim C. Lueth

Posefourbaranglelimit(PS,aps,ival)- limits the angle are of a specific fourbar solution

Posefourbaranglelimit(PS,aps,ival)% Posefourbaranglelimit(PS,aps,ival) - limits the angle are of a specific fourbar solution
% (by Tim Lueth, VLFL-Lib, 2019-JUL-03 as class: KINEMATICS AND FRAMES)
%
% Introduced first in SolidGeometry 4.7
%
% See also: Posefourbarangles, Posefourbarposelimit
%
% PS=Posefourbaranglelimit(PS,aps,ival)
% === INPUT PARAMETERS ===
% PS: Pose struct including PS.GAL
% aps: number of attachment point solution
% ival: [min max] angle of the crank
% === OUTPUT RESULTS ======
% PS: Pose struct with modified PS.GAL angle interval
%
% See also: Posefourbarangles, Posefourbarposelimit
%
%
% Copyright 2019 Tim C. Lueth

SGTchainanimation(SGs,IVL,z,Fchain,stp,axo);- creates an animation of kinematic chains

SGTchainanimation(SGs,IVL,z,Fchain,stp,axo);% SGTchainanimation(SGs,IVL,z,Fchain,stp,axo); - creates an animation of kinematic chains
% (by Tim Lueth, VLFL-Lib, 2019-JUL-03 as class: KINEMATICS AND FRAMES)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGTframeChain, SGTchain, vecinterpolate
%
% [h,axG]=SGTchainanimation(SGs,[IVL,z,Fchain,stp,axo]);
% === INPUT PARAMETERS ===
% SGs: Cell list of Solids to move
% IVL: Rows of angle values for the joints
% z: z value for explosion drawings
% Fchain: number of steps between two rows of IVL; default is 1
% stp: number of interpolation betweem two rows
% axo: optional axis definition
% === OUTPUT RESULTS ======
% h: handle to the drawing
% axG: automated created axis/Bounding box for the movement
%
% EXAMPLE:
% w1=pi/2
% SGTchainanimation(JACO,[NaN -w1/3 w1 pi/3 w1 w1 pi/6; [NaN -w1/3 w1 pi/3 w1 w1 pi/6] + pi],0,Fchain,50); % Move the solids w,r,t to the Frame Structure
% [~,BBJACO]=BBofSG(JACO,true)
% SGTchainanimation(BBJACO,[NaN -w1/3 w1 pi/3 w1 w1 pi/6; [NaN -w1/3 w1 pi/3 w1 w1 pi/6] + pi],0,Fchain,50); % Move the solids w,r,t to the Frame Structure
%
%
% See also: SGTframeChain, SGTchain, vecinterpolate
%
%
% Copyright 2019 Tim C. Lueth

vecinterpolate(VL,stp)- returns a vector row interpolation by

vecinterpolate(VL,stp)% vecinterpolate(VL,stp) - returns a vector row interpolation by
% (by Tim Lueth, VLFL-Lib, 2019-JUL-03 as class: KINEMATICS AND FRAMES)
%
% This fnctn is helpful to created interpolation values for n DoF robot
% kinematics (Status of: 2019-07-03)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGTframeChain, SGTchain
%
% IVL=vecinterpolate(VL,[stp])
% === INPUT PARAMETERS ===
% VL: list of row vectors
% stp: step number for interpolation
% === OUTPUT RESULTS ======
% IVL: Interpolated vector list
%
% EXAMPLE:
% vecinterpolate([NaN 1 2 3 ; 0 4 5 6; 30 40 50 60; nan 400 500 600],2)
% vecinterpolate([0 0 0; 10 20 30],5)
%
% See also: SGTframeChain, SGTchain
%
%
% Copyright 2019 Tim C. Lueth

CPLcirclesofPL(PL,r)- create a list of circles for a list of points

CPLcirclesofPL(PL,r)% CPLcirclesofPL(PL,r) - create a list of circles for a list of points
% (by Tim Lueth, VLFL-Lib, 2019-JUL-02 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.7
%
% See also: PLcircle, CPLcopypatternPL
%
% CPL=CPLcirclesofPL(PL,[r])
% === INPUT PARAMETERS ===
% PL: Center point list
% r: radius of the circles
% === OUTPUT RESULTS ======
% CPL: Closed Polygon line
%
% EXAMPLE:
% CPLcirclesofPL(rand(3,2)*10,1)
%
% See also: PLcircle, CPLcopypatternPL
%
%
% Copyright 2019 Tim C. Lueth

SGclosurecapofFS(SG,fi,t,in)- Automated Design of Closure Cap

SGclosurecapofFS(SG,fi,t,in)% SGclosurecapofFS(SG,fi,t,in) - Automated Design of Closure Cap
% (by Tim Lueth, VLFL-Lib, 2019-JUL-02 as class: PARAMETRIC DESIGN)
%
% Could be improved one day by slicing (Status of: 2019-07-02)
%
% Introduced first in SolidGeometry 4.7
%
% See also: SGselect3d, FSofSGfacet, CPLofVLFL, CPLregionsholes
%
%
% [SGcap,SGfix,CPLo,CPLi,T,ez]=SGclosurecapofFS(SG,[fi,t,in])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% fi: one facet index of FS or empty for interactive selection
% t: thickness; default is one
% in: inlay if true; onlay if false; default is false
% === OUTPUT RESULTS ======
% SGcap: SG of Closure Cap (green)
% SGfix: SG of Fixture (blue) in case of inlay to add to Solid
% CPLo:
% CPLi:
% T:
% ez:
%
% EXAMPLE:
% SGclosurecapofFS(SGsample(25)) % select
% SGclosurecapofFS(SGsample(25),95) % close
% SGclosurecapofFS(SGsample(25),107) % no opening
% SGclosurecapofFS(SGsample(25),301) % no opening
% SGclosurecapofFS(SGsample(25),95,'',true) % close inlay
%
%
% See also: SGselect3d, FSofSGfacet, CPLofVLFL, CPLregionsholes
%
%
%
% Copyright 2019 Tim C. Lueth

Rofview090(ew,aw)- returns the rotation matrix to rotate the object into a view direction

Rofview090(ew,aw)% Rofview090(ew,aw) - returns the rotation matrix to rotate the object into a view direction
% (by Tim Lueth, VLFL-Lib, 2019-JUL-01 as class: USER INTERFACE)
%
% i.e. T=Tofview(ew,aw); R=(T(1:3,1:3) *rot(0,pi,0));
% (Status of: 2019-07-01)
%
% Introduced first in SolidGeometry 4.7
%
% See also: Tofcam, Tofview, Rofview
%
% R=Rofview090(ew,aw)
% === INPUT PARAMETERS ===
% ew: elevation angle as in view
% aw: azimut angle as in view
% === OUTPUT RESULTS ======
% R: Matrix to rotate a solid that it look in view(0,90) like in (ew,aw);
%
% EXAMPLE:
% SGsample(17); A=ans; view(-30,30); %
% R=Rofview090(-30,30); B=SGtransR(A,inv(R)); view(0,90); SGplot(B,'g');
%
%
% See also: Tofcam, Tofview, Rofview
%
%
% Copyright 2019 Tim C. Lueth

Tofview(ew,aw)- returns the Transformation matrix of the camera for a specific view with a change of view

Tofview(ew,aw)% Tofview(ew,aw) - returns the Transformation matrix of the camera for a specific view with a change of view
% (by Tim Lueth, VLFL-Lib, 2019-JUL-01 as class: USER INTERFACE)
%
% Introduced first in SolidGeometry 4.7
%
% See also: Tofcam, Rofview
%
% T=Tofview(ew,aw)
% === INPUT PARAMETERS ===
% ew: elevation angle as in view
% aw: azimut angle as in view
% === OUTPUT RESULTS ======
% T: Transformation matrix
%
% EXAMPLE:
% SGsample(17); A=ans; view(0,0); % left side view
% T=Tofcam % by default view
% T=Tofview(0,0)
% T=Tofview(0,90)
%
% See also: Tofcam, Rofview
%
%
% Copyright 2019 Tim C. Lueth

textSG(SG,c,s,nt,lb)- creates descriptors for cells of solid geometries

textSG(SG,c,s,nt,lb)% textSG(SG,c,s,nt,lb) - creates descriptors for cells of solid geometries
% (by Tim Lueth, VLFL-Lib, 2019-JUL-01 as class: USER INTERFACE)
%
% Introduced first in SolidGeometry 4.7
%
% See also: textT, textP, textVL, textCVL, textVLFL, VLFLfaceNormalplot,
% textVL, textCPS, SGanalyzeGroupParts
%
% h=textSG(SG,[c,s,nt,lb])
% === INPUT PARAMETERS ===
% SG: Solid
% c: color of descriptor
% s: size of descriptor
% nt: selector for cells
% lb: Letter for Desciption
% === OUTPUT RESULTS ======
% h: handle to text
%
% EXAMPLE:
% SGreadSTL('/Volumes/LUETH-WIN/WIN AIM Matlab Libraries/STL Files for SG-Lib/STL of PCBs/Raspberry Pie Zero Sleek v8.stl'); A=ans,
% SGanalyzeGroupParts(A); textSG(ans)
% SGfigure; SGplot(A); textSG(B,'r',24); view(-30,30);
%
% See also: textT, textP, textVL, textCVL, textVLFL, VLFLfaceNormalplot,
% textVL, textCPS, SGanalyzeGroupParts
%
%
% Copyright 2019 Tim C. Lueth

CPLofSGhull(SG,T)- returns the outer contour of a solid

CPLofSGhull(SG,T)% CPLofSGhull(SG,T) - returns the outer contour of a solid
% (by Tim Lueth, VLFL-Lib, 2019-JUL-01 as class: CLOSED POLYGON LISTS)
%
% Inverse of this fnctn could be interesting to create solids from
% (Status of: 2019-07-07)
%
% Introduced first in SolidGeometry 4.7
%
% See also: CPLofSGslicer, CPLofgcaborehole090, CPLofSGboreholes,
% CPLofgcaborehole, CPLpinholesinCPL
%
% [CPLXY,CPLXZ,CPLYZ,T,NPLXY,NPLXZ,NPLYZ]=CPLofSGhull(SG,[T])
% === INPUT PARAMETERS ===
% SG: Solid Geoemetry
% T:
% === OUTPUT RESULTS ======
% CPLXY: Contour blue
% CPLXZ: Contour green
% CPLYZ: Contour red
% T:
% NPLXY:
% NPLXZ:
% NPLYZ:
%
% EXAMPLE:
% A=SGcmdsample('3156'); CPLofSGhull(A)
%
% See also: CPLofSGslicer, CPLofgcaborehole090, CPLofSGboreholes,
% CPLofgcaborehole, CPLpinholesinCPL
%
%
% Copyright 2019-2020 Tim C. Lueth

SGlib- simply opens the WWW pages SGlib.org and Matlab central

SGlib% SGlib - simply opens the WWW pages SGlib.org and Matlab central
% (by Tim Lueth, VLFL-Lib, 2019-JUN-29 as class: USER INTERFACE)
%
% Introduced first in SolidGeometry 4.7
%
% SGlib
%
% EXAMPLE: Just try SGlib
%
%
% Copyright 2019 Tim C. Lueth

SGofCPLzcontour(CPL,z,ph,ed,shp);- extrudes a CPL into a Solid Geometry modifying the CPL along z using a contour shape

SGofCPLzcontour(CPL,z,ph,ed,shp);% SGofCPLzcontour(CPL,z,ph,ed,shp); - extrudes a CPL into a Solid Geometry modifying the CPL along z using a contour shape
% (by Tim Lueth, VLFL-Lib, 2019-JUN-26 as class: SURFACES)
%
% Introduced first in SolidGeometry 4.7
%
% See also: PLchamfer, SGof2CPLsz, SGofCPLz, SGofCPLz
%
% [SG,SFLW,SFLA,SFLB]=SGofCPLzcontour([CPL,z,ph,ed,shp]);
% === INPUT PARAMETERS ===
% CPL: Contour to extrude
% z: height for extrusion
% ph: scale of reduction ; default is 0.3 = 30%
% ed: round corners; default is false
% shp: such as 'circ', bezier' ,'mattheck'; see PLchamfer for strings
% === OUTPUT RESULTS ======
% SG: Final Solid Geometry
% SFLW: Surface facets of the wall
% SFLA: Surface facets of the floor
% SFLB: Surface facets of the ceiling
%
% EXAMPLE:
% SGofCPLzcontour(CPLsample(10))
% SGofCPLzcontour(CPLsample(9))
% SGofCPLzcontour(CPLsample(10)*100,500,1)
%
% See also: PLchamfer, SGof2CPLsz, SGofCPLz, SGofCPLz
%
%
% Copyright 2019 Tim C. Lueth

SGliblogo- creates an animated GIF 2D Logo for Matlab Central

SGliblogo% SGliblogo - creates an animated GIF 2D Logo for Matlab Central
% (by Tim Lueth, VLFL-Lib, 2019-JUN-26 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.7
%
% See also: VLFLcreateLogo, gcasnapshot, snapplot
%
% SGliblogo
%
% EXAMPLE:
% SGliblogo(5)
%
% See also: VLFLcreateLogo, gcasnapshot, snapplot
%
%
% Copyright 2019-2020 Tim C. Lueth

CPLadd(CPLA,CPLB,ibool)- adds the outer contours and subtacts the holes of two CPLs

CPLadd(CPLA,CPLB,ibool)% CPLadd(CPLA,CPLB,ibool) - adds the outer contours and subtacts the holes of two CPLs
% (by Tim Lueth, VLFL-Lib, 2019-JUN-23 as class: CLOSED POLYGON LISTS)
%
% Overlaps filled and open contours; Helpful for mechanical design
% different from CPLunion (Status of: 2019-07-18)
%
% Introduced first in SolidGeometry 4.7
%
% See also: CPLbool, CPLregionsholes
%
% CPL=CPLadd(CPLA,CPLB,[ibool])
% === INPUT PARAMETERS ===
% CPLA: CPLA A
% CPLB: CPLA B
% ibool: '+' drills the holes through all, 'x' finds contour that fits
% trough all holes
% === OUTPUT RESULTS ======
% CPL: Final Contour
%
% EXAMPLE:
% CPLadd(CPLsample(27),PLcircleoval(6,'',40,4));
% CPLadd(PLcircleoval(6,'',40,4),CPLsample(27));
% CPLadd(CPLsample(10),CPLsample(27));
% CPLadd(CPLsample(27),CPLsample(10));
%
% See also: CPLbool, CPLregionsholes
%
%
% Copyright 2019-2021 Tim C. Lueth

CPLselectinout(CPL,si,in1st)- returns selected CPLs based on their enclosure index

CPLselectinout(CPL,si,in1st)% CPLselectinout(CPL,si,in1st) - returns selected CPLs based on their enclosure index
% (by Tim Lueth, VLFL-Lib, 2019-JUN-23 as class: CLOSED POLYGON LISTS)
%
% You can use CPLoutlinecontour if you need just the outline contours
% (Status of: 2020-08-29)
%
% Introduced first in SolidGeometry 4.7
%
% See also: CPLsortinout, selectNaN, CPLoutlinecontour
%
%
% CPLS=CPLselectinout(CPL,si,[in1st])
% === INPUT PARAMETERS ===
% CPL: CPL
% si: 0 = outside! surrounded by 1, 2 = surrounded by 2 etc.
% in1st: true = insode start, false = outside start
% === OUTPUT RESULTS ======
% CPLS: Selected CPLs
%
% EXAMPLE:
% CPL=CPLsample(14); SGfigure; CPLplotcolors(CPL,'',16);
% CPLselectinout(CPL,[0 2]);
% CPLselectinout(CPL,[1 2]);
% CPLselectinout(CPLsample(26),[0 1],false); % Main contour Level 1
% CPLselectinout(CPLsample(26),[2 3],false); % Main contour Level 2
% CPLselectinout(CPLsample(14),[1 2],true); % Main Hole Level 1
%
% See also: CPLsortinout, selectNaN, CPLoutlinecontour
%
%
%
% Copyright 2019-2020 Tim C. Lueth

SGboreholemountingpost(SG,d,t,h)- returns a base plate and housing for mounting printed circuit bards

SGboreholemountingpost(SG,d,t,h)% SGboreholemountingpost(SG,d,t,h) - returns a base plate and housing for mounting printed circuit bards
% (by Tim Lueth, VLFL-Lib, 2019-JUN-23 as class: SURFACES)
%
% In order to mount µC=boards (PCB) as automatically as possible on a
% robot arm, this fnctn automatically generates a mounting base and a
% housing cover for the µC board. (Status of: 2019-06-23)
%
% Introduced first in SolidGeometry 4.7
%
% [SGM,SGP,PCB]=SGboreholemountingpost(SG,[d,t,h])
% === INPUT PARAMETERS ===
% SG: SG of the PCP in xy
% d: minimum diameter to detect bore holes; default is 2.0
% t: thickness of contours and height of base plate; default is 1.0
% h: height
% === OUTPUT RESULTS ======
% SGM: Mounting Plate with fastener pods
% SGP: Solid Plate under mounting plate
% PCB: Contour of the PCB
%
%
% Copyright 2019 Tim C. Lueth

CPLofSGboreholes(SG,ez,ms)- returns the contour of the shadow core in view (0,90) from above

CPLofSGboreholes(SG,ez,ms)% CPLofSGboreholes(SG,ez,ms) - returns the contour of the shadow core in view (0,90) from above
% (by Tim Lueth, VLFL-Lib, 2019-JUN-22 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.7
%
% See also: CPLofSGboreholes, CPLofgcaborehole, CPLofSGhull,
% CPLpinholesinCPL
%
% [CPL,a]=CPLofSGboreholes(SG,[ez,ms])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% ez: direction vector; default is [ 0 0 1]
% ms: minimal diameter of hole; default is 4; neg => holes only
%
% === OUTPUT RESULTS ======
% CPL: Contour of shadow
% a: area of contours
%
% EXAMPLE:
% SG=SGsample(25);
% CPLofSGboreholes(SG,[0 0 1]);
% CPLofSGboreholes(SG,[0 1 0]);
% CPLofSGboreholes(SG,[1 0 0]);
% CPLofSGboreholes(SG,'',1);
% CPLofSGboreholes(SG,'',2);
% CPLofSGboreholes(SG,'',-1);
%
% See also: CPLofSGboreholes, CPLofgcaborehole, CPLofSGhull,
% CPLpinholesinCPL
%
%
% Copyright 2019 Tim C. Lueth

CPLofgcaborehole090- returns the contour of the shadow core in view (0,90) from above

CPLofgcaborehole090% CPLofgcaborehole090 - returns the contour of the shadow core in view (0,90) from above
% (by Tim Lueth, VLFL-Lib, 2019-JUN-22 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.7
%
% See also: CPLofSGboreholes, CPLofSGhull
%
% CPL=CPLofgcaborehole090
% === OUTPUT RESULTS ======
% CPL: Contour of shadow
%
% EXAMPLE:
% SGsample(25)
% CPLofgcaborehole
%
% See also: CPLofSGboreholes, CPLofSGhull
%
%
% Copyright 2019 Tim C. Lueth

showprogress (i,n,dv)- creates a progress text in 5% steps and deletes it finally

showprogress (i,n,dv)% showprogress (i,n,dv) - creates a progress text in 5% steps and deletes it finally
% (by Tim Lueth, VLFL-Lib, 2019-JUN-22 as class: AUXILIARY PROCEDURES)
%
% Useful fnctn if some procedures take unexpected time and the user needs
% a progress bar (Status of: 2019-07-01)
%
% Introduced first in SolidGeometry 4.7
%
% See also: VLFLreadOBJ
%
% showprogress(i,n,[dv])
% === INPUT PARAMETERS ===
% i: current index
% n: maximum index number
% dv: optional step size; default is 5;
%
% EXAMPLE:
% for i=1:200; showprogress(i,200); pause(.01); end; % Default step size
% for i=1:200; showprogress(i,200,3); pause(.01); end; % 3 % Step size
%
% See also: VLFLreadOBJ
%
%
% Copyright 2019 Tim C. Lueth

CPLregionsholes(CPL)- separates CPLs into Surfaces and Holes

CPLregionsholes(CPL)% CPLregionsholes(CPL) - separates CPLs into Surfaces and Holes
% (by Tim Lueth, VLFL-Lib, 2019-JUN-22 as class: CLOSED POLYGON LISTS)
%
% This fnctns works different than the hole method of polyshape. It is
% not sorting the contours but really create full shape outside contours
% (to be added) and inside hole contours to be substracted.
% This is the correct version for the fnctn simplify = true;
% This fnctn is required for overlapping contours with holes before
% Boolean operations (Status of: 2019-07-26)
%
% Introduced first in SolidGeometry 4.7
%
% See also: CPLadd, CPLremoveregionsholes
%
% [CPLo,CPLi]=CPLregionsholes(CPL)
% === INPUT PARAMETERS ===
% CPL: Original CPL
% === OUTPUT RESULTS ======
% CPLo: Outside Conturs to add (RED)
% CPLi: Hole Contours to substact (GREEN)
%
% EXAMPLE:
% CPLregionsholes(CPLsample(15));
% CPLregionsholes(CPLsample(26));
%
% See also: CPLadd, CPLremoveregionsholes
%
%
% Copyright 2019-2020 Tim C. Lueth

Poseorderchange(PS,c)- returs a pose struct with poses in changed order

Poseorderchange(PS,c)% Poseorderchange(PS,c) - returs a pose struct with poses in changed order
% (by Tim Lueth, VLFL-Lib, 2019-JUN-21 as class: KINEMATICS AND FRAMES)
%
% removes fields 'GAL','A0L','B0L','APS','GPL'
% (Status of: 2019-06-21)
%
% Introduced first in SolidGeometry 4.7
%
% See also: Posesample, Posetransui
%
% PS=Poseorderchange(PS,c)
% === INPUT PARAMETERS ===
% PS: Pose struct
% c: change pair
% === OUTPUT RESULTS ======
% PS: New Pose struct
%
% EXAMPLE:
% Posesample(12); PS=ans
% Poseorderchange(PS,[2 3])
%
% See also: Posesample, Posetransui
%
%
% Copyright 2019 Tim C. Lueth

PLui(PL,col,linw)- interactive fnct to create and modify CPLS (Only one Contur)

PLui(PL,col,linw)% PLui(PL,col,linw) - interactive fnct to create and modify CPLS (Only one Contur)
% (by Tim Lueth, VLFL-Lib, 2019-JUN-20 as class: CLOSED POLYGON LISTS)
%
% Left Mouse button => Set remove and shift points by
% Right Mouse button => Shift at edges, Rotate at corners
% Middle Mouse Button => exit
% More or less: CPL=VLui(CPL,'','',col,'',linw); (Status of: 2019-06-20)
%
% Introduced first in SolidGeometry 4.7
%
% See also: VLui, CPSlineui, CPLui, CPSui, PLsquareui, PLcircleui,
% VLFLui, SGui, CPLsplitui, Poseofimageui, Poseui, SGTui
%
% PL=PLui([PL,col,linw])
% === INPUT PARAMETERS ===
% PL: Optional PL; default is [];
% col: Optional color; default is 'r-'
% linw: optional line width; default is 2
% === OUTPUT RESULTS ======
% PL: Final Point List
%
% EXAMPLE:
% cla; PLui()
% cla; PLui(CPLsample(3))
% cla; PLui(CPLsample(3),'b-',3)
%
% See also: VLui, CPSlineui, CPLui, CPSui, PLsquareui, PLcircleui,
% VLFLui, SGui, CPLsplitui, Poseofimageui, Poseui, SGTui
%
%
% Copyright 2019 Tim C. Lueth

CPSlineui(CPS,col,linw,edge,caps)- interactive fnct to create and modify CPS lines (Only one Contur)

CPSlineui(CPS,col,linw,edge,caps)% CPSlineui(CPS,col,linw,edge,caps) - interactive fnct to create and modify CPS lines (Only one Contur)
% (by Tim Lueth, VLFL-Lib, 2019-JUN-19 as class: CLOSED POLYGON LISTS)
%
% Left Mouse button => Set remove and shift points by
% Right Mouse button => Shift at edges, Rotate at corners
% Middle Mouse Button => exit
% More or less: CPL=VLui(CPL,'','',col,'',linw); (Status of: 2019-06-20)
%
% Introduced first in SolidGeometry 4.7
%
% See also: VLui, CPLui, CPSui, PLui, PLsquareui, PLcircleui, VLFLui,
% SGui, CPLsplitui, Poseofimageui, Poseui, SGTui
%
% CPS=CPSlineui([CPS,col,linw,edge,caps])
% === INPUT PARAMETERS ===
% CPS: Optional polyshape
% col: Optional color; default is 'r'
% linw: optional line width; default is 2
% edge: true = round, false = corner; default is false
% caps: true = round, false = corner; default is false
% === OUTPUT RESULTS ======
% CPS: Final CPS
%
% EXAMPLE:
% cla;
% CPSlineui('','b',2,true,true); CPSplot(ans,'r');
% CPSlineui('','m',2,false,false); CPSplot(ans,'m');
%
% See also: VLui, CPLui, CPSui, PLui, PLsquareui, PLcircleui, VLFLui,
% SGui, CPLsplitui, Poseofimageui, Poseui, SGTui
%
%
% Copyright 2019 Tim C. Lueth

CPLofPLcontour(CPL,s,edge,caps)- Converts a PL into a CPL, if the distance of last point and first point is below a threshold

CPLofPLcontour(CPL,s,edge,caps)% CPLofPLcontour(CPL,s,edge,caps) - Converts a PL into a CPL, if the distance of last point and first point is below a threshold
% (by Tim Lueth, VLFL-Lib, 2019-JUN-18 as class: CLOSED POLYGON LISTS)
%
% This fnctn closes a PL to a CPL if the distance between last and first
% point is below a defined threshold, otherwise a CPL around the PL is
% created. In this case the threshold is used to define the tickness of
% the contour along the path
% Auxiliary fnctn originally designed to compare the area of contours,
% independed on closed contours or open contours
% (Status of: 2019-06-19)
%
% Introduced first in SolidGeometry 4.7
%
% See also: PLofCPL, CPLofPL, CPSlineui
%
% CPL=CPLofPLcontour(CPL,[s,edge,caps])
% === INPUT PARAMETERS ===
% CPL: Closed Polygon line or Point List (separation by nan is possible)
% s: threshold in percent if <.5 or absolut if s>0.5
% edge: treu=round edges; default is false
% caps: treu=round caps; default is false
% === OUTPUT RESULTS ======
% CPL:
%
% EXAMPLE:
% CPLofPLcontour(PLcircle(10,'',pi/2*3.5),.05);
% CPLofPLcontour(PLcircle(10,'',pi/2*3.5),7); % Still a path contour
% CPLofPLcontour(PLcircle(10,'',pi/2*3.5),8); % Now considered as closed surface
%
% See also: PLofCPL, CPLofPL, CPSlineui
%
%
% Copyright 2019 Tim C. Lueth

Posefourbarsearchcouplercurve(PS,CPLF,rots,CPLR,CPL1);- selects coupler courves based on the coupler curve

Posefourbarsearchcouplercurve(PS,CPLF,rots,CPLR,CPL1);% Posefourbarsearchcouplercurve(PS,CPLF,rots,CPLR,CPL1); - selects coupler courves based on the coupler curve
% (by Tim Lueth, VLFL-Lib, 2019-JUN-17 as class: KINEMATICS AND FRAMES)
%
% This fnctn is similar to Posefourbarselectcouplercurve bu searches for
% a fitting contour (Status of: 2019-06-17)
%
% Introduced first in SolidGeometry 4.7
%
% See also: Posefourbarselectui, PosefourbarselectAP,
% Posefourbarselectcouplercurve
%
% [PSX,di]=Posefourbarsearchcouplercurve(PS,[CPLF,rots,CPLR,CPL1]);
% === INPUT PARAMETERS ===
% PS: Pose struct including CPLE, GPL, GAL
% CPLF: Exact contour to fit best.
% rots: true = full rotation, false = no rotation, default is both
% CPLR: Area for Crank Base Point; default is not limits
% CPL1: Area for Swing Base Point; default is CPLR
% === OUTPUT RESULTS ======
% PSX: Pose with only the slelected solutions left
% di: index list of the solutions in GAL that were selected
%
% EXAMPLE:
% PS=Posesample(12); checkfourbar3Poseattachpermutation(PS,'',20); PS=ans;
% Posefourbarsearchcouplercurve(PS,PLsquare(60,4),true); PSX=ans; Posefourbaranimate(PSX,1)
% Posefourbarsearchcouplercurve(PS,PLsquare(60,4),true,PLcircle(20)+[15 50]); PSX=ans; Posefourbaranimate(PSX,1)
%
%
% See also: Posefourbarselectui, PosefourbarselectAP,
% Posefourbarselectcouplercurve
%
%
% Copyright 2019 Tim C. Lueth

SGfigureeval(codestr)- executes a command line and echos the command in SGfigure

SGfigureeval(codestr)% SGfigureeval(codestr) - executes a command line and echos the command in SGfigure
% (by Tim Lueth, VLFL-Lib, 2019-JUN-16 as class: USER INTERFACE)
%
% Introduced first in SolidGeometry 4.7
%
% See also: eval, SGfigurepapermode
%
% SGfigureeval(codestr)
% === INPUT PARAMETERS ===
% codestr: code to execute
%
% EXAMPLE:
% SGfigureeval('SGofCPLcommand("c 1, h 5, g 5 21, h 7")');
%
% See also: eval, SGfigurepapermode
%
%
% Copyright 2019 Tim C. Lueth

CPLofPosefourbarshape(PS,aps,sv)- returns the basic shapes of a pose fourbar linkage solution

CPLofPosefourbarshape(PS,aps,sv)% CPLofPosefourbarshape(PS,aps,sv) - returns the basic shapes of a pose fourbar linkage solution
% (by Tim Lueth, VLFL-Lib, 2019-JUN-16 as class: CLOSED POLYGON LISTS)
%
% In contrast to CPLofPosefourbarshaping, this fnctn returns a set of
% straight contours for a fourbar linkage relate to one attachment point
% solution (Status of: 2019-06-19)
%
% Introduced first in SolidGeometry 4.7
%
% See also: TofPoseattachmentpoints, CPLlinkofPL
%
% [CPLR,CPL1,CPL2,CPLE,PS]=CPLofPosefourbarshape(PS,[aps,sv])
% === INPUT PARAMETERS ===
% PS: Pose struct
% aps: selected index of PS.GAL
% sv: automated size for selection or [ro ri]; default is 1/8 of
% min([L1;L2;R])
% === OUTPUT RESULTS ======
% CPLR: Crank contour
% CPL1: Rocker Contour
% CPL2: Minimal Coupler Contour with 3 holes
% CPLE: Effector Contour = PS.CPLE & CPL2
% PS: Modified struct
%
% EXAMPLE:
% PS=Posesample(12); checkfourbar3Poseattachpermutation(PS,'',10); PS=ans;
% CPLofPosefourbarshape(PS,10);
%
% See also: TofPoseattachmentpoints, CPLlinkofPL
%
%
% Copyright 2019 Tim C. Lueth

SGlibmovepathtotop- moves the SG-Lib directory up in the search path

SGlibmovepathtotop% SGlibmovepathtotop - moves the SG-Lib directory up in the search path
% (by Tim Lueth, VLFL-Lib, 2019-JUN-15)
%
% Matlab adds fnctns from time to time that have a name that has already
% been used in the SG-Lib. This leads to conflicts when using the SG-Lib.
% Tim Lueth fixes these bugs with time but to secure the fnctnality of
% the SG-Lib the path of the SG-Lib is set to the top. (Status of:
% 2021-11-27)
%
% Introduced first in SolidGeometry 4.7
%
% SGlibmovepathtotop
%
% EXAMPLE: Just cann after starting matlab
% SGlibmovepathtotop
%
%
% Copyright 2019-2021 Tim C. Lueth

containscell(A,sstr,IgnoreCase)- finds a string segment into a cell list of strings

containscell(A,sstr,IgnoreCase)% containscell(A,sstr,IgnoreCase) - finds a string segment into a cell list of strings
% (by Tim Lueth, VLFL-Lib, 2019-JUN-15 as class: AUXILIARY PROCEDURES)
%
% =======================================================================
% OBSOLETE (2021-11-04) - USE 'contains' INSTEAD
% =======================================================================
%
% Introduced first in SolidGeometry 4.7
%
% See also: [ contains ] ; contains, stldir
%
% ind=containscell(A,sstr,[IgnoreCase])
% === INPUT PARAMETERS ===
% A: Cell List of Strings
% sstr: string to search
% IgnoreCase: if true; case is ignored
% === OUTPUT RESULTS ======
% ind: index list
%
% EXAMPLE:
% a={'xedr','ere','tyui'}', containscell(a,'e')
%
% See also: [ contains ] ; contains, stldir
%
%
% Copyright 2019-2021 Tim C. Lueth
RapidWeaver Icon

Last Change Oct 2023 for SG-Lib 5.3