Last change of this documentation page: 2022-06-02 of SolidGeometry 3.2
strrepn(origStr,oldSubStr,newSubstr)- replaces several string elements by using strrep

strrepn(origStr,oldSubStr,newSubstr)% strrepn(origStr,oldSubStr,newSubstr) - replaces several string elements by using strrep
% (by Tim Lueth, VLFL-Lib, 2017-JAN-02 as class: AUXILIARY PROCEDURES)
%
% extension of strrep, with more than 1 pair of parameters. The exchange
% takes place in order of the pairs.
% Since SG-Lib 5.1 oldSubStr and newSubstr can be a cell list (Status of:
% 2021-03-21)
%
% Introduced first in SolidGeometry 3.2
%
% See also: strrep, strfind, strfindex, strfindafter, strfindtag,
% strrepalias
%
% S=strrepn(origStr,[oldSubStr,newSubstr])
% === INPUT PARAMETERS ===
% origStr: Original String
% oldSubStr: Substring to exchange
% newSubstr: New Substring
% === OUTPUT RESULTS ======
% S: Resulting string
%
% EXAMPLE:
% strrepn('abcdef','a','x','d','y')
% strrepn('abcdef',{'a','d'},{'x','y'})
%
% See also: strrep, strfind, strfindex, strfindafter, strfindtag,
% strrepalias
%
%
% Copyright 2017-2022 Tim C. Lueth

phiofsr(s,R)- returns a angle difference to achieve a slot size

phiofsr(s,R)% phiofsr(s,R) - returns a angle difference to achieve a slot size
% (by Tim Lueth, VLFL-Lib, 2017-JAN-02 as class: ANALYTICAL GEOMETRY)
%
% phi of slot at radius: = s/r
% This is just a fnctn to remember the analytical background (Status of:
% 2019-03-13)
%
% Introduced first in SolidGeometry 3.2
%
% See also: nofrd, dofn, sofrd, SGprintervalues
%
% phi=phiofsr(s,R)
% === INPUT PARAMETERS ===
% s: slot size
% R: minimal radius
% === OUTPUT RESULTS ======
% phi: angle to add
%
% See also: nofrd, dofn, sofrd, SGprintervalues
%
%
% Copyright 2017-2019 Tim C. Lueth

imageVideoImagePage(xy,I,ETitles,cols)- creates an coyright image for a video

imageVideoImagePage(xy,I,ETitles,cols)% imageVideoImagePage(xy,I,ETitles,cols) - creates an coyright image for a video
% (by Tim Lueth, Video-Lib, 2017-JAN-01)
%
% In case that no output parameter is defined, the fnctn creates a small
% 30 frames (1 second) video file "newvideoEndTitles.avi" in the
% desktopdir.
% ATTENTION: Use somewhere the copyright sign '©', otherwise Tim Lueth is
% named as author of the page (Status of: 2017-01-01)
%
% See also: imageVideoFrames, imageVideoTitle, imageVideoTextPage,
% imageVideoEndtitle, imageVideoWrite, videoCopyFrames, videoCopyCutMovies
%
% I=imageVideoImagePage(xy,I,[ETitles,cols])
% === INPUT PARAMETERS ===
% xy: [x y] or filenamepath of video
% I: Image to include
% ETitles: EndTitle single row!
% cols: ['w','k'] is default
% === OUTPUT RESULTS ======
% I: Image to write
%
% EXAMPLE:
% I=imageVideoTextPage('',smbDrawNow);
% imshow(I.cdata);show
%

videoWriteClipMovie (WName,ImageOrFile,cduration)- creates a video from images and videos without sound

videoWriteClipMovie (WName,ImageOrFile,cduration)% videoWriteClipMovie (WName,ImageOrFile,cduration) - creates a video from images and videos without sound
% (by Tim Lueth, Video-Lib, 2017-JAN-01 as class: AUXILIARY PROCEDURES)
%
% No sound support in 2016b (Status of: 2018-08-20)
%
% Introduced first in SolidGeometry 3.2
%
% See also: imageVideoFrames, imageVideoTitle, imageVideoTextPage,
% imageVideoEndtitle, imageVideoWrite, videoCopyFrames,
% videoCopyCutMovies, imageFigMovieRecord
%
% videoWriteClipMovie(WName,[ImageOrFile,cduration])
% === INPUT PARAMETERS ===
% WName: Filename; default is desktopdir
% ImageOrFile: Image or Filename
% cduration: number of seconds to display the image
%
% EXAMPLE:
% %% see Tutorial VLFL_EXOP25
% videoWriteClipMovie(smbFilename('Video comp SG_LIB_EXP_25.avi'),
% IT,2,...
% ID,5,...
% IM,5,...
% smbFilename('Video SG_LIB_EXP_25.avi'),...
% IE,1);
%
%
% See also: imageVideoFrames, imageVideoTitle, imageVideoTextPage,
% imageVideoEndtitle, imageVideoWrite, videoCopyFrames,
% videoCopyCutMovies, imageFigMovieRecord
%
%
% Copyright 2017-2020 Tim C. Lueth

tryuigetfile(xy,fselect)- give the user a try to select a file

