deleteQuiver(ax)- deletes all Quivers (coordinate graphics objects) in the named axes |
% deleteQuiver(ax) - deletes all Quivers (coordinate graphics objects) in the named axes % (by Tim Lueth, SG-Lib, 2025-AUG-31 as class: VISUALIZATION) % % Some plot fnctns in the pde toolbox create a "Quiver" abbreviation for a % coordinate system plot in matlab (Status of: 2025-08-31) % % Introduced first in SolidGeometry 5.5 % % See also: ispatch, SGofgca % % deleteQuiver([ax]) % === INPUT PARAMETERS === % ax: axes, default is gca % % EXAMPLE: % deleteQuiver % % See also: ispatch, SGofgca % % % Copyright 2025 Tim C. Lueth |
FEDiscreteGeometryFromSG(SG)- similar to pdemodelofSG (2017), but simplified |
% FEDiscreteGeometryFromSG(SG) - similar to pdemodelofSG (2017), but simplified % (by Tim Lueth, SG-Lib, 2025-AUG-31) % % Introduced first in SolidGeometry 5.5 % % See also: SGtetramesh, pdemodelofSG % % fem=FEDiscreteGeometryFromSG(SG) % === INPUT PARAMETERS === % SG: Solid Geometry % === OUTPUT RESULTS ====== % fem: Finite Elemente / Feature Edge model for pde % % EXAMPLE: % FEDiscreteGeometryFromSG(SGDIN13(5,12)) % % See also: SGtetramesh, pdemodelofSG % % % Copyright 2025 Tim C. Lueth |
SGfurniturewedges(H,L,"STL")- returns furniture wedges for assemble of shelfs etc/ with an height impprint |
% SGfurniturewedges(H,L,"STL") - returns furniture wedges for assemble of shelfs etc/ with an height impprint % (by Tim Lueth, SG-Lib, 2025-AUG-24 as class: COMPLETED CAD DESIGNS) % % Introduced first in SolidGeometry 5.5 % % See also: SGfurniturespacer % % SG=SGfurniturewedges([H,L,"STL"]) % === INPUT PARAMETERS === % H: height of the wedges; default is 5 % L: Length and widht of the wedges; default is [50 30] % "STL": if used an STL file is written % === OUTPUT RESULTS ====== % SG: Solid geometry % % EXAMPLE: % SGfurniturewedges(4,[50 20]) % % See also: SGfurniturespacer % % % Copyright 2025 Tim C. Lueth |
VLremz(VL)- simply reduces the cols of a list to 2 |
% VLremz(VL) - simply reduces the cols of a list to 2 % (by Tim Lueth, SG-Lib, 2025-AUG-20 as class: PL/POINT LISTS) % % Creates always PL from cutting VL to 2 dimensions (Status of: 2025-08-20) % % Introduced first in SolidGeometry 5.5 % % See also: VLaddz % % PL=VLremz(VL) % === INPUT PARAMETERS === % VL: Vertex list with n x 3 rows % === OUTPUT RESULTS ====== % PL: Point list with n x 2 rows % % EXAMPLE: % VLremz(VLaddz(CPLsample(12),2)) % % See also: VLaddz % % % Copyright 2025 Tim C. Lueth |
screencaputureofcommandwindow- returns the screenshopt of the command window |
% screencaputureofcommandwindow - returns the screenshopt of the command window % (by Tim Lueth & ChatGPT, SG-Lib, 2025-AUG-13 as class: USER INTERFACE) % % During debugging, it is often helpful to have a snapshot of the screen or % command window, if there is a need to interrupt and restart debugging, or if % you just collect problems.[spchk] (Status of: 2025-08-17) % % Introduced first in SolidGeometry 5.5 % % See also: screencapture % % imgData=screencaputureofcommandwindow % === OUTPUT RESULTS ====== % imgData: image data of the command window % % EXAMPLE: % screencaputureofcommandwindow; % creatres an snapshot without saving to disk % % See also: screencapture % % % Copyright 2025 Tim C. Lueth |
depuseStringmult(term1,term2)- Finds files that contain multiple strings linked by an AND condition. |
% depuseStringmult(term1,term2) - Finds files that contain multiple strings linked by an AND condition. % (by Tim Lueth, SG-Lib, 2025-AUG-13 as class: CODING/DEVELOP) % % This fnctn was used to search for potential bugs that appeared in FSofSG and % were caused by combining the new string parameter search with getfuncparamStr % in combination with the earlier parameter search "~isempty(varargin{" commonly % used before 2018, which can be fixed by replacing the later one with % "getfuncparam". (Status of: 2025-08-13) % % Introduced first in SolidGeometry 5.5 % % See also: depuseString % % ll=depuseStringmult([term1,term2]) % === INPUT PARAMETERS === % term1: search term 1 % term2: search term 2 and more % === OUTPUT RESULTS ====== % ll: cell list of file that containt all of the search strings % % EXAMPLE: % depuseStringmult('getfuncparamStr','~isempty(varargin{') % % See also: depuseString % % % Copyright 2025 Tim C. Lueth |
SGfusedoubledvertices(SG,thr)- fuses vertices with similar positions, shortens the VL, but the number of facets remains unchanged. |
% SGfusedoubledvertices(SG,thr) - fuses vertices with similar positions, shortens the VL, but the number of facets remains unchanged. % (by Tim Lueth, SG-Lib, 2025-AUG-12 as class: SG/SOLIDS) % % This fnctn probably already exists in several places, but as of 2024a/b, the % behavior of delaunayTriangulation has changed and bugs occur in % SGremsurfedgepoints, which makes it necessary to examine the individual steps % in detail. (Status of: 2025-08-12) % % Introduced first in SolidGeometry 5.5 % % See also: VLFLshort, VLFLfusedoubledvertices % % SGN=SGfusedoubledvertices(SG,[thr]) % === INPUT PARAMETERS === % SG: Vertex list % thr: Threshold für round(VL,thr); default is 1e-17 DO NOT USE DIGITS % === OUTPUT RESULTS ====== % SGN: Solid with fused vertex list % % EXAMPLE: % A=SGlinkage(5,30,5); model=pdemodelofSG(A,1); SGofpdemodel(model); B=ans % SGfusedoubledvertices(B,0.1); % even with 0.1mm no change % SGfusedoubledvertices(B, 1); % with 1mm changes and non manifold problems % % See also: VLFLshort, VLFLfusedoubledvertices % % % Copyright 2025 Tim C. Lueth |
VLFLfusedoubledvertices(VL,FL,thr)- fuses vertices with similar positions, shortens the VL, but the number of facets remains unchanged. |
% VLFLfusedoubledvertices(VL,FL,thr) - fuses vertices with similar positions, shortens the VL, but the number of facets remains unchanged. % (by Tim Lueth, SG-Lib, 2025-AUG-12 as class: VLFL/SURFACES) % % This fnctn probably already exists in several places, but as of 2024a/b, the % behavior of delaunayTriangulation has changed and bugs occur in % SGremsurfedgepoints, which makes it necessary to examine the individual steps % in detail. (Status of: 2025-08-12) % % Introduced first in SolidGeometry 5.5 % % See also: VLFLshort, SGfusedoubledvertices % % [NVL,NFL]=VLFLfusedoubledvertices(VL,FL,[thr]) % === INPUT PARAMETERS === % VL: Vertex list % FL: Facet list % thr: Threshold für round(VL,thr); default is 1e-17 DO NOT USE DIGITS % === OUTPUT RESULTS ====== % NVL: New vertex list % NFL: New facet list % % EXAMPLE: % A=SGlinkage(5,30,5); model=pdemodelofSG(A,1); SGofpdemodel(model); B=ans % VLFLfusedoubledvertices(B.VL,B.FL,0.1); % even with 0.1mm no change % VLFLfusedoubledvertices(B.VL,B.FL,1); % with 1mm changes and non manifold problems % % See also: VLFLshort, SGfusedoubledvertices % % % Copyright 2025 Tim C. Lueth |
Tsvd(T)- Correction fnct for an HT matrix for orthogonalizing a matrix after multiplication |
% Tsvd(T) - Correction fnct for an HT matrix for orthogonalizing a matrix after multiplication % (by Tim Lueth, SG-Lib, 2025-AUG-09 as class: KINEMATICS AND FRAMES) % % using ChatGPT (Status of: 2025-08-09) % % Introduced first in SolidGeometry 5.5 % % See also: TofVL % % TS=Tsvd(T) % === INPUT PARAMETERS === % T: Original HT Matrix % === OUTPUT RESULTS ====== % TS: svd corrected T matrix with corrected R=[ex ey yz] % % EXAMPLE: % TofR([pi,pi,pi]), To=ans; Tsvd(To), Tsvd(round(To,13)) % % See also: TofVL % % % Copyright 2025 Tim C. Lueth |
HELP_SGLIB_Simple3DextrusionfromContours- Basic tutorial for the SG-Lib on creation on solid body geometries from extrusion of contours |
% HELP_SGLIB_Simple3DextrusionfromContours - Basic tutorial for the SG-Lib on creation on solid body geometries from extrusion of contours % (by Tim Lueth, SG-Lib, 2025-AUG-07 as class: TUTORIAL) % % In addition to simple extrusion in x, y, z of a contour, connections between % points or along paths in space are also presented. However, this tutorial % assumes that the cross-sectional contour at the beginning of the body also % corresponds to the cross-sectional contour at the end of the body. (Status of: % 2025-08-10) % % Introduced first in SolidGeometry 5.5 % % See also: HELP_SGLIB_AutomaticDesignofConnetingSolids, % HELP_SGLIB_AutomaticLinkJointConnection, % HELP_SGLIB_BooleanConcatenationofSolids, % HELP_SGLIB_ClosedContoursPolyboolPolyshape, HELP_SGLIB_Datatypes, % HELP_SGLIB_DesignofRobotArms, HELP_SGLIB_RelativeSpatialRelationofSolids % % HELP_SGLIB_Simple3DextrusionfromContours % % EXAMPLE: % HELP_SGLIB_Simple3DextrusionfromContours % % See also: HELP_SGLIB_AutomaticDesignofConnetingSolids, % HELP_SGLIB_AutomaticLinkJointConnection, % HELP_SGLIB_BooleanConcatenationofSolids, % HELP_SGLIB_ClosedContoursPolyboolPolyshape, HELP_SGLIB_Datatypes, % HELP_SGLIB_DesignofRobotArms, HELP_SGLIB_RelativeSpatialRelationofSolids % % % Copyright 2025 Tim C. Lueth |
SGBAUHAUSpenholdertilted(SH,MX,Dw)- constructs a tilted pen holder |
% SGBAUHAUSpenholdertilted(SH,MX,Dw) - constructs a tilted pen holder % (by Tim Lueth, SG-Lib, 2025-AUG-06 as class: COMPLETED CAD DESIGNS) % % Desk secretaries with retractable writing surfaces or panoramic screens % covering the desk require pen holders where the pens do not exceed a certain % maximum height. This is achievable if a pen holder for pens of length L is at % least L/2 high and tilted so that the pen end L does not exceed the maximum % height H. Not stable subtraction[spchk] (Status of: 2025-08-17) % % Introduced first in SolidGeometry 5.5 % % See also: SGBAUHAUSnotesbox, SGBAUHAUSdeskcylinder % % SGall=SGBAUHAUSpenholdertilted([SH,MX,Dw]) % === INPUT PARAMETERS === % SH: Pen length and holder height; default is [150 0]; 0 means automatic % calculation % MX: Maximal height of the upper side of the pen holder; default is 100 % Dw: Diameter of a circular pen holder % === OUTPUT RESULTS ====== % SGall: Solids to print % % EXAMPLE: % SGBAUHAUSpenholdertilted(150,200) % No need to tilt the pen holder % SGBAUHAUSpenholdertilted(150,100) % Need to tilt the pen holder % % % See also: SGBAUHAUSnotesbox, SGBAUHAUSdeskcylinder % % % Copyright 2025 Tim C. Lueth |
SGlibHelpTutorials- A feature for tutorial authors that provides hyperlinks to display and open existing tutorials. |
% SGlibHelpTutorials - A feature for tutorial authors that provides hyperlinks to display and open existing tutorials. % (by Tim Lueth, SG-Lib, 2025-AUG-05 as class: CODING/DEVELOP) % % The mfiles can be converted using % mfile2mlxfile4markup % mfile2mlxfile4markup % into html in the "SGLIB_HELP_Structures/html/" folder[spchk] (Status of: % 2025-08-19) % % Introduced first in SolidGeometry 5.5 % % See also: mfile2mlxfile4markup % % llc=SGlibHelpTutorials % === OUTPUT RESULTS ====== % llc: % % EXAMPLE: % SGlibHelpTutorials % shows the files and opens it by clicking on the link % % See also: mfile2mlxfile4markup % % % Copyright 2025 Tim C. Lueth |
TofSGFSselect(SG,ez,descr)- provides a frame that can be described using spatial terms as described in FSselect |
% TofSGFSselect(SG,ez,descr) - provides a frame that can be described using spatial terms as described in FSselect % (by Tim Lueth, SG-Lib, 2025-AUG-04 as class: FS/FEATURE SURFACES) % % In constrast to "TofSGfil", this fnctn is able to correct the ez vector of the % surface, wich is impossible for "TofSGfil" that returns T and CPL, but the % orientation of CPL an T is abigiou (Status of: 2025-08-09) % % Introduced first in SolidGeometry 5.5 % % See also: TofSGfil, FSselect, CPLofFS, CPLofVLFL % % [T,CPL]=TofSGFSselect(SG,[ez,descr]) % === INPUT PARAMETERS === % SG: Solid Geometry % ez: ez for FSselect % descr: more paramters for FSselect % === OUTPUT RESULTS ====== % T: Frame % CPL: Contour fits T % % EXAMPLE: % load JACO_robot.mat % or loadweb if not loaded already % TofSGfil(JC0,FSselect(JC0,[+1 0 0],'areadescend',1)) % frames shows in the right direction % TofSGfil(JC0,FSselect(JC0,[+1 0 0],'areadescend',2)) % frame shows in wrong direction % TofSGFSselect(JC0,[+1 0 0],'areadescend',2) % Frame shows into right direction % % See also: TofSGfil, FSselect, CPLofFS, CPLofVLFL % % % Copyright 2025 Tim C. Lueth |
TofSGfil(SG,fil)- Provides the frame for a feature surface that is passed as a face index list. |
% TofSGfil(SG,fil) - Provides the frame for a feature surface that is passed as a face index list. % (by Tim Lueth, SG-Lib, 2025-AUG-04 as class: FS/FEATURE SURFACES) % % This fnctn is nothing other than CPLofFS or CPLofVLFL, but cannot be found % under this name if you are not interested in the contour but only in the frame % in combination with FSselect. % Be careful, since there is no guarantee that T shows ins the direction of the % original surface. Consider TofSGFSselect for that (Status of: 2025-08-09) % % Introduced first in SolidGeometry 5.5 % % See also: FSselect, TofSGFSselect, CPLofFS, CPLofVLFL % % [T,CPL]=TofSGfil([SG,fil]) % === INPUT PARAMETERS === % SG: Solid Geometry % fil: Facet index list of a closed surface % === OUTPUT RESULTS ====== % T: Coordinates frame of the facet index list % CPL: Boundary contour of a planar feature surface % % EXAMPLE: % load JACO_robot.mat % or loadweb if not loaded already % TofSGfil(JC0,FSselect(JC0,[0 0 -1],'front',-1)); % TofSGfil(JC0,FSselect(JC0,[+1 0 0],'front',-1)) % TofSGfil(JC0,FSselect(JC0,[-1 0 0],'areadescend',1)) % TofSGfil(JC0,FSselect(JC0,[+1 0 0],'areadescend',1)) % frames shows in the right direction % TofSGfil(JC0,FSselect(JC0,[+1 0 0],'areadescend',2)) % frames shows in the wrong direction % % See also: FSselect, TofSGFSselect, CPLofFS, CPLofVLFL % % % Copyright 2025 Tim C. Lueth |
HELP_SGLIB_AutomaticDesignofConnetingSolids- Basic tutorial for the SG-Lib on designing solids to connect to points/frames,surfaces |
% HELP_SGLIB_AutomaticDesignofConnetingSolids - Basic tutorial for the SG-Lib on designing solids to connect to points/frames,surfaces % (by Tim Lueth, SG-Lib, 2025-AUG-02 as class: TUTORIAL) % % Introduced first in SolidGeometry 5.5 % % See also: HELP_SGLIB_AutomaticLinkJointConnection, % HELP_SGLIB_BooleanConcatenationofSolids, % HELP_SGLIB_ClosedContoursPolyboolPolyshape, HELP_SGLIB_Datatypes, % HELP_SGLIB_DesignofRobotArms, HELP_SGLIB_RelativeSpatialRelationofSolids % % HELP_SGLIB_AutomaticDesignofConnetingSolids % % EXAMPLE: % mfile2mlxfile4markup HELP_SGLIB_AutomaticDesignofConnetingSolids force % % See also: HELP_SGLIB_AutomaticLinkJointConnection, % HELP_SGLIB_BooleanConcatenationofSolids, % HELP_SGLIB_ClosedContoursPolyboolPolyshape, HELP_SGLIB_Datatypes, % HELP_SGLIB_DesignofRobotArms, HELP_SGLIB_RelativeSpatialRelationofSolids % % % Copyright 2025 Tim C. Lueth |
HELP_SGLIB_BooleanConcatenationofSolids- Basic tutorial for the SG-Lib on merging an fusion of solids |
% HELP_SGLIB_BooleanConcatenationofSolids - Basic tutorial for the SG-Lib on merging an fusion of solids % (by Tim Lueth, SG-Lib, 2025-JUL-29 as class: TUTORIAL) % % Introduced first in SolidGeometry 5.5 % % See also: HELP_SGLIB_AutomaticDesignofConnetingSolids, % HELP_SGLIB_AutomaticLinkJointConnection, % HELP_SGLIB_ClosedContoursPolyboolPolyshape, HELP_SGLIB_Datatypes, % HELP_SGLIB_DesignofRobotArms, HELP_SGLIB_RelativeSpatialRelationofSolids % % HELP_SGLIB_BooleanConcatenationofSolids % % EXAMPLE: % mfile2mlxfile4markup HELP_SGLIB_BooleanConcatenationofSolids force % % See also: HELP_SGLIB_AutomaticDesignofConnetingSolids, % HELP_SGLIB_AutomaticLinkJointConnection, % HELP_SGLIB_ClosedContoursPolyboolPolyshape, HELP_SGLIB_Datatypes, % HELP_SGLIB_DesignofRobotArms, HELP_SGLIB_RelativeSpatialRelationofSolids % % % Copyright 2025 Tim C. Lueth |
CPLisclosedCPL(CPL)- return wether the contours are open or closed in a CPL |
% CPLisclosedCPL(CPL) - return wether the contours are open or closed in a CPL % (by Tim Lueth, SG-Lib, 2025-JUL-28 as class: GEOMETRIC QUERIES) % % Introduced first in SolidGeometry 5.5 % % See also: CPLisccwcorrected % % [fot,ol]=CPLisclosedCPL(CPL) % === INPUT PARAMETERS === % CPL: CPL format contours % === OUTPUT RESULTS ====== % fot: overall result % ol: index list of open contour % % EXAMPLE: % CPLisclosedCPL(CPLsample(10)) % CPLisclosedCPL(CPLsample(12)) % CPLisclosedCPL(CPLsample(38)) % % See also: CPLisccwcorrected % % % Copyright 2025 Tim C. Lueth |
titleprintftext()- creates a title based on the parameterlist given by the calling fnct |
% titleprintftext() - creates a title based on the parameterlist given by the calling fnct % (by Tim Lueth, SG-Lib, 2025-JUL-27 as class: VISUALIZATION) % % Used in SGtransrelSG, to explain the displayed solids / contour by inserting % the spatial translations into the title. Uses "SGpartsfuncparams" for the text % creation (Status of: 2025-08-20) % % Introduced first in SolidGeometry 5.5 % % See also: SGtransrelSG % % h=titleprintftext([]) % === OUTPUT RESULTS ====== % h: handle to title % % EXAMPLE: % titleprintftext('A','B','C',{10,20}); shg % % See also: SGtransrelSG % % % Copyright 2025 Tim C. Lueth |
HELP_SGLIB_RelativeSpatialRelationofSolids- Basic tutorial for the SG-Lib on relative spatial relations |
% HELP_SGLIB_RelativeSpatialRelationofSolids - Basic tutorial for the SG-Lib on relative spatial relations % (by Tim Lueth, SG-Lib, 2025-JUL-27 as class: TUTORIAL) % % Bodies can be aligned relative to each other in space. Using the bounding box % of the geometry, using frames, etc. This tutorial describes the basics and % shows what a description language for this might look like. (Status of: % 2025-08-10) % % Introduced first in SolidGeometry 5.5 % % See also: HELP_SGLIB_AutomaticDesignofConnetingSolids, % HELP_SGLIB_AutomaticLinkJointConnection, % HELP_SGLIB_BooleanConcatenationofSolids, % HELP_SGLIB_ClosedContoursPolyboolPolyshape, HELP_SGLIB_Datatypes, % HELP_SGLIB_DesignofRobotArms % % HELP_SGLIB_RelativeSpatialRelationofSolids % % EXAMPLE: % mfile2mlxfile4markup HELP_SGLIB_RelativeSpatialRelationofSolids force % % See also: HELP_SGLIB_AutomaticDesignofConnetingSolids, % HELP_SGLIB_AutomaticLinkJointConnection, % HELP_SGLIB_BooleanConcatenationofSolids, % HELP_SGLIB_ClosedContoursPolyboolPolyshape, HELP_SGLIB_Datatypes, % HELP_SGLIB_DesignofRobotArms % % % Copyright 2025 Tim C. Lueth |
SGoutdated (datestr,altstr)- Execution stops by reporting that the fnct is outdated |
% SGoutdated (datestr,altstr) - Execution stops by reporting that the fnct is outdated % (by Tim Lueth, SG-Lib, 2025-JUL-26 as class: CODING/DEVELOP) % % After 15 years of SGLib development, there are more and more fnctns that are no % longer used and whose content is difficult to understand because they have not % been used for a long time. These are often routines that were developed for % concept that has since been replaced by a newer one. Ultimately, these routines % only stand out in the systematic documentation, where they are carried along as % "corpses." (Status of: 2025-08-09) % % Introduced first in SolidGeometry 5.5 % % See also: dbreturn % % SGoutdated([datestr,altstr]) % === INPUT PARAMETERS === % datestr: optional datestr to show when it was marked as outdated % altstr: optional recommendation for replacement % % EXAMPLE: See how it is used in SGofVLdelaunay called in exp_2017_05_01 % % Simply add a line such as SGoutdated(‘2025-07-26’), favorable directly after the func heading. % % % exp_2017_05_01 % % See also: dbreturn % % % Copyright 2025 Tim C. Lueth |
SGreolink2pipeclamp(element,"STL")- Produces a bolt plate for screwing the Reolink camera to a double tube clamp with a joint. |
% SGreolink2pipeclamp(element,"STL") - Produces a bolt plate for screwing the Reolink camera to a double tube clamp with a joint. % (by Tim Lueth, SG-Lib, 2025-JUL-25 as class: PARAMETRIC DESIGN) % % [AI] Used for mounting Reolink cameras on poles or downpipes on a house wall. % (Status of: 2025-08-15) % % Introduced first in SolidGeometry 5.5 % % See also: SGreolink % % SGall=SGreolink2pipeclamp([element,"STL"]) % === INPUT PARAMETERS === % element: 'boltplate' % "STL": % === OUTPUT RESULTS ====== % SGall: Silid Geometry % % Additional Hyperlinks: % Double jointed pipe clamp (Heima24) % % EXAMPLE: % SGreolink2pipeclamp('boltplate') % % See also: SGreolink % % % Copyright 2025 Tim C. Lueth |
HELP_SGLIB_ClosedContoursPolyboolPolyshape- Basic tutorial for the SG-Lib on the foundations of closed contours for surface design |
% HELP_SGLIB_ClosedContoursPolyboolPolyshape - Basic tutorial for the SG-Lib on the foundations of closed contours for surface design % (by Tim Lueth, SG-Lib, 2025-JUL-23 as class: TUTORIAL) % % Introduced first in SolidGeometry 5.5 % % See also: HELP_SGLIB_AutomaticDesignofConnetingSolids, % HELP_SGLIB_AutomaticLinkJointConnection, % HELP_SGLIB_BooleanConcatenationofSolids, HELP_SGLIB_Datatypes, % HELP_SGLIB_DesignofRobotArms, HELP_SGLIB_RelativeSpatialRelationofSolids % % HELP_SGLIB_ClosedContoursPolyboolPolyshape % % EXAMPLE: % mfile2mlxfile4markup HELP_SGLIB_ClosedContoursPolyboolPolyshape force % % See also: HELP_SGLIB_AutomaticDesignofConnetingSolids, % HELP_SGLIB_AutomaticLinkJointConnection, % HELP_SGLIB_BooleanConcatenationofSolids, HELP_SGLIB_Datatypes, % HELP_SGLIB_DesignofRobotArms, HELP_SGLIB_RelativeSpatialRelationofSolids % % % Copyright 2025 Tim C. Lueth |
SGTduplicateframe(SG,FN,DN,flip)- duplicates a single frame of solid using a new name |
% SGTduplicateframe(SG,FN,DN,flip) - duplicates a single frame of solid using a new name % (by Tim Lueth, SG-Lib, 2025-JUL-21 as class: KINEMATICS AND FRAMES) % % Introduced first in SolidGeometry 5.5 % % See also: SGTget, SGTset % % SG=SGTduplicateframe(SG,FN,DN,[flip]) % === INPUT PARAMETERS === % SG: Solid % FN: Frame Name % DN: Duplicated Name % flip: if true; fliped around y, align to match % === OUTPUT RESULTS ====== % SG: Solid with additional duplicated Frame % % EXAMPLE: % A=SGbar([10 5 10]); % A=SGTset(A,'B',TofFS(A,[0 1 0])); % SGTduplicateframe(A,'B','New') % SGTduplicateframe(A,'B','New',true) % % See also: SGTget, SGTset % % % Copyright 2025 Tim C. Lueth |
SGTalignT(SG,T,TM,az)- aligns two frame to have same ey-vectors by opposite ez vectors |
% SGTalignT(SG,T,TM,az) - aligns two frame to have same ey-vectors by opposite ez vectors % (by Tim Lueth, SG-Lib, 2025-JUL-09 as class: KINEMATICS AND FRAMES) % % Fnctn has been implemented as part of SGtransrelSG in 2016 (Status of: % 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: SGtransT, SGTmatchT, SGtransrelSG % % SGN=SGTalignT(SG,[T,TM,az]) % === INPUT PARAMETERS === % SG: Solid Geometry % T: Frame or Frame name of SG % TM: eye(4) or new coordiante system to match % az: optional final turn around ez % === OUTPUT RESULTS ====== % SGN: New Position of SG using SGtransT % % EXAMPLE: % SGbox; SG=ans; SGTalignT(SG,'Y-') % SGTalignT(SG,'Y-',TofPez([0 0 40],[0 -1 0])) % % See also: SGtransT, SGTmatchT, SGtransrelSG % % % Copyright 2025 Tim C. Lueth |
SGTtransT(SG,T,TM,az)- Desired, but ambiguous, so only a help text is displayed. |
% SGTtransT(SG,T,TM,az) - Desired, but ambiguous, so only a help text is displayed. % (by Tim Lueth, SG-Lib, 2025-JUL-09 as class: KINEMATICS AND FRAMES) % % Use either SGTalignT or SGTmatchT for frames (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: SGTalignT, SGTmatchT % % SGN=SGTtransT([SG,T,TM,az]) % === INPUT PARAMETERS === % SG: Solid with frames for SGTalignT, SGTmatchT % T: Frame name % TM: Reference frame; default is eye(4) % az: rotation around final z axis % === OUTPUT RESULTS ====== % SGN: would be the transformed SG by SGTalignT, SGTmatchT % % EXAMPLE: % A=SGTsetBFsimple(SGbox('noframe')) % AA=SGTalignT(A,'F'); AM=SGTmatchT(A,'F'); SGfigure; % subplot(1,2,1); SGTplotalpha(AA); title('SGTalignT'); subplot(1,2,2); SGTplotalpha(AM); title('SGTmatchT'); view4all(-30,30); % % See also: SGTalignT, SGTmatchT % % % Copyright 2025 Tim C. Lueth |
showpath(nn)- Returns the search path as an n x 1 cell array. |
% showpath(nn) - Returns the search path as an n x 1 cell array. % (by Tim Lueth, SG-Lib, 2025-JUL-03 as class: AUXILIARY PROCEDURES) % % same as splitpath(path,':') (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: addpath, split, path % % ppp=showpath([nn]) % === INPUT PARAMETERS === % nn: cell array index % === OUTPUT RESULTS ====== % ppp: [n x 1] cell array of all path or the selected entries % % EXAMPLE: % showpath % [n x 1] cell array of all path % showpath(1:3) % returns only the first 3 entries % % See also: addpath, split, path % % % Copyright 2025 Tim C. Lueth |
SGlibpath- returns the filepath of the toolbox directory |
% SGlibpath - returns the filepath of the toolbox directory % (by Robin Schregle & Tim Lueth, SG-Lib, 2025-JUN-30 as class: CODING/DEVELOP) % % uses which and fileparts (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: desktopdir, pcodedirTL, smbFilename, smbPSLibname, expname, % matlabtoolboxdir, matlabdir % % fpath=SGlibpath % === OUTPUT RESULTS ====== % fpath: filepath without filesep % % EXAMPLE: % SGlibpath % Should work on mac and PC % % See also: desktopdir, pcodedirTL, smbFilename, smbPSLibname, expname, % matlabtoolboxdir, matlabdir % % % Copyright 2025 Tim C. Lueth |
repairtextfileEOF(fname)- Removes unwanted EOL char(26) from text files |
% repairtextfileEOF(fname) - Removes unwanted EOL char(26) from text files % (by Tim Lueth, SG-Lib, 2025-JUN-18 as class: FILE HANDLING) % % For some reason, in 2024a and 2024b, when writing with % fid=fopen(fname,'wt+','n',"ISO-8859-15"); fwrite(fid,txt,'uint8'); at least on % MAC under macOS 14 and macOS 15, EOF characters char(26) occasionally appear in % the file. This happens when writing, not when reading. Since this character % causes problems with parsing XML files in the browser, such files can be % corrected retrospectively using this fnctn, even though the same write routine % is used here. (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: writetextfile, readtextfile, repairtextfileEOL % % repairtextfileEOF(fname) % === INPUT PARAMETERS === % fname: full filepath % % EXAMPLE: % repairtextfileEOF('/Volumes/LUETH-WIN/WIN AIM Matlab Libraries/SolidGeometry-Code/demos.xml') % % See also: writetextfile, readtextfile, repairtextfileEOL % % % Copyright 2025 Tim C. Lueth |
HELP_SGLIB_Datatypes- Basic tutorial for the SG-Lib on data types and abbreaviations |
% HELP_SGLIB_Datatypes - Basic tutorial for the SG-Lib on data types and abbreaviations % (by Tim Lueth, SG-Lib, 2025-JUN-01 as class: TUTORIAL) % % This tutorial introduces the different data types that can be used to design, % modify, spatially arrange, kinematically organize, and merge contours and % bodies, or fuse them using Boolean fnctns. Only the data types are introduced. % (Status of: 2025-08-10) % % Introduced first in SolidGeometry 5.5 % % See also: HELP_SGLIB_AutomaticDesignofConnetingSolids, % HELP_SGLIB_AutomaticLinkJointConnection, % HELP_SGLIB_BooleanConcatenationofSolids, % HELP_SGLIB_ClosedContoursPolyboolPolyshape, HELP_SGLIB_DesignofRobotArms, % HELP_SGLIB_RelativeSpatialRelationofSolids, % HELP_SGLIB_Simple3DextrusionfromContours % % HELP_SGLIB_Datatypes % % EXAMPLE: % HELP_SGLIB_Datatypes % % See also: HELP_SGLIB_AutomaticDesignofConnetingSolids, % HELP_SGLIB_AutomaticLinkJointConnection, % HELP_SGLIB_BooleanConcatenationofSolids, % HELP_SGLIB_ClosedContoursPolyboolPolyshape, HELP_SGLIB_DesignofRobotArms, % HELP_SGLIB_RelativeSpatialRelationofSolids, % HELP_SGLIB_Simple3DextrusionfromContours % % % Copyright 2025 Tim C. Lueth |
SGBAUHAUStectaF51(BN)- returns models of the BAUHAUS Walter Gropius Chair produced by TECTA in Germany |
% SGBAUHAUStectaF51(BN) - returns models of the BAUHAUS Walter Gropius Chair produced by TECTA in Germany % (by Tim Lueth, SG-Lib, 2025-APR-28 as class: COMPLETED CAD DESIGNS) % % The two-seater Gropius sofa F51-2 and the three-seater sofa F51-3 developed % organically from the cubic armchair F51 in the director's room of the Weimar % Bauhaus. The floating upholstery alternately catches the eye, as does the % characteristic cantilever construction that surrounds the upholstered elements % - one could also say: penetrates them. The F51-2 and F51-3 sofas have a close % connection to Tecta. In an exchange with Erich Brendel, he was able to % responsibly assure us that the F51 armchair was already in the director's room % in spring 1920, but not the sofa. (Status of: 2025-08-25) % % Introduced first in SolidGeometry 5.5 % % See also: SGBAUHAUSchairscratch % % SGD=SGBAUHAUStectaF51([BN]) % === INPUT PARAMETERS === % BN: body number 1/2/3; 0 creates a full set % === OUTPUT RESULTS ====== % SGD: Solid Geometry of a single chair / sofa % % Additional Hyperlinks: % TECTA F51-3 % % EXAMPLE: % SGBAUHAUStectaF51(2) % % See also: SGBAUHAUSchairscratch % % % Copyright 2025 Tim C. Lueth |
SGBAUHAUSchairscratch- returns the SG for a scrat protector of a specific Bauhaus style chair |
% SGBAUHAUSchairscratch - returns the SG for a scrat protector of a specific Bauhaus style chair % (by Tim Lueth, SG-Lib, 2025-APR-21 as class: COMPLETED CAD DESIGNS) % % programming time was just 10 minutes. Many chairs from the Baushaus school are % made of leather and stainless steel profile tubes or chrome-plated tube % profiles. These easily scratch a wooden floor. For this reason, a scratch % protector is designed here for a square profile (Status of: 2025-07-31) % % Introduced first in SolidGeometry 5.5 % % See also: SGBAUHAUSsamsungG5C49, SGfurniturespacer % % SGBAUHAUSchairscratch % % Additional Hyperlinks: % Bauhaus stool with cowhide % % EXAMPLE: % SGBAUHAUSchairscratch % % See also: SGBAUHAUSsamsungG5C49, SGfurniturespacer % % % Copyright 2025 Tim C. Lueth |
chat()- single line communication with openAI's chat gpt with persistent chat history |
% chat() - single line communication with openAI's chat gpt with persistent chat history % (by Tim Lueth, SG-Lib, 2025-APR-13 as class: ARTIFICIAL INTELLIGENCE) % % In longer conversations with a lot of text to analyze, this fnctn will lead to % an error by etensive use of the openAI models in OpenAIrequest % % chat1 - sends a single line to openAI API without history % chat - opens a single line conversation using the chat history % chatGPT - opens the chatGPT web browser interface % chatweb - opens the chatGPT web browser interface % % Uses OpenAIrequest. Make sure that your openAI API secret key is stored in a % file called "OPENAI_API_KEY.env" % (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: chat1, chatweb, chatGPT, OpenAIrequest % % y=chat([]) % === OUTPUT RESULTS ====== % y: Response from openAI when using your paid openAI API account % % EXAMPLE: % Difference between chat and chath % chat1 what is the age of joe biden % chat1 what ist the age of his wife % chat what is the age of joe biden % chat what ist the age of his wife % chat clear % löscht die Erinnerung % chat what ist the age of his wife % % See also: chat1, chatweb, chatGPT, OpenAIrequest % % % Copyright 2025 Tim C. Lueth |
chatGPT- simply opens chatGPT web-browser window |
% chatGPT - simply opens chatGPT web-browser window % (by Tim Lueth, SG-Lib, 2025-APR-13 as class: ARTIFICIAL INTELLIGENCE) % % chat1 - sends a single line to openAI API without history % chat - opens a single line conversation using the chat history % chatGPT - opens the chatGPT web browser interface % chatweb - opens the chatGPT web browser interface (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: chat, chatweb, chath, OpenAIrequest % % chatGPT % % EXAMPLE: try chatGPT % % See also: chat, chatweb, chath, OpenAIrequest % % % Copyright 2025 Tim C. Lueth |
SGBAUHAUSflorence(B)- returns a solid geoometry for an Florence Knoll Basset chair or sofa |
% SGBAUHAUSflorence(B) - returns a solid geoometry for an Florence Knoll Basset chair or sofa % (by Tim Lueth, SG-Lib, 2025-FEB-25 as class: COMPLETED CAD DESIGNS) % % [AI] # The BAUHAUS architect Florence Basset, who married the furniture % producer Knoll, designed this beautiful sofa, which is also available as an % affordable similar copy at IKEA. (Status of: 2025-07-31) % % Introduced first in SolidGeometry 5.5 % % See also: SGBAUHAUStectaF51 % % SGC=SGBAUHAUSflorence([B]) % === INPUT PARAMETERS === % B: Seat width in cm - THE sofa is 15 cm wider % === OUTPUT RESULTS ====== % SGC: Solid Geometry of chair % % EXAMPLE: % SGBAUHAUSflorence % SGBAUHAUSflorence(195) % % See also: SGBAUHAUStectaF51 % % % Copyright 2025 Tim C. Lueth |
SGreolink- Designing a cover for a Reolink camera |
% SGreolink - Designing a cover for a Reolink camera % (by Tim Lueth, SG-Lib, 2024-DEZ-22 as class: PARAMETRIC DESIGN) % % This is a cover for outdoor use of Reolink video cameras in rain and snow. % Printed on an Anycubic Predator. There is an opening for the camera and one for % the antenna. % (Status of: 2025-07-25) % % Introduced first in SolidGeometry 5.5 % % SGall=SGreolink % === OUTPUT RESULTS ====== % SGall: cell array with {cover , base plate} % % EXAMPLE: % SGreolink % % % Copyright 2024-2025 Tim C. Lueth |
CPLhatchgridofCPL(CPLOrg,dim)- creates filling meshs similar to a slicer |
% CPLhatchgridofCPL(CPLOrg,dim) - creates filling meshs similar to a slicer % (by Tim Lueth, SG-Lib, 2024-DEZ-09 as class: CPL/CLOSED POLYGON LISTS) % % slow fnctn using CPL union (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: CPLhatch, CPLfillinside, CPLofSGprojection % % CPLF=CPLhatchgridofCPL(CPLOrg,[dim]) % === INPUT PARAMETERS === % CPLOrg: Original contour of a solid cross section/projection or a solid % dim: Wall and bar width and distance default is [2 20] % === OUTPUT RESULTS ====== % CPLF: Contoor with a simple squared mesh % % EXAMPLE: % CPLhatchgridofCPL(CPLsample(31)*20); % CPLhatchgridofCPL(CPLsample(31)*20,'fill'); % CPLhatchgridofCPL(SGsample(29),'fill',[1 5]); % CPLhatchgridofCPL(SGsample(29),[1 5]); % % See also: CPLhatch, CPLfillinside, CPLofSGprojection % % % Copyright 2024-2025 Tim C. Lueth |
OpenAIPDFemailanswers(fname,txtlen)- analyzes Emails and returns an email to the sender |
% OpenAIPDFemailanswers(fname,txtlen) - analyzes Emails and returns an email to the sender % (by Tim Lueth, SG-Lib, 2024-NOV-22 as class: ARTIFICIAL INTELLIGENCE) % % We often receive friendly reminders and emails from many, many people, which we % unfortunately cannot answer due to our limited time. Correcting spelling, % gendering and replying personally also requires a lot of energy and takes up % valuable working time. Nevertheless, administrative and legal processes often % require a reply to ensure that the message has been received. Therefore, this % fnctn automatically creates a reply to the sender, but leaves the decision open % for the time being. (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: extractFileText, PDFcheckOCR % % fclass=OpenAIPDFemailanswers([fname,txtlen]) % === INPUT PARAMETERS === % fname: current file name % txtlen: number of characters read % === OUTPUT RESULTS ====== % fclass: Text message % % EXAMPLE: % per default the clipboard content is analyzed % % See also: extractFileText, PDFcheckOCR % % % Copyright 2024-2025 Tim C. Lueth |
PDFcreateOpenAIfilenames(last,dname)- renames files in a folder by an openAI LLM interface including Name and adresse |
% PDFcreateOpenAIfilenames(last,dname) - renames files in a folder by an openAI LLM interface including Name and adresse % (by Tim Lueth, SG-Lib, 2024-NOV-21 as class: ARTIFICIAL INTELLIGENCE) % % This is a typical application for a LLM. The OCR-Text of an PDF is parsed and a % short explaination is used to define a filename, including the original date of % the document. % The costs for classification in Nov. 2024 were 6US$=6EURO for 3000 documents. % This is 0.2 cents per document of 2000 characters. No one would be able to % provide this service at these costs. (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: PDFcheckOCR, OpenAIPDFtextclassification, OpenAIPDFemailanswers % % PDFcreateOpenAIfilenames([last,dname]) % === INPUT PARAMETERS === % last: number of documents; default is 1 % dname: directory name to parse default is Postordner (LUETH)/*.pdf % % See also: PDFcheckOCR, OpenAIPDFtextclassification, OpenAIPDFemailanswers % % % Copyright 2024-2025 Tim C. Lueth |
OpenAIPDFtextclassification(fname,txtlen)- analyzes PDF scans with OCR content and create a file name for it |
% OpenAIPDFtextclassification(fname,txtlen) - analyzes PDF scans with OCR content and create a file name for it % (by Tim Lueth, SG-Lib, 2024-NOV-21 as class: ARTIFICIAL INTELLIGENCE) % % Introduced first in SolidGeometry 5.5 % % See also: extractFileText, PDFcheckOCR % % fclass=OpenAIPDFtextclassification([fname,txtlen]) % === INPUT PARAMETERS === % fname: current file name % txtlen: % === OUTPUT RESULTS ====== % fclass: proposed file name % % See also: extractFileText, PDFcheckOCR % % % Copyright 2024-2025 Tim C. Lueth |
xyofez(ez)- returns for a simple ez vector the ex and ey orthonormal vectors |
% xyofez(ez) - returns for a simple ez vector the ex and ey orthonormal vectors % (by Tim Lueth, SG-Lib, 2024-NOV-14 as class: KINEMATICS AND FRAMES) % % mainly the same as TofPez. This fnctn is required if, for example, 3D contours % are to be created along a 3D path in space. If these are circles with identical % diameters, the complexity of the problem is not noticeable. However, as soon as % a rectangular cross-section is used, it is clear that the x and y orientation, % which must always be perpendicular to the path, must also be continuous and % differentiable, otherwise spontaneous rotations of 90, 180 or 270 degrees may % occur. The direction must not change. Once you have started with an - initially % arbitrary - alignment, the subsequent vectors X and Y must be aligned % accordingly. However, if the direction of the path changes by more than 90 % degrees, the alignment of the X and Y axes is ambiguous. The difference is % implemented in VLedgeNormal. (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: TofPez, VLedgeNormal, SGcontourtube2, VLFL_EXP16, VLFL_EXP44 % % [ex,ey,ez]=xyofez(ez) % === INPUT PARAMETERS === % ez: Richtungsvektor eines Pfades % === OUTPUT RESULTS ====== % ex: orthogonal vector to ez % ey: orthogonal vector to ex and ez % ez: normalized vector ez % % EXAMPLE: % xyofez([0 0 1]) % xyofez([1 0 0]) % % See also: TofPez, VLedgeNormal, SGcontourtube2, VLFL_EXP16, VLFL_EXP44 % % % Copyright 2024-2025 Tim C. Lueth |
CPL2cw(CPL)- changes the orientation of all nested CPLs to cw |
% CPL2cw(CPL) - changes the orientation of all nested CPLs to cw % (by Tim Lueth, SG-Lib, 2024-NOV-14 as class: CPL/CLOSED POLYGON LISTS) % % Because of some unclear changes between the polyshape class, this fnctn is % required to compare (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: poly2cw, CPL2ccw, CPLinvert % % CPLN=CPL2cw(CPL) % === INPUT PARAMETERS === % CPL: CPL with nested CPLS % === OUTPUT RESULTS ====== % CPLN: CPL with nested CPLS all in cw % % EXAMPLE: % SGfigure; CPLplotcwccw(CPLsample(44)) % SGfigure; CPLplotcwccw(CPL2cw(CPLsample(44))) % SGfigure; CPLplotcwccw(CPLCPL2ccwinvert(CPLsample(4))) % SGfigure; CPLplotcwccw(CPLinvert(CPLsample(44))) % % See also: poly2cw, CPL2ccw, CPLinvert % % % Copyright 2024-2025 Tim C. Lueth |
CPL2ccw(CPL)- changes the orientation of all nested CPLs to ccw |
% CPL2ccw(CPL) - changes the orientation of all nested CPLs to ccw % (by Tim Lueth, SG-Lib, 2024-NOV-14 as class: CPL/CLOSED POLYGON LISTS) % % Due to some unclear changes in the polyshape class, it is necessary to rely on % a clear direction of rotation of the contours within a CPL in the SGLib. % (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: poly2ccw, poly2cw, CPL2cw % % CPLN=CPL2ccw(CPL) % === INPUT PARAMETERS === % CPL: CPL with nested CPLS % === OUTPUT RESULTS ====== % CPLN: CPL with nested CPLS all in ccw % % EXAMPLE: % SGfigure; CPLplotcwccw(CPLsample(38)) % SGfigure; CPLplotcwccw(CPL2cw(CPLsample(38))) % SGfigure; CPLplotcwccw(CPLCPL2ccwinvert(CPLsample(38))) % SGfigure; CPLplotcwccw(CPLinvert(CPLsample(38))) % % % See also: poly2ccw, poly2cw, CPL2cw % % % Copyright 2024-2025 Tim C. Lueth |
chat1()- single line communication with openAI's chat gpt |
% chat1() - single line communication with openAI's chat gpt % (by Tim Lueth, SG-Lib, 2024-NOV-11 as class: ARTIFICIAL INTELLIGENCE) % % chat1 - sends a single line to openAI API without history % chat - opens a single line conversation using the chat history % chatGPT - opens the chatGPT web browser interface % chatweb - opens the chatGPT web browser interface % % Uses OpenAIrequest. Make sure that your openAI API secret key is stored in a % file called "OPENAI_API_KEY.env" % (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: OpenAIcostAPI, openai, chat, chatweb, chatGPT, chath, OpenAIrequest % % y=chat1([]) % === OUTPUT RESULTS ====== % y: Response from openAI when using your paid openAI API account % % EXAMPLE: % Difference between chat and chath % chat1 what is the age of joe biden % chat1 what ist the age of his wife % chat what is the age of joe biden % chat what ist the age of his wife % % See also: OpenAIcostAPI, openai, chat, chatweb, chatGPT, chath, OpenAIrequest % % % Copyright 2024-2025 Tim C. Lueth |
OpenAIrequest(Userinp,AIhistory,RequestHistory)- returns the openAI Chat anwer for a single question |
% OpenAIrequest(Userinp,AIhistory,RequestHistory) - returns the openAI Chat anwer for a single question % (by Tim Lueth, SG-Lib, 2024-NOV-09 as class: ARTIFICIAL INTELLIGENCE) % % if called without an input the fnctn will establish a conversation until % "Cntr-C" is used (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: jarvisChatSGLib, json2matlab, jsonplansequence, OpenAIcostAPI % % [AIansw,AIhistory,RequestHistory]=OpenAIrequest([Userinp,AIhistory,RequestHisto % ry]) % === INPUT PARAMETERS === % Userinp: A charcter chain as input; default is empty % AIhistory: the struct that is used by addResponseMessage, to maintain a chat % history; default ist empty % RequestHistory: a cell list that describes the history of Userinp in case of a % conversation % === OUTPUT RESULTS ====== % AIansw: Answer to the last Userinp % AIhistory: AI history of response messages if a conversion is planned % RequestHistory: The history of Userinp if a a conversion is planned % % EXAMPLE: % OpenAIrequest('What is the core diameter of a DIN13 M4 nut') % return a text answer % OpenAIrequest % start a conversation loop % % See also: jarvisChatSGLib, json2matlab, jsonplansequence, OpenAIcostAPI % % % Copyright 2024-2025 Tim C. Lueth |
jsonplansequence(Userinp,AIchat,AIhistory)- returns a plan step sequence from a single chat task |
% jsonplansequence(Userinp,AIchat,AIhistory) - returns a plan step sequence from a single chat task % (by Tim Lueth, SG-Lib, 2024-NOV-07 as class: ARTIFICIAL INTELLIGENCE) % % The original openAI/matlab interface is able to create sequences of tasks, but % the argument references are faulty, which is why a complex task has to be % explicitly broken down into a sequence and then processed as a series of % requests. (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: jarvisChatSGLib, json2matlab, OpenAIrequest, OpenAIcostAPI % % [Userscript,AIhistory]=jsonplansequence(Userinp,AIchat,AIhistory) % === INPUT PARAMETERS === % Userinp: User input as one string % AIchat: AIchat % AIhistory: AI History % === OUTPUT RESULTS ====== % Userscript: plan sequence as single string % AIhistory: modified AI History % % EXAMPLE: % jarvisChatSGLib % what is typical diameter and height of coffe mug, create zylinder with this dimensions % % See also: jarvisChatSGLib, json2matlab, OpenAIrequest, OpenAIcostAPI % % % Copyright 2024-2025 Tim C. Lueth |
json2matlab(SGfuncname,SGfuncargs,Variables)- convertes a json reaction of an openAI-Chat into a matlab code line |
% json2matlab(SGfuncname,SGfuncargs,Variables) - convertes a json reaction of an openAI-Chat into a matlab code line % (by Tim Lueth, SG-Lib, 2024-NOV-06 as class: ARTIFICIAL INTELLIGENCE) % % Robin Schregle used a switch structure with matlab code to implement the SG-Lib % fnctn calls. This requires the maintenance of the json code for fnctns f..... % and in addition the code for the fnctn calls in the matlab code (see % SGlib_Fnctn_Calling_OpenAI). Tim Lueth's solution uses the JSON code of the % answer directly to create the matlab code to be executed by eval. % This fnctn is this decoding and evaluation of the matlab code, extracted from % the json answer. % % % % AIchat = openAIChat("gpt-4o",Temperature=0, Tools=[f0,f1,f2,f3,f4,f5]); % % SGlib fnctns f0..f5 as JSON % % AIhistory = messageHistory(); % % AIhistory = addUserMessage(AIhistory, Userinp); % Add a user request % % % [AItextansw, AIexecplan] = generate(AIchat, AIhistory); % generate the chat % answer % % AIhistory = addResponseMessage(AIhistory, AIexecplan); % add the answer to % the chat history % % SGlibcalls = AIexecplan.tool_calls; % find the % appropriate SGlib calls in the answer % % SGfuncname = SGlibcalls(k).fnctn.name; % can be an array % therefor use index k % % SGfuncargs = SGlibcalls(k).fnctn.arguments; % can be an array % therefor use index k % % SGresult= % % SGresultname = SGfuncname + string(length(AIhistory.Messages)); % One % possibility for naming % % Variables.(SGresultname) = SGResult; % create a list of % results for referencing % % % (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: jarvisChatSGLib, jsonplansequence, OpenAIrequest, OpenAIcostAPI % % [SGansw,cmdstr]=json2matlab(SGfuncname,SGfuncargs,Variables) % === INPUT PARAMETERS === % SGfuncname: Name of the current SG fnctn extracted from the AIexecplan % SGfuncargs: Struct containing the parameternames as fields and expected values % extracted from the AIexecplan % Variables: History of already used SGresults as cell list of SGfuncnames with % the call number % === OUTPUT RESULTS ====== % SGansw: evaluated result from the matlab code extracted from the json answer. % cmdstr: the command string executed within json2matlab to create res % % See also: jarvisChatSGLib, jsonplansequence, OpenAIrequest, OpenAIcostAPI % % % Copyright 2024-2025 Tim C. Lueth |
OpenAIcostAPI- opens the web page of company openAI to show the users expenses |
% OpenAIcostAPI - opens the web page of company openAI to show the users expenses % (by Robin Schregle & Tim Lueth, SG-Lib, 2024-NOV-04 as class: ARTIFICIAL % INTELLIGENCE) % % 1) Download from Gitgub (see link below) the Large Language Model (LMM) fnctns % of Matlab and store the files in a folder in your Matlab code directory using % the % folder name [pwd filesep 'llms-with-matlab'] % 2) add this path to your main directory using % addpath([pwd filesep 'llms-with-matlab']) % 3) create an API account at openAI % you have to start an account store your credit card info (see link below) % 4) create an environment ascii file with name "OPENAI_API_KEY.env" that % contains a single line % OPENAI_API_KEY=" % 5) load this environmentfile by % loadenv("OPENAI_API_KEY.env") % 6) set the model to % modelName = "gpt-4o"; % (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: jarvisChatSGLib, json2matlab, jsonplansequence, OpenAIrequest % % OpenAIcostAPI % % Additional Hyperlinks: % Matlab's LLM at Github, OpenAI API-Key Generation % % EXAMPLE: % OpenAIcostAPI % % See also: jarvisChatSGLib, json2matlab, jsonplansequence, OpenAIrequest % % % Copyright 2024-2025 Tim C. Lueth |
jarvisChatSGLib- this fnct/script is a ChatGPT based control of the SGLib and defines the development start of SGLib 5.5 |
% jarvisChatSGLib - this fnct/script is a ChatGPT based control of the SGLib and defines the development start of SGLib 5.5 % (by Robin Schregle & Tim Lueth, SG-Lib, 2024-NOV-04 as class: ARTIFICIAL % INTELLIGENCE) % % At the end of October 2024, Tim Lueth encouraged his team to work with the % Matlab/ChatGPT API interface, and Felix Pancheri and Robin Schregle started to % use it. Robin Schregle implemented a first version called % “SGlib_Fnctn_Calling_OpenAI”. This fnctn “jarvisChatSGLib” is an improved % version of “SGlib_Fnctn_Calling_OpenAI” to achieve similar results to the % already existing SGLib fnctn “jarvis” from January 2022, which was programmed % by Tim Lueth on the recommendation of Franz Irlinger.The original fnctn % "jarvis" was based on the use von Apple's Siri and the SGLib's parser % "siri2jarvis" % 1) Download from Gitgub (see link below) the Large Language Model (LMM) fnctns % of Matlab and store the files in a folder in your Matlab code directory using % the % folder name [pwd filesep 'llms-with-matlab'] % 2) add this path to your main directory using % addpath([pwd filesep 'llms-with-matlab']) % 3) create an API account at openAI % you have to start an account store your credit card info (see link below) % 4) create an environment ascii file with name "OPENAI_API_KEY.env" that % contains a single line % OPENAI_API_KEY=" % 5) load this environmentfile by % loadenv("OPENAI_API_KEY.env") % 6) set the model to % modelName = "gpt-4o"; % (Status of: 2025-07-20) % % Introduced first in SolidGeometry 5.5 % % See also: chat, jarvis, SGlib_Fnctn_Calling_OpenAI, OpenAIcostAPI % % jarvisChatSGLib % % Additional Hyperlinks: % Matlab's LLM at Github, OpenAI API-Key Generation % % EXAMPLE: % jarvisChatSGLib % % See also: chat, jarvis, SGlib_Fnctn_Calling_OpenAI, OpenAIcostAPI % % % Copyright 2024-2025 Tim C. Lueth |