tryuigetfile(xy,fselect)% tryuigetfile(xy,fselect) - give the user a try to select a file
% (by Tim Lueth, VLFL-Lib, 2017-JAN-01 as class: AUXILIARY PROCEDURES)
%
% This fnctn is useful if numerical parameter xy are generated by
% analyzing a file. If xy is not numerical or xy is empty or xy is a non
% existing file, an user dialog is opened to select a file. The final
% result is a valid file name or empty or the numerical parameter xy.
% The final result is only empty if no file was selected. (Status of:
% 2018-08-20)
%
% Introduced first in SolidGeometry 3.2
%
% xy=tryuigetfile(xy,[fselect])
% === INPUT PARAMETERS ===
% xy: numerical parameter, empty or existing filename
% fselect: such as '*.avi;*.m4v;*.mp4;*.mov;*.mpg'; default is *.*
% === OUTPUT RESULTS ======
% xy: numerical parameter, empty or existing filename
%
% EXAMPLE:
% tryuigetfile(12)
% tryuigetfile('')
% tryuigetfile('notexistingfile.avi')
%
%
% Copyright 2017-2019 Tim C. Lueth

SGaddrelSG(SGA,SGB,rel,gap)- Spatial arrangement of a solid to another and combining both

SGaddrelSG(SGA,SGB,rel,gap)% SGaddrelSG(SGA,SGB,rel,gap) - Spatial arrangement of a solid to another and combining both
% (by Tim Lueth, VLFL-Lib, 2016-DEZ-31 as class: SURFACES)
%
% This fnctn arranges the position of a solid A relative to the position
% of a solid B. It uses SGtransrelSG for the spatial arrangement and cat2
% for combining.
% The fnctn supports also spatial arrangement relative to frames of SGB!
% (Status of: 2016-12-31)
%
% See also: SGtransrelSG, SGcat2
%
% SG=SGaddrelSG(SGA,SGB,[rel,gap])
% === INPUT PARAMETERS ===
% SGA: Solid A
% SGB: Solid B
% rel: spatial relations
% gap: gap, optional parameter after an relation command
% === OUTPUT RESULTS ======
% SG: Final solid geoemtry
%
% EXAMPLE: Align relative to geometry and relative to frames
% A=SGbox([30,20,10]); B=SGofCPLCVLR(4,[20 0 20 ]); SGaddrelSG(B,A)
% SGaddrelSG(SGA,SGB,'top','alignright',-5,alignback)
% SGaddrelSG(B,A,'alignT',{'B','B'})
%

exp_2016_12_31- Experiment to create a key and a keyhole

exp_2016_12_31% exp_2016_12_31 - Experiment to create a key and a keyhole
% (by Tim Lueth, VLFL-Lib, 2016-DEZ-31 as class: EXPERIMENTS)
%
% This experiment produces two bodies: a key and a keyhole to realize an
% articulation with articulation stops, which can only be mounted in one
% position.
% 3D printing with the 3D printer "Formlab2" has shown that at 0.1mm
% layer spacing, it is necessary to choose 0.5mm distance between the
% opposing bodies (Status of: 2017-01-14)
%
% See also: exp_2017_01_14, SGmodelKeyhole, exp_2017_01_11, exp_2016_12_27
%
% exp_2016_12_31
%

imageVideoTextPage(xy,ETitles,cols)- creates a textpage image for a video

imageVideoTextPage(xy,ETitles,cols)% imageVideoTextPage(xy,ETitles,cols) - creates a textpage image for a video
% (by Tim Lueth, Video-Lib, 2016-DEZ-30)
%
% In case that no output parameter is defined, the fnctn creates a small
% 30 frames (1 second) video file "newvideoEndTitles.avi" in the
% desktopdir.
% ATTENTION: Use somewhere the copyright sign '©', otherwise Tim Lueth is
% named as author of the page (Status of: 2017-01-01)
%
% See also: imageVideoFrames, imageVideoTitle, imageVideoEndtitle,
% imageVideoWrite, videoCopyFrames, videoCopyCutMovies
%
% I=imageVideoTextPage(xy,[ETitles,cols])
% === INPUT PARAMETERS ===
% xy: [x y] or filenamepath of video
% ETitles: EndTitle single row!
% cols: ['w','k'] is default
% === OUTPUT RESULTS ======
% I: Image to write
%
% EXAMPLE:
% I=imageVideoTextPage('','Test');
% imshow(I.cdata);show
%

textHorizontalBlockAlign(ncol,A)- returns cell of strings which length are limited in length

textHorizontalBlockAlign(ncol,A)% textHorizontalBlockAlign(ncol,A) - returns cell of strings which length are limited in length
% (by Tim Lueth, Video-Lib, 2016-DEZ-30 as class: AUXILIARY PROCEDURES)
%
% The first part of the video shows joints without a boundary', 'The
% second part shows the automatic creation of a missing link between the
% revolute joint and cylindrical joint
%
% (Status of: 2022-02-10)
%
% Introduced first in SolidGeometry 3.2
%
% See also: CPLoftext, str2codelines, paste2code, clipboardrem,
% clipboardadd, cell2strlines, strsplit, strbreaklines
%
% B=textHorizontalBlockAlign(ncol,A)
% === INPUT PARAMETERS ===
% ncol: maximum number of letters in a row [c r]
% A: cell of strings
% === OUTPUT RESULTS ======
% B: cell of string
%
% EXAMPLE: shorten the text to a maximum of 4 chars
% textHorizontalBlockAlign(4,'123456789-12456789-');
% textHorizontalBlockAlign (13,'123456789-123456789-123456789-');
% textHorizontalBlockAlign (13,{'123456789-123456789','-123456789-'});
% textHorizontalBlockAlign ([13 8],{'123456789-123456789','-123456789-'});
%
% See also: CPLoftext, str2codelines, paste2code, clipboardrem,
% clipboardadd, cell2strlines, strsplit, strbreaklines
%
%
% Copyright 2016-2022 Tim C. Lueth

videoCopyCutMovies (WName,RName,style)- copies part of a video and creates titles and end title

videoCopyCutMovies (WName,RName,style)% videoCopyCutMovies (WName,RName,style) - copies part of a video and creates titles and end title
% (by Tim Lueth, Video-Lib, 2016-DEZ-29)
%
% This is a fnctn to create videos from other video cuts.
% To convert video cuts into animated GIFs use video2animatedGIF. (Status
% of: 2018-08-20)
%
% Introduced first in SolidGeometry 3.2
%
% See also: video2animatedGIF, imageVideoFrames, imageVideoTitle,
% imageVideoTextPage, imageVideoEndtitle, imageVideoWrite,
% videoCopyFrames, openbydoubleclick
%
%
% videoCopyCutMovies([WName,RName,style])
% === INPUT PARAMETERS ===
% WName: Created Filename
% RName: {'REadfile',[0 inf],{'Titles'},{EndTitles},[0,1,2]}
% style: ['w' 'k' 'Bank Gothic' '0.8]
%
% EXAMPLE:
% videoCopyCutMovies('',{'','',{'SG-Lib Tutorial #24','Simulate Joint Models with Fixed Limits',...
% 'Tim C. Lueth (2016-12-19)'},'',[1,3]},'tum')
%
% See also: video2animatedGIF, imageVideoFrames, imageVideoTitle,
% imageVideoTextPage, imageVideoEndtitle, imageVideoWrite,
% videoCopyFrames, openbydoubleclick
%
%
%
% Copyright 2016-2019 Tim C. Lueth

openbydoubleclick (fname,aname,nn,ml)- opens/starts a file by the operating system

openbydoubleclick (fname,aname,nn,ml)% openbydoubleclick (fname,aname,nn,ml) - opens/starts a file by the operating system
% (by Tim Lueth, VLFL-Lib, 2016-DEZ-29 as class: AUXILIARY PROCEDURES)
%
% on mac the command is system(['open' ]);
% on pc the command is winopen();
% The search sequence is:
% a) if full path, use full path
% b) use which to find such a file in the search path
% (Status of: 2022-01-21)
%
% Introduced first in SolidGeometry 3.2
%
% See also: desktopdir, filesep, open, expname, cura, matlabopen,
% commandwindow, shg, editorwindow
%
% openbydoubleclick(fname,[aname,nn,ml])
% === INPUT PARAMETERS ===
% fname: Filename; default is in the desktopdir
% aname: application name
% nn: selector of fname, if fname is a cell list
% ml: if true; the focus switches back to matlab; default is false!
%
% EXAMPLE: Start a Video
% openbydoubleclick('/Users/lueth/Desktop/2013-02-17 Video Sophie FT.m4v')
% openbydoubleclick([desktopdir expname '.STL'])
% openbydoubleclick([desktopdir expname '.STL'],'meshlab 1.3.3.app')
%
% See also: desktopdir, filesep, open, expname, cura, matlabopen,
% commandwindow, shg, editorwindow
%
%
% Copyright 2016-2022 Tim C. Lueth

videoCopyFrames(v,vr)- copies the frame from Videoreader to Videowriter

videoCopyFrames(v,vr)% videoCopyFrames(v,vr) - copies the frame from Videoreader to Videowriter
% (by Tim Lueth, Video-Lib, 2016-DEZ-28)
%
% If the format of the videoreader is not the same as the format of the
% videowriter, the frames are scaled by using imresize. (Status of:
% 2018-08-20)
%
% Introduced first in SolidGeometry 3.2
%
% See also: imageVideoFrames, imageVideoTitle, imageVideoTextPage,
% imageVideoEndtitle, imageVideoWrite, videoCopyCutMovies
%
% videoCopyFrames(v,vr)
% === INPUT PARAMETERS ===
% v: videoWriter
% vr: videoReader
%
% EXAMPLE:
% Wname=[desktopdir 'EXP_2020_03_11'];
% Rname=tryuigetfile('',Rname)
% vr=VideoReader(Rname);
% vw=VideoWriter(Wname); open(vw);
% videoCopyFrames(vw,vr);
% close (vw)
%
% See also: imageVideoFrames, imageVideoTitle, imageVideoTextPage,
% imageVideoEndtitle, imageVideoWrite, videoCopyCutMovies
%
%
% Copyright 2016-2020 Tim C. Lueth

imageVideoWrite (v,I,n)- writes an image several times into an open videostream

imageVideoWrite (v,I,n)% imageVideoWrite (v,I,n) - writes an image several times into an open videostream
% (by Tim Lueth, Video-Lib, 2016-DEZ-28)
%
% if the image does not have the size of the videoWriter and is not the
% first part of the video, it is resized to fit into the video frame
% (Status of: 2018-08-20)
%
% Introduced first in SolidGeometry 3.2
%
% See also: imageVideoFrames, imageVideoTitle, imageVideoTextPage,
% imageVideoEndtitle, videoCopyFrames, videoCopyCutMovies
%
% imageVideoWrite(v,[I,n])
% === INPUT PARAMETERS ===
% v: videoWriter
% I: Image; default is getframe(gcf)
% n: number of frames; default is 1
%
% EXAMPLE:
% imageVideoWrite (v,I,2*get(vr,'FrameRate'));
%
% See also: imageVideoFrames, imageVideoTitle, imageVideoTextPage,
% imageVideoEndtitle, videoCopyFrames, videoCopyCutMovies
%
%
% Copyright 2016-2020 Tim C. Lueth

imageVideoEndtitle(xy,ETitles,cols)- creates an endtitle image for a video

imageVideoEndtitle(xy,ETitles,cols)% imageVideoEndtitle(xy,ETitles,cols) - creates an endtitle image for a video
% (by Tim Lueth, Video-Lib, 2016-DEZ-28)
%
% In case that no output parameter is defined, the fnctn creates a small
% 30 frames (1 second) video file "newvideoEndTitles.avi" in the
% desktopdir. (Status of: 2017-01-01)
%
% See also: imageVideoFrames, imageVideoTitle, imageVideoTextPage,
% imageVideoWrite, videoCopyFrames, videoCopyCutMovies
%
% I=imageVideoEndtitle(xy,[ETitles,cols])
% === INPUT PARAMETERS ===
% xy: [x y] or filenamepath of video
% ETitles: EndTitle single row!
% cols: ['w','k'] is default
% === OUTPUT RESULTS ======
% I: Image to write
%
% EXAMPLE: Create an Header in Company Style
% imageVideoEndtitle('',{'ErgoSurg GmbH • Ismaning • Germany',
% '','www.ergosurg.com'},['k' 'w']);
% imshow(I.cdata)
%

imageVideoTitle(xy,STitles,cols,ptime)- returns a video titel image for a given existing video

imageVideoTitle(xy,STitles,cols,ptime)% imageVideoTitle(xy,STitles,cols,ptime) - returns a video titel image for a given existing video
% (by Tim Lueth, Video-Lib, 2016-DEZ-28)
%
% If several snapshots (ptime) are defined, the snapshots are positioned
% below the title in a row.
% In case that no output parameter is defined, the fnctn creates a small
% 60 frames (2 seconds) video file "newvideoTitles.avi" in the
% desktopdir. (Status of: 2017-01-01)
%
% See also: imageVideoFrames, imageVideoTextPage, imageVideoEndtitle,
% imageVideoWrite, videoCopyFrames, videoCopyCutMovies
%
% I=imageVideoTitle(xy,[STitles,cols,ptime])
% === INPUT PARAMETERS ===
% xy: [x y] or existing video filepath
% STitles: {'Title','Subtitle','Author','$Date'}
% cols: default is ['w' 'k']
% ptime: snapshot frame time; default is 0
% === OUTPUT RESULTS ======
% I: Titel Image
%
% EXAMPLE:
% I=imageVideoTitle('');
% imshow(I.cdata)
%

imageVideoFrames(xy,ptime)- extracts images from a video file

imageVideoFrames(xy,ptime)% imageVideoFrames(xy,ptime) - extracts images from a video file
% (by Tim Lueth, Video-Lib, 2016-DEZ-28)
%
% See also: imageVideoTitle, imageVideoTextPage, imageVideoEndtitle,
% imageVideoWrite, videoCopyFrames, videoCopyCutMovies
%
% [Ic,vr]=imageVideoFrames(xy,[ptime])
% === INPUT PARAMETERS ===
% xy: filename of the video file
% ptime: array or cells of time; default is 0
% === OUTPUT RESULTS ======
% Ic: cells of images
% vr: video reader object
%
% EXAMPLE:
% imageVideoFrames('/Users/lueth/Desktop/newfile.avi',[2,3]) % works
% imageVideoFrames('/Users/lueth/Desktop/newfile.avi',{2,3}) % works also
%

exp_2016_12_27- EXPERIMENT to create limited revolute link parts

exp_2016_12_27% exp_2016_12_27 - EXPERIMENT to create limited revolute link parts
% (by Tim Lueth, VLFL-Lib, 2016-DEZ-27 as class: EXPERIMENTS)
%
% This fnctn also tests
% SGanalyzeGroupParts
% SGarrangeSG
% SGwriteSeparatedSTL (Status of: 2017-01-14)
%
% See also: exp_2017_01_14, SGmodelKeyhole, exp_2017_01_11, exp_2016_12_31
%
% exp_2016_12_27
%

SGwriteSeparatedSTL (SG,FNAME,ONAME)- writes solid geometry in different STL files

SGwriteSeparatedSTL (SG,FNAME,ONAME)% SGwriteSeparatedSTL (SG,FNAME,ONAME) - writes solid geometry in different STL files
% (by Tim Lueth, VLFL-Lib, 2016-DEZ-27 as class: FILE HANDLING)
%
% This fnctn separates penetrating parts and writes the parts into
% different STL files.
% Use SGsurfaces first if only independent surfaces should be printed in
% different files.
% SGsurfaces is much faster than SGanalyzeGroupParts (Status of:
% 2017-06-26)
%
% Introduced first in SolidGeometry 3.2
%
% See also: SGwriteSTL, SGwriteMultipleSTL, SGreadSTL,
% SGanalyzeGroupParts, SGarrangeSG, SGsurfaceplot, SGpuzzlecut3D
%
% SGwriteSeparatedSTL(SG,[FNAME,ONAME])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% FNAME: File and Directory Name
% ONAME: Solid Name
%
% EXAMPLE:
% SGwriteSeparatedSTL(SGsurfaces(SGsample(17)))
% SGwriteSeparatedSTL(SGsample(17))
%
% See also: SGwriteSTL, SGwriteMultipleSTL, SGreadSTL,
% SGanalyzeGroupParts, SGarrangeSG, SGsurfaceplot, SGpuzzlecut3D
%
%
% Copyright 2016-2017 Tim C. Lueth

SGanalyzeGroupParts(SG,gmethod)- returns parts of penetrating solids group colored

SGanalyzeGroupParts(SG,gmethod)% SGanalyzeGroupParts(SG,gmethod) - returns parts of penetrating solids group colored
% (by Tim Lueth, VLFL-Lib, 2016-DEZ-27 as class: SURFACES)
%
% Similar to fnctn SGanalyzePenetration, but it returs already a cell of
% part-solids.
% Each solid has a different color.
% For the method used, see SGanalyzePenetration (Status of: 2018-06-07)
%
% Introduced first in SolidGeometry 3.2
%
% See also: SGanalyzeJointType, SGanalyzeJointFaces, SGanalyzePenetration
%
% SGc=SGanalyzeGroupParts(SG,[gmethod])
% === INPUT PARAMETERS ===
% SG: Solid Geometry of additive designed solids
% gmethod: method 'vertex','cross','solid'; default is solid
% === OUTPUT RESULTS ======
% SGc: List of solids sorted by non overlapping parts
%
% EXAMPLE: Separate the parts of the link SGsample(17):
% SGanalyzeGroupParts(SGsample(17))
%
% See also: SGanalyzeJointType, SGanalyzeJointFaces, SGanalyzePenetration
%
%
% Copyright 2016-2018 Tim C. Lueth

smbCreateStopJointC (Name,bound)- smb creates a joint with limits (fixed boundaries)

smbCreateStopJointC (Name,bound)% smbCreateStopJointC (Name,bound) - smb creates a joint with limits (fixed boundaries)
% (by Tim Lueth, SimMechanics, 2016-DEZ-26 as class: MODELING PROCEDURES)
%
% See also: smbCreateStopJointR
%
% smbCreateStopJointC([Name,bound])
% === INPUT PARAMETERS ===
% Name: Local Name of the joint in the diagram
% bound: boundaries; default is [-10mm +10mm]
%

ispath(npath)- returns wether a string is part of the path

ispath(npath)% ispath(npath) - returns wether a string is part of the path
% (by Tim Lueth, VLFL-Lib, 2016-DEZ-26 as class: AUXILIARY PROCEDURES)
%
% See also: addpath, path, rmpath
%
% l=ispath(npath)
% === INPUT PARAMETERS ===
% npath: name of path
% === OUTPUT RESULTS ======
% l: true or false
%

smbCopyConnections (B1,B2,opt)- smb copies all existing conntections of a block to another

smbCopyConnections (B1,B2,opt)% smbCopyConnections (B1,B2,opt) - smb copies all existing conntections
% of a block to another
% (by Tim Lueth, SimMechanics, 2016-DEZ-26 as class: MODELING PROCEDURES)
%
% This fnctn does only work if both blocks B1 and B2 are in the same open
% subsystem!
% Both blocks need to have exactly the same order of connection ports:
% LConn1, LConn2, ..., RConn1, RConn2, ...
% (Status of: 2016-12-27)
%
% See also: smbCreateConnection, smbCreateSG, smbCreateSGJoint,
% smbCreateSGNode, smbCreateStopJointC, smbCreateStopJointR,
% smbCreateDrive, smbCreateSineWave
%
% smbCopyConnections(B1,B2,[opt])
% === INPUT PARAMETERS ===
% B1: Block string top copy connections from
% B2: Block string to copy connections to
% opt: 'replace' deletes the Block B1 afterwards; default is ''
%

gcsb(bl)- get current system's block

gcsb(bl)% gcsb(bl) - get current system's block
% (by Tim Lueth, SimMechanics, 2016-DEZ-26 as class: AUXILIARY PROCEDURES)
%
% returns current system's block
% gcs ==> return the full path of the current system
% bdroot or bdroot(gcs) ==> return the root of the current system
% gcb ==> returns the current block path
% gcsb returns the block name in the current window-tab-system (Status
% of: 2016-12-26)
%
% See also: gcs, gcb, bdroot, gcsb
%
% s=gcsb([bl])
% === INPUT PARAMETERS ===
% bl: block; default is gcb
% === OUTPUT RESULTS ======
% s: name of block
%

smbNameofPort(b,ph)- returns the Connection of a Port

smbNameofPort(b,ph)% smbNameofPort(b,ph) - returns the Connection of a Port
% (by Tim Lueth, SimMechanics, 2016-DEZ-26 as class: AUXILIARY PROCEDURES)
%
% Auxiliary fnctn used in smbGetConnectedBlocks. The fnctns gets the real
% port handle and analyzses LConn and RConn wether the port handle is
% part of LConn or RConn (Status of: 2016-12-26)
%
% See also: smbGetConnectedBlocks, smbNameofPort
%
% s=smbNameofPort(b,ph)
% === INPUT PARAMETERS ===
% b: Block Name
% ph: Port Name used
% === OUTPUT RESULTS ======
% s: String
%
% EXAMPLE: Get the used connection for a known Port
% a=smbGetConnectedBlocks(smbWhich('N4'))
% smbNameofPort(a{2,3},a{2,4})
%

CVLplot(CVL,c,w)- plots a 2D polybool contour polygon in a 3D figure

CVLplot(CVL,c,w)% CVLplot(CVL,c,w) - plots a 2D polybool contour polygon in a 3D figure
% (by Tim Lueth, VLFL-Lib, 2016-DEZ-26 as class: VISUALIZATION)
%
% CVL is a nx3 point list with x/y/z coordinates separated by NaN NaN NaN
% the fnctn replaces the colors by the standard colors to show the
% separated contours (Status of: 2017-08-28)
%
% Introduced first in SolidGeometry 3.2
%
% See also: VLFLcoatPCVL, TofPCVL, VLplot, PLplot, CVLplots
%
% h=CVLplot(CVL,[c,w])
% === INPUT PARAMETERS ===
% CVL: Point list of x/y coordinates nx2
% c: Color and symbol of points
% w: Width of the used line
% === OUTPUT RESULTS ======
% h: Handle to figure
%
% See also: VLFLcoatPCVL, TofPCVL, VLplot, PLplot, CVLplots
%
%
% Copyright 2016-2017 Tim C. Lueth

CPLofSGslice3(SG,z)- returns CPL and CVL for different sliced heights and directions

CPLofSGslice3(SG,z)% CPLofSGslice3(SG,z) - returns CPL and CVL for different sliced heights and directions
% (by Tim Lueth, VLFL-Lib, 2016-DEZ-26 as class: CLOSED POLYGON LISTS)
%
% 3 dimensional slicing procedure.
% SG=CPLofSGslice3(SG,z) return one slice in height z
% CPLofSGslice3(SG,[0 1 0]) return one slice in at plane y=1
%
% The slicer fnctns differ a little bit
% CPLofSGslice - Single Slice
% CPLofSGslice2 - Slices in a list of z values
% CPLofSGslice3 - Slicing in 3 dimensions at the same time, several
% slices (returns also CVL)
% CVLofSGslices - Slices in z (return CVL)
% SGslicer - Basic fnctn behind all of the above (Status of: 2020-08-14)
%
% Introduced first in SolidGeometry 3.2
%
% See also: CPLofSGhull, SGslicer, CPLofSGslice, CPLofSGslice2,
% CVLofSGslices, CPLofSGsliceauto, CVLzofSGsliceauto
%
% [CPL,CVL]=CPLofSGslice3(SG,z)
% === INPUT PARAMETERS ===
% SG: Solid Geoemtry
% z: either a z value or a cell list of values
% === OUTPUT RESULTS ======
% CPL: Closed polygon list (n x 2) separated with NaN NaN
% CVL: Closed polygon vertex list (n x 2) separated with NaN NaN NaN
%
% EXAMPLE:
% CPLofSGslice3(SGsample(7),[4,6])
% CPLofSGslice3(SGbox([30,20,10]),[0 0 0.01; 0 0.1 0; 0.1 0 0])
% CPLofSGslice3(SGsample(7),[0 0 4; 0.1 4 0.1])
%
% See also: CPLofSGhull, SGslicer, CPLofSGslice, CPLofSGslice2,
% CVLofSGslices, CPLofSGsliceauto, CVLzofSGsliceauto
%
%
% Copyright 2016-2020 Tim C. Lueth

smbPosgcb (Nr)- sets the gcb to predefined position

smbPosgcb (Nr)% smbPosgcb (Nr) - sets the gcb to predefined position
% (by Tim Lueth, SimMechanics, 2016-DEZ-25 as class: AUXILIARY PROCEDURES)
%
% See also: smbSetPosition, smbNewGridPos
%
% smbPosgcb(Nr)
% === INPUT PARAMETERS ===
% Nr: Grid position
%

smbPSLibInstall- Installs a collection of additional blocks

smbPSLibInstall% smbPSLibInstall - Installs a collection of additional blocks
% (by Tim Lueth, SimMechanics, 2016-DEZ-25 as class: MODELING PROCEDURES)
%
% For many cases there are some special physical procedure help full.
% This is a collection of procedure blocks for a library that are
% generated at runtime and can be used afterwards (Status of: 2016-12-25)
%
% See also: smbPSLibCreateBlock, smbPSLibCompile;
%
% smbPSLibInstall
%

smbPSBlockname(block)- return the name of a block realtive to Library

smbPSBlockname(block)% smbPSBlockname(block) - return the name of a block realtive to Library
% (by Tim Lueth, SimMechanics, 2016-DEZ-25 as class: FILE HANDLING)
%
% search for "Rotational Friction Force"
% smbPSLibname =
% "/Users/lueth/Desktop/tmp_SG_LIB_EXP_23/+mechPS_Tim_Lueth/Rotational
% Friction Force"
% smbPSBlockname = "mechPS_Tim_Lueth_lib/Rotational Friction Force"
% (Status of: 2016-12-26)
%
% See also: smbPSLibname
%
% bn=smbPSBlockname(block)
% === INPUT PARAMETERS ===
% block: block description
% === OUTPUT RESULTS ======
% bn: Block path
%

smbGetLibraryPath(B)- returns for a simulink/simscape block the library path

smbGetLibraryPath(B)% smbGetLibraryPath(B) - returns for a simulink/simscape block the library path
% (by Tim Lueth, VLFL-Lib, 2016-DEZ-25 as class: SIMMECHANICS)
%
% Introduced first in SolidGeometry 3.2
%
% See also: smbGetSubSystempath, smbGetBlockInfo
%
% [Lpath,Bpath]=smbGetLibraryPath([B])
% === INPUT PARAMETERS ===
% B: Block or if empty => gcb
% === OUTPUT RESULTS ======
% Lpath: Library path
% Bpath: Path to current subsystem
%
% EXAMPLE: Click on a block in simulink or simscape and call
% lpath=smbGetLibraryPath(gcb), bpath=smbGetSubSystempath(gcb)
% add_block(lpath,[bpath filesep 'xxx'],'MakeNameUnique','on')
%
% See also: smbGetSubSystempath, smbGetBlockInfo
%
%
% Copyright 2016-2019 Tim C. Lueth

smbPSLibCreateBlock(FString,Fext,FName)- Writes the code of a block as .ssc file

smbPSLibCreateBlock(FString,Fext,FName)% smbPSLibCreateBlock(FString,Fext,FName) - Writes the code of a block as .ssc file
% (by Tim Lueth, SimMechanics, 2016-DEZ-25 as class: FILE HANDLING)
%
% By using the fnctns smbPSLibCreateBlock and smbPSLibCompile it is
% possible during runtime to create additonal SimScape block_fnctns.
% (Status of: 2016-12-27)
%
% See also: smbNewSystem, smbFilename, smbPSLibname, smbPSLibCompile
%
%
% FName=smbPSLibCreateBlock(FString,[Fext,FName])
% === INPUT PARAMETERS ===
% FString: String of the code of a blockfuunction
% Fext: desired extension; default is '.ssc'
% FName: Filename to be used
% === OUTPUT RESULTS ======
% FName: Analyze Filename only if FName =''
%
% EXAMPLE: FName=smbPSLibCreateBlock (RFF);
% smbPSLibCreateBlock (RFF_SVG,'.svg',FName);
%
%

smbPSLibname(FName)- returns the name a SimMultiBody Library Directory

smbPSLibname(FName)% smbPSLibname(FName) - returns the name a SimMultiBody Library Directory
% (by Tim Lueth, SimMechanics, 2016-DEZ-25 as class: FILE HANDLING)
%
% If called without an argument, it returns the Library path
% If called with a fnctn name, it returns the file name path
% The directory is created in smbNewSystem. (Status of: 2018-08-20)
%
% Introduced first in SolidGeometry 3.2
%
% See also: smbNewSystem, smbWhich, smbFilename, smbPSLibCompile
%
% fn=smbPSLibname([FName])
% === INPUT PARAMETERS ===
% FName: smb_fnctn name; default is
% === OUTPUT RESULTS ======
% fn: smb_fnctn file name;default is directory name
%
% See also: smbNewSystem, smbWhich, smbFilename, smbPSLibCompile
%
%
% Copyright 2016-2018 Tim C. Lueth

smbPSLibCompile- compiles the PS Library in the current smbPSLibname

smbPSLibCompile% smbPSLibCompile - compiles the PS Library in the current smbPSLibname
% (by Tim Lueth, SimMechanics, 2016-DEZ-25 as class: FILE HANDLING)
%
% See also: smbNewSystem, smbWhich, smbFilename, smbPSLibname
%
% smbPSLibCompile
%

smbCreateStopJointR (Name,bound)- smb creates a joint with limits (fixed boundaries)

smbCreateStopJointR (Name,bound)% smbCreateStopJointR (Name,bound) - smb creates a joint with limits (fixed boundaries)
% (by Tim Lueth, SimMechanics, 2016-DEZ-25 as class: MODELING PROCEDURES)
%
% See also: smbCreateStopJointC
%
% smbCreateStopJointR([Name,bound])
% === INPUT PARAMETERS ===
% Name: Local Name of the joint in the diagram
% bound: boundaries; default is [i2*pi +2*pi]
%

SGoftext(text,sz,t,radx,rady,FN)- returns a solid for text optional bended

SGoftext(text,sz,t,radx,rady,FN)% SGoftext(text,sz,t,radx,rady,FN) - returns a solid for text optional bended
% (by Tim Lueth, VLFL-Lib, 2016-DEZ-23 as class: SURFACES)
%
% Introduced first in SolidGeometry 3.2
%
% See also: SGtext, VLFLtextimage, SGtextstamp
%
% [SG,CPL,sz]=SGoftext(text,[sz,t,radx,rady,FN])
% === INPUT PARAMETERS ===
% text: string
% sz: size in [x y z] or just [0 y z] [x 0 z]
% t: thichness of plate does reduce z; default is 0
% radx: radius in x; default is planar
% rady: radius in y; default is planar
% FN:
% === OUTPUT RESULTS ======
% SG: Solid Geometry
% CPL: Contour of the text
% sz: size of the object before bending
%
% EXAMPLE: Weihnachten on sphere with radius 40:
% SGoftext ('Weihnachten',[40 30 5],'',40,40)
% SGoftext ('Weihnachten',[40 0 5],'',40,40)
% SGoftext ('Weihnachten',[0 30 5],'',40,40)
% SGoftext ('Mimed','','','','','Bauhaus 93');
%
% See also: SGtext, VLFLtextimage, SGtextstamp
%
%
% Copyright 2016-2019 Tim C. Lueth

exp_2016_12_22(pos)- EXPERIMENT to find the minimal slot distance for separated solids

exp_2016_12_22(pos)% exp_2016_12_22(pos) - EXPERIMENT to find the minimal slot distance for
% separated solids
% (by Tim Lueth, , 2016-DEZ-22)
%
% On Dec, 23rd, 2016, I made this experiment detecting, that with 25um
% Resolution in z and a slot distance of 0.4mm the parts can be separated
% by force and 0.5 or 0.6 leed to fully separated parts (Status of:
% 2016-12-23)
%
% SG=exp_2016_12_22([pos])
% === INPUT PARAMETERS ===
% pos: 'a' assembled or 's' separated
% === OUTPUT RESULTS ======
% SG: Final solid geometry
%

image2video (fname)- adding titles & end titles to video files

image2video (fname)% image2video (fname) - adding titles & end titles to video files
% (by Tim Lueth, VLFL-Lib, 2016-DEZ-22 as class: FILE HANDLING)
%
% OBSOLETE REPLACED BY videoCopyCutMovies
% (Status of: 2019-06-10)
%
% Introduced first in SolidGeometry 3.2
%
% See also: video2animatedGIF, videoCopyCutMovies
%
% image2video([fname])
% === INPUT PARAMETERS ===
% fname: file name
%
% See also: video2animatedGIF, videoCopyCutMovies
%
%
% Copyright 2016-2019 Tim C. Lueth

exp_2016_12_22- Experiment for slot size using Formlab2

exp_2016_12_22% exp_2016_12_22 - Experiment for slot size using Formlab2
% (by Tim Lueth, VLFL-Lib, 2016-DEZ-22 as class: EXPERIMENTS)
%
% exp_2016_12_22
%

SGof2T(TA,TB,elo,Rv,NCPL)- Creates a solid geometry between two frames

SGof2T(TA,TB,elo,Rv,NCPL)% SGof2T(TA,TB,elo,Rv,NCPL) - Creates a solid geometry between two frames
% (by Tim Lueth, VLFL-Lib, 2016-DEZ-21 as class: MODELING PROCEDURES)
%
% The solid is created starting at frame 1 ending at frame 2 considering
% a minimal radius of Rv.
% The solid is elongated starting before frame 1 and ends after frame 2
% to implement penetration of links. Optional, it is possible to extrude
% a contour. Please make sure that radius Rv is at least 2.5 time the
% maximum distance of NCPL from the origin.
% Base frame and Follower frame are added, but the base frame has its ez
% vector directing outside of the solid (Status of: 2019-07-09)
%
% Introduced first in SolidGeometry 3.2
%
% See also: TLofCVL, SGofCPLCVLR, SGcontourtube, SGcontourtube2,
% SGofCPLtransT, SGof2SGT, SGof2CVL, SGof2CPLz, SGdesignfaceconnectingrod
%
% SG=SGof2T(TA,TB,[elo,Rv,NCPL])
% === INPUT PARAMETERS ===
% TA: Frame A
% TB: Frame B
% elo: elongation of the solid for penetration; default is 0.001
% Rv: Radius; default is 4
% NCPL: Optional Contour; Default is PLcircle(Rv)
% === OUTPUT RESULTS ======
% SG: Solid Geoemtry
%
% EXAMPLE: SGof2T(eye(4),TofR(rot(0,pi,0),[20 0 0]))
%
% See also: TLofCVL, SGofCPLCVLR, SGcontourtube, SGcontourtube2,
% SGofCPLtransT, SGof2SGT, SGof2CVL, SGof2CPLz, SGdesignfaceconnectingrod
%
%
% Copyright 2016-2020 Tim C. Lueth

connectofmat(CL,n)- return the element that have a connection in the matrix

connectofmat(CL,n)% connectofmat(CL,n) - return the element that have a connection in the matrix
% (by Tim Lueth, VLFL-Lib, 2016-DEZ-20 as class: AUXILIARY PROCEDURES)
%
% See also: SGanalyzePenetration, CPLsortinout
%
% no=connectofmat(CL,[n])
% === INPUT PARAMETERS ===
% CL: Connection matrix
% n: input connection value/list; default is ''
% === OUTPUT RESULTS ======
% no: vector of all row/vol that are somehow connected to input vector n
%
% EXAMPLE:
% [~,CC]=CPLsortinout(CPLsample(14)); c=connectofmat(CC)
%
RapidWeaver Icon

Last Change Oct 2023 for SG-Lib 5.3