CPLRlinkageangles(CPLR,T,R,CMAT)- calculates the static angles between link contour in the current configuration - does not explain anything |
| % CPLRlinkageangles(CPLR,T,R,CMAT) - calculates the static angles between link contour in the current configuration - does not explain anything % (by Tim Lueth, SG-Lib, 2026-APR-06 as class: 4BAR/LINKAGES) % % USE CAREFULLY: CPLRlinkageangles was not being tested extensively % % Seems to be a useless fnctn without kirchhoff % extracted out of CPLRanalyzeTkinematics - where it is needed to analyze which % contours may for together if there are more than 2 links attaching a joint % (Status of: 2026-04-06) % % Introduced first in SolidGeometry 5.6 % % See also: CPLRanalyzeTkinematics % % [WINT,CMATA,CMAT]=CPLRlinkageangles([CPLR,T,R,CMAT]) % === INPUT PARAMETERS === % CPLR: cell array with separated link contours % T: 3x3 frame or cell array of frames % R: Correlation matric or (Incidence(G)') % CMAT: If R>0 The contours are analyzed only in a circluar area of R (Usefule is % 4*Radius of joint) % === OUTPUT RESULTS ====== % WINT: list of opening angles for each joint frame % CMATA: row=contour col-frames cell array containing the eigenvectors % CMAT: row=contour col-frames cell array containing the transponated incidence % matric % % EXAMPLE: % A0=[0 0]; B0=[100 10]; A1=[0 60]; B1=[100 80]; PLN=[A0;B0;B1;A1]; ELN=[1 2;2 3;3 4;4 1]; % G=simplify(graph(ELN(:,1),ELN(:,2))); ELN=table2array(G.Edges); % not really required hereCPLR=CPLRofPLEL(PLN,ELN,R); % CPLR=CPLRofPLEL(PLN,ELN,R); % T=mat2celldim3(TLofPL(PLN,true,false)) % % See also: CPLRanalyzeTkinematics % % % Copyright 2026 Tim C. Lueth |
CPLRTplot(CPLR,T,wlim,colstr)- plots a linkage consisting of link contours and joint frames in 2D |
| % CPLRTplot(CPLR,T,wlim,colstr) - plots a linkage consisting of link contours and joint frames in 2D % (by Tim Lueth, SG-Lib, 2026-APR-05 as class: VISUALIZATION) % % Introduced first in SolidGeometry 5.6 % % See also: CPSplot, TLplot, Taplot % % h=CPLRTplot([CPLR,T,wlim,colstr]) % === INPUT PARAMETERS === % CPLR: cell array of contours % T: cell array of frames % wlim: optional angle interval for frames % colstr: optional color string default is 'brmcg' (good colors to read w/o 'k') % === OUTPUT RESULTS ====== % h: handle to graphics objects % % See also: CPSplot, TLplot, Taplot % % % Copyright 2026 Tim C. Lueth |
rofcircleinsideCPL(CPLZ,"sep")- returns radius and center point of maximum inner circle and the of the minimum surrounding circle |
| % rofcircleinsideCPL(CPLZ,"sep") - returns radius and center point of maximum inner circle and the of the minimum surrounding circle % (by Tim Lueth, SG-Lib, 2026-APR-04 as class: GEOMETRIC QUERIES) % % USE CAREFULLY: rofcircleinsideCPL was not being tested extensively % % simply uses rofcirclearoundCPL % ! uses the heuristic slow fnctn centerinsideCPL for cpi and ri % % (Status of: 2026-04-04) % % Introduced first in SolidGeometry 5.6 % % See also: centerCPL, centerPL, circlearoundPL, centerinsideCPL, % rofcirclearoundCPL % % [ri,cpi,ro,cp]=rofcircleinsideCPL([CPLZ,"sep"]) % === INPUT PARAMETERS === % CPLZ: CPL to analyze % "sep": if used, the CPLs is separated and the r values are listst / array % === OUTPUT RESULTS ====== % ri: Maximum inner radius (not unique) % cpi: Center point of the most inner radius (not unique) % ro: Smallest outer radius % cp: Center point of the minmal outetr radius % % EXAMPLE: % rofcircleinsideCPL(CPLsample(12)) % rofcircleinsideCPL(CPLsample(12),'sep') % rofcircleinsideCPL(CPLsample(1)) % random % rofcircleinsideCPL(CPLsample(34)) % random % % % See also: centerCPL, centerPL, circlearoundPL, centerinsideCPL, % rofcirclearoundCPL % % % Copyright 2026 Tim C. Lueth |
exp_2026_04_04_crosstable- AN EXPERIMENT TO ADDRESS THE CHALLENGES INVOLVED IN DESIGNING THE JOINTS FOR A BIG CROSS TABLE |
| % exp_2026_04_04_crosstable - AN EXPERIMENT TO ADDRESS THE CHALLENGES INVOLVED IN DESIGNING THE JOINTS FOR A BIG CROSS TABLE % (by Tim Lueth, SG-Lib, 2026-APR-04 as class: EXPERIMENTS) % % USE CAREFULLY: exp_2026_04_04_crosstable was not being tested extensively % % This experiment does not design the cross table by explicit design of linkages % and joints but % a) creates the linkages from a grid of points % b) analyses % 1st: the original joints, % 2nd: the required joint by crossings, % 3rd: the free terminals % % ==> IN this state it is possible that more than two contours are attached to a % joint, which is not possible to solve at the current SGLib's state of the art. % ==> There is a need to glue contours before integrating a joint => same problem % as in postprocessing of CPLRofPLEL! % (Status of: 2026-04-04) % % Introduced first in SolidGeometry 5.6 % % See also: exp_2026_04_01_crosstable, CPLRofPLEL % % exp_2026_04_04_crosstable % % See also: exp_2026_04_01_crosstable, CPLRofPLEL % % % Copyright 2026 Tim C. Lueth |
PLcircleoval4obstacle(R,n,L,CPLO,TL,"strict")- similar to PLcircleoval but is considering static and moving obstacles |
| % PLcircleoval4obstacle(R,n,L,CPLO,TL,"strict") - similar to PLcircleoval but is considering static and moving obstacles % (by Tim Lueth, SG-Lib, 2026-APR-03 as class: 4BAR/LINKAGES) % % USE CAREFULLY: PLcircleoval4obstacle was not being tested extensively % % in planar 4bars using piano hinges sometimes a link crosses another link which % makes it impossible to create both solids for attaching the hinge. In this case % a small deformation of a straight link contour creates the same kinematic % movement with a slightly or remarkable different contour of the link % % This fnctn considers the link A0 B0 as static and not moving at the same time. % There will be in future an additonal parameter (TLAB) if A0 B0 is moving at the % same time (Status of: 2026-04-03) % % Introduced first in SolidGeometry 5.6 % % See also: PLcircleoval, PLcircleoval, PLshortestpathinCPLcost, PLshortestpathCPL % % CPLN=PLcircleoval4obstacle([R,n,L,CPLO,TL,"strict"]) % === INPUT PARAMETERS === % R: Radius % n: optional number of points for half circle % L: [A0; B0] % CPLO: optional obstacle contour % TL: frame or frame list that describes the movement von CPLO % "strict": if used, also A0 and B0 must be collision free % === OUTPUT RESULTS ====== % CPLN: Point List of the contour from A0 to B0 % % EXAMPLE: % PLcircleoval(5,'',[0 0;100 5]); % without obstale % PLcircleoval4obstacle(5,'',[0 0;100 5]); % considering obstacles avoidance % PLcircleoval4obstacle(5,'',[0 0;100 5],PLsquare(30)+[60 5]); % static obstacle % PLcircleoval4obstacle(5,'',[0 0;100 5],PLsquare(30)+[60 5],TLofProt(eye(3),[0 pi/2])); % moving obstacle % % PLcircleoval4obstacle(5,'',[0 0;100 5],PLcircleoval(5,'',[0 0;50 0]),TLofProt(eye(3),[0 pi/2])); % PLcircleoval4obstacle(5,'',[0 0;100 -5],PLcircleoval(5,'',[0 0;150 0]),TLofProt(eye(3),[0 pi/2])); % PLcircleoval4obstacle(5,'',[0 0;100 -5],PLcircleoval(5,'',[0 0;150 0]),TLofProt(eye(3),[0 pi/2]),'strict'); % % See also: PLcircleoval, PLcircleoval, PLshortestpathinCPLcost, PLshortestpathCPL % % % Copyright 2026 Tim C. Lueth |
CPLRofPLEL(PL,EL,R,"nocirc")- creates a set of linkages based on on a PL and EL and radius information |
| % CPLRofPLEL(PL,EL,R,"nocirc") - creates a set of linkages based on on a PL and EL and radius information % (by Tim Lueth, SG-Lib, 2026-APR-03 as class: 4BAR/LINKAGES) % % USE CAREFULLY: CPLRofPLEL was not being tested extensively % % Completely different to CPLofPLEL (Status of: 2026-04-03) % % Introduced first in SolidGeometry 5.6 % % See also: CPLfourbarcontour, CPLofPLEL % % [CPLR,PLN,ELN]=CPLRofPLEL([PL,EL,R,"nocirc"]) % === INPUT PARAMETERS === % PL: Point list or popint sequence list [P1;P2;P3...] or [P1 P2; P2 P3] % EL: Edge list if a pure point list was used % R: Outer and optional inner radius; default is [2 1] % "nocirc": will disappear in future | if used 3 closed coupled contours are % replaced ONE contour % === OUTPUT RESULTS ====== % CPLR: cell array of link contours % PLN: Simplified point list % ELN: simplified connection list between points % % EXAMPLE: % A0=[0 0]; B0=[100 10]; A1=[0 60]; B1=[100 80]; C0=[60 40]; C1=[60 90]; D1=[100 50]; % PLS=[A0 B0; B0 B1; B1 A1; A1 A0; C0 C1; C0 D1]; % CPLRofPLEL(PLS) % CPLRofPLEL([A0;B0;B1;A1],[1 2;2 3;3 4;4 1]) % chain with 3 coupled links % CPLRofPLEL([A0;B0;B1;A1],[1 2;2 3;3 1;4 1]) % chain with 3 coupled links % CPLRofPLEL([A0;B0;B1;A1],[1 2;2 3;3 1;4 1],'nocirc') % blocked chains - feature will dissappear % % See also: CPLfourbarcontour, CPLofPLEL % % % Copyright 2026 Tim C. Lueth |
CPLRinserthingeclosed(CPLR,T,R,wlim,"debug")- returns CPL regions linked by Frames prepared for extrusion |
| % CPLRinserthingeclosed(CPLR,T,R,wlim,"debug") - returns CPL regions linked by Frames prepared for extrusion % (by Tim Lueth, SG-Lib, 2026-APR-02 as class: 4BAR/LINKAGES) % % USE CAREFULLY: CPLRinserthingeclosed was not being tested extensively % % calls CPSinserthingelist and prepares contours for a kinematic chain % All of the input parameters are directly used as input for "CPSinserthingelist" % The output parameter are prepared to be used directly as input for % "SGofCPLRTzpianohinge" % (Status of: 2026-04-03) % % Introduced first in SolidGeometry 5.6 % % See also: CPSinserthinge, CPSinserthingelist, CPLRinserthingelist, % SGofCPLRTzpianohinge % % [CPLR,T,R,EEL,CPLCA,CPLCB,wlim]=CPLRinserthingeclosed([CPLR,T,R,wlim,"debug"]) % === INPUT PARAMETERS === % CPLR: Contour in which the hinges are to be inserted % T: cell list of Frames. Empty Frames mean interactive selection, Numeric scalar % means n interactive frames % R: same as in SGcylhinge but only R(1) used % wlim: angle limit [amax] or [amin amax] with respect to the x axis of the frame % "debug": is helpful to avoid material reduction when there are steep angles as % in "CPSinserthingelist" % === OUTPUT RESULTS ====== % CPLR: Cell list of regions to be used in SGofCPLRTzpianohingeclosed % T: cell list of frames to be used in Cell list of regions to be used in % SGofCPLRTzpianohingeclosed % R: radius used for joints to be used in Cell list of regions to be used in % SGofCPLRTzpianohingeclosed % EEL: Extended edge list [stator-index rotor-index signed-frame-index] to be % used in Cell list of regions to be used in SGofCPLRTzpianohingeclosed % CPLCA: Connnecting contour availabe to connct stator contour CPLA to the joint % CPLCB: Connnecting contour availabe to connct rotor contour CPLB to the joint % wlim: cell ist of angle interval or singe angle interval [wmin wmax] % % EXAMPLE: % [CPL,T,~,wlim,txt]=SGjointsample(1); close all; % Take an joint example % [CPLRN,T,R,EEL,CPLCA,CPLCB,wlim]=CPLRinserthingeclosed(CPLR,T,R,wlim); % Create the contours % [SGR,EEL,WLIM]=SGofCPLRTzpianohinge(CPLR,10,T,R,EEL,CPLCA,CPLCB,wlim,'debug') % Create the Solids % SGpianohingeanimate(SGR,WLIM,EEL); % Animate % % See also: CPSinserthinge, CPSinserthingelist, CPLRinserthingelist, % SGofCPLRTzpianohinge % % % Copyright 2026 Tim C. Lueth |
SGofCPLRTzpianohingeclosed(CPLR,H,T,R,EEL,CPLCA,CPLCB,wlim,"debug","alter","animate")- creates 2.5 extruded solids of linkage contours using piano hinges |
| % SGofCPLRTzpianohingeclosed(CPLR,H,T,R,EEL,CPLCA,CPLCB,wlim,"debug","alter","animate") - creates 2.5 extruded solids of linkage contours using piano hinges % (by Tim Lueth, SG-Lib, 2026-APR-02 as class: 4BAR/LINKAGES) % % USE CAREFULLY: SGofCPLRTzpianohingeclosed was not being tested extensively % % SGofCPLRTzpianohingeclosed is a more generic version of SGofCPLRTzpianohinge % % It took ten days from 13th to 23rd to fully understand, restructure, and % program the relationship between decomposed contours, frames, connectors, and % the kinematic analysis after the first implementation of % "SGofCPLzpianohingelist". It took from the 23rd to the 2nd of April to % understand the situation for closed kinematic structures and crossing kinematic % structures. % % ! Attention the wlim list (used in CPSinserthingelist) is required for % animation but not for design! (Status of: 2026-04-02) % % Introduced first in SolidGeometry 5.6 % % See also: CPLRinserthingelist, SGofCPLRTzpianohinge % % [SGR,EEL,WLIM,KC]=SGofCPLRTzpianohingeclosed([CPLR,H,T,R,EEL,CPLCA,CPLCB,wlim," % debug","alter","animate"]) % === INPUT PARAMETERS === % CPLR: cell array with link contours comming from CPSinserthingelist % H: [Hinge-length segment-number] (different to SGofCPLz) as in required in % SGpianohinge % T: cell array of Frames that were used returned from CPSinserthingelist % R: R: [Radius Pin-height pin-angle] as required for SGpianohinge % EEL: Extended Edge list of the kinematic chain [A-index B-index Frame-index] % Frame-index sign only required for wlim % CPLCA: Cell array of hinge connecting contour for contour-A % CPLCB: Cell array of hinge connecting contour for contour-AB % wlim: if used, the design steps are shown % === OUTPUT RESULTS ====== % SGR: Cell array of solids (no Frames) that are connected by thee EEL chain of % T-Frames % EEL: Extend Edge List % WLIM: angle limits for EEL % KC: Kinematic chain % % EXAMPLE: % [CPL,T,~,wlim,txt]=SGjointsample(1); close all; % Take an joint example % [CPLR,T,R,EEL,CPLCA,CPLCB,wlim]=CPLRinserthingelist(CPL,T,2,wlim,'both') % Create the contours % [SGR,EEL,WLIM]=SGofCPLRTzpianohingeclosed(CPLR,10,T,R,EEL,CPLCA,CPLCB,wlim,'debug') % Create the Solids % SGpianohingeanimate(SGR,WLIM,EEL); % Animate % % See also: CPLRinserthingelist, SGofCPLRTzpianohinge % % % Copyright 2026 Tim C. Lueth |
SGcellofgcapatch(hgca)- returns the plotted patches of gca as separated solids as cell array |
| % SGcellofgcapatch(hgca) - returns the plotted patches of gca as separated solids as cell array % (by Tim Lueth, SG-Lib, 2026-APR-02 as class: VISUALIZATION) % % in complex design fnctns the solids are plotted on the screen in a different % configuration as in the STL files, especially for animating the solid's % movement. This realistic spatial arrangement can be later used for explaining % the solids in an split/ explosition animation (Status of: 2026-04-02) % % Introduced first in SolidGeometry 5.6 % % See also: SGofgca, VLFLofgca, VLFLofgca, VLofgca, PSofgca, SGofgca2subplots, % SGplotcellsplitanimation % % SG=SGcellofgcapatch([hgca]) % === INPUT PARAMETERS === % hgca: default is gca % === OUTPUT RESULTS ====== % SG: cell array of the individual plotted solids % % EXAMPLE: % SGsample(20); SG=SGcellofgcapatch, SGplotcellsplitanimation(SG); % % See also: SGofgca, VLFLofgca, VLFLofgca, VLofgca, PSofgca, SGofgca2subplots, % SGplotcellsplitanimation % % % Copyright 2026 Tim C. Lueth |
SGplotcellsplitanimation(SGall)- plots the solids of an cell array depending on their minimal z value one after another |
| % SGplotcellsplitanimation(SGall) - plots the solids of an cell array depending on their minimal z value one after another % (by Tim Lueth, SG-Lib, 2026-APR-02 as class: VISUALIZATION) % % Introduced first in SolidGeometry 5.6 % % See also: SGanalyzeGroupParts, SGcellofgcapatch, videoquickstart % % SGplotcellsplitanimation([SGall]) % === INPUT PARAMETERS === % SGall: cell array of solids % % See also: SGanalyzeGroupParts, SGcellofgcapatch, videoquickstart % % % Copyright 2026 Tim C. Lueth |
VLFL_EXP81_joints- TUTORIAL TO SHOW THE USE OF THE JOINT CREATION BY CUTTING A CONTOUR INTO PIECES |
| % VLFL_EXP81_joints - TUTORIAL TO SHOW THE USE OF THE JOINT CREATION BY CUTTING A CONTOUR INTO PIECES % (by Tim Lueth, SG-Lib, 2026-APR-01 as class: TUTORIAL) % % Introduced first in SolidGeometry 5.6 % % See also: VLFL_EXP80, VLFL_EXP79, VLFL_EXP81 % % VLFL_EXP81_joints % % See also: VLFL_EXP80, VLFL_EXP79, VLFL_EXP81 % % % Copyright 2026 Tim C. Lueth |
exp_2026_04_01_crosstable- AN EXPERIMENT TO ADDRESS THE CHALLENGES INVOLVED IN DESIGNING THE JOINTS FOR A CROSS TABLE |
| % exp_2026_04_01_crosstable - AN EXPERIMENT TO ADDRESS THE CHALLENGES INVOLVED IN DESIGNING THE JOINTS FOR A CROSS TABLE % (by Tim Lueth, SG-Lib, 2026-APR-01 as class: EXPERIMENTS) % % USE CAREFULLY: exp_2026_04_01_crosstable was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: exp_2026_04_04_crosstable % % exp_2026_04_01_crosstable % % See also: exp_2026_04_04_crosstable % % % Copyright 2026 Tim C. Lueth |
SGof2CPLTzpianohinge(CPLA,CPLB,H,TA,RR,wlim,"debug")- connects two contours CPLA and CPLB by a pianohinge with given rotation center, frame, radius and height |
| % SGof2CPLTzpianohinge(CPLA,CPLB,H,TA,RR,wlim,"debug") - connects two contours CPLA and CPLB by a pianohinge with given rotation center, frame, radius and height % (by Tim Lueth, SG-Lib, 2026-MÄR-29 as class: 4BAR/LINKAGES) % % USE CAREFULLY: SGof2CPLTzpianohinge was not being tested extensively % % different concept to SGofCPLRTzpianohinge (Status of: 2026-04-01) % % Introduced first in SolidGeometry 5.6 % % See also: SGofCPLRTzpianohinge, CPSinserthinge, CPLbridgePL % % [SGD,ai,bi,ci]=SGof2CPLTzpianohinge([CPLA,CPLB,H,TA,RR,wlim,"debug"]) % === INPUT PARAMETERS === % CPLA: Contour A (blue) % CPLB: Contour B (blue) % H: Height and number of links as used for SGpianohinge; default is [10 4] % TA: Rotation center frame fixed to CPLA % RR: Joint Radius - used for SGpianohinge; default is 2 % wlim: rotation angle of CPLB around TA (relativ to CPLA) % "debug": if used, the design steps are shown % === OUTPUT RESULTS ====== % SGD: cell arayy of elements % ai: index in SGD that belong to CPLA % bi: index in SGD that belong to CPLB % ci: index in SGD that belong neither ot CPLA nor CPLB % % EXAMPLE: % PLcircleoval(5,'',20); CPLA=ans; % contour A % PLtransR(PLcircleoval(5,'',40),pi); CPLB=ans; % contour B % % SGof2CPLTzpianohinge(CPLA,CPLB,'',TofP([0 0]),'debug') % SGof2CPLTzpianohinge(CPLA,CPLB,'',TofP([5 -2]),'debug') % SGof2CPLTzpianohinge(CPLA,CPLB,'',TofP([0 -5]),'debug') % SGof2CPLTzpianohinge(CPLA,CPLB,'',TofP([0 -9]),'debug') % % PLtransP(PLcircleoval(5,'',40),[0 -20],pi/2); CPLB=ans; % contour B % SGof2CPLTzpianohinge(CPLA,CPLB,'',TofP([10 0]),'',[-pi/2 pi/10],'debug'); % % PLtransP(PLcircleoval(5,'',40),[10 -20],pi/2); CPLB=ans; % contour B % SGof2CPLTzpianohinge(CPLA,CPLB,'',TofP([10 0]),'',[-pi/2 pi/10],'debug'); % % See also: SGofCPLRTzpianohinge, CPSinserthinge, CPLbridgePL % % % Copyright 2026 Tim C. Lueth |
exp_2026_03_28_crosslink- EXPERIMENT TO CREATE CROSS LINK OR STAR TYPE LINKE USING PIANO HINGES |
| % exp_2026_03_28_crosslink - EXPERIMENT TO CREATE CROSS LINK OR STAR TYPE LINKE USING PIANO HINGES % (by Tim Lueth, SG-Lib, 2026-MÄR-28 as class: EXPERIMENTS) % % USE CAREFULLY: exp_2026_03_28_crosslink was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % exp_2026_03_28_crosslink % % % Copyright 2026 Tim C. Lueth |
CPLbridgePL(CPL,PL,R)- Creates a brige between a point or frame to a CPL/CPS |
| % CPLbridgePL(CPL,PL,R) - Creates a brige between a point or frame to a CPL/CPS % (by Tim Lueth, SG-Lib, 2026-MÄR-26 as class: CPL/CLOSED POLYGON LISTS) % % USE CAREFULLY: CPLbridgePL was not being tested extensively % % first time in CPSinserthinge 2026-03-15 (Status of: 2026-03-26) % % Introduced first in SolidGeometry 5.6 % % See also: CPLfillgap % % CPLN=CPLbridgePL([CPL,PL,R]) % === INPUT PARAMETERS === % CPL: Contour to attach to % PL: Point, 2 points or 3x3 HT Matrix | x direction is used if more than a % single point % R: Radius of bridge or contour % === OUTPUT RESULTS ====== % CPLN: Complete new contour including the pridge to the frame/point % % EXAMPLE: % CPLbridgePL('',[2 10],PLstar(5,22)); % CPLbridgePL('',TofP([2 10]),PLstar(5,22)); % CPLbridgePL('',TofP([2 10],-pi/4),PLstar(5,22)); % CPLbridgePL('',TofP([2 10],+pi/4),PLstar(5,22)); % CPLbridgePL('',TofP([2 10],+pi/4),1.5); % CPLbridgePL('',TofP([2 10],-pi/4),1.5); % % See also: CPLfillgap % % % Copyright 2026 Tim C. Lueth |
CPLRinserthingelist(CPL,T,R,wlim,"both","debug","nocut","close")- returns CPL regions linked by Frames prepared for extrusion |
| % CPLRinserthingelist(CPL,T,R,wlim,"both","debug","nocut","close") - returns CPL regions linked by Frames prepared for extrusion % (by Tim Lueth, SG-Lib, 2026-MÄR-26 as class: 4BAR/LINKAGES) % % USE CAREFULLY: CPLRinserthingelist was not being tested extensively % % calls CPSinserthingelist and prepares contours for a kinematic chain % All of the input parameters are directly used as input for "CPSinserthingelist" % The output parameter are prepared to be used directly as input for % "SGofCPLRTzpianohinge" % (Status of: 2026-04-01) % % Introduced first in SolidGeometry 5.6 % % See also: CPSinserthinge, CPSinserthingelist, SGofCPLRTzpianohinge % % [CPLR,T,R,EEL,CPLCA,CPLCB,wlim]=CPLRinserthingelist([CPL,T,R,wlim,"both","debug % ","nocut","close"]) % === INPUT PARAMETERS === % CPL: Contour in which the hinges are to be inserted % T: cell list of Frames. Empty Frames mean interactive selection, Numeric scalar % means n interactive frames % R: same as in SGcylhinge but only R(1) used % wlim: angle limit [amax] or [amin amax] with respect to the x axis of the frame % "both": is helpful to avoid material reduction when there are steep angles as % in "CPSinserthingelist" % "debug": if used, the individal steps are shown as in "CPSinserthingelist" % "nocut": if used, the frames do not cut trough as in "CPSinserthingelist" % "close": if used, the contour finally is closed again (not implemented yet) % === OUTPUT RESULTS ====== % CPLR: Cell list of regions to be used in SGofCPLRTzpianohinge % T: cell list of frames to be used in SGofCPLRTzpianohinge % R: radius used for joints to be used in SGofCPLRTzpianohinge % EEL: Extended edge list [stator-index rotor-index signed-frame-index] to be % used in SGofCPLRTzpianohinge % CPLCA: Connnecting contour availabe to connct stator contour CPLA to the joint % CPLCB: Connnecting contour availabe to connct rotor contour CPLB to the joint % wlim: cell ist of angle interval or singe angle interval [wmin wmax] % % EXAMPLE: % [CPL,T,~,wlim,txt]=SGjointsample(1); close all; % Take an joint example % [CPLR,T,R,EEL,CPLCA,CPLCB,wlim]=CPLRinserthingelist(CPL,T,2,wlim,'both') % Create the contours % [SGR,EEL,WLIM]=SGofCPLRTzpianohinge(CPLR,10,T,R,EEL,CPLCA,CPLCB,wlim,'debug') % Create the Solids % SGpianohingeanimate(SGR,WLIM,EEL); % Animate % % See also: CPSinserthinge, CPSinserthingelist, SGofCPLRTzpianohinge % % % Copyright 2026 Tim C. Lueth |
SGofCPLRTzpianohinge(CPLR,H,T,R,EEL,CPLCA,CPLCB,wlim,"debug","alter")- creates 2.5 extruded solids of linkage contours using piano hinges |
| % SGofCPLRTzpianohinge(CPLR,H,T,R,EEL,CPLCA,CPLCB,wlim,"debug","alter") - creates 2.5 extruded solids of linkage contours using piano hinges % (by Tim Lueth, SG-Lib, 2026-MÄR-26 as class: 4BAR/LINKAGES) % % USE CAREFULLY: SGofCPLRTzpianohinge was not being tested extensively % % It took ten days from 13th to 23rd to fully understand, restructure, and % program the relationship between decomposed contours, frames, connectors, and % the kinematic analysis after the first implementation of % "SGofCPLzpianohingelist" % ! Attention the wlim list (used in CPSinserthingelist) is required for % animation but not for design! (Status of: 2026-04-01) % % Introduced first in SolidGeometry 5.6 % % See also: CPLRinserthingelist % % [SGR,EEL,WLIM,KC]=SGofCPLRTzpianohinge([CPLR,H,T,R,EEL,CPLCA,CPLCB,wlim,"debug" % ,"alter"]) % === INPUT PARAMETERS === % CPLR: cell array with link contours comming from CPSinserthingelist % H: [Hinge-length segment-number] (different to SGofCPLz) as in required in % SGpianohinge % T: cell array of Frames that were used returned from CPSinserthingelist % R: R: [Radius Pin-height pin-angle] as required for SGpianohinge % EEL: Extended Edge list of the kinematic chain [A-index B-index Frame-index] % Frame-index sign only required for wlim % CPLCA: Cell array of hinge connecting contour for contour-A % CPLCB: Cell array of hinge connecting contour for contour-AB % wlim: if used, the design steps are shown % === OUTPUT RESULTS ====== % SGR: Cell array of solids (no Frames) that are connected by thee EEL chain of % T-Frames % EEL: Extend Edge List % WLIM: angle limits for EEL % KC: Kinematic chain % % EXAMPLE: % [CPL,T,~,wlim,txt]=SGjointsample(1); close all; % Take an joint example % [CPLR,T,R,EEL,CPLCA,CPLCB,wlim]=CPLRinserthingelist(CPL,T,2,wlim,'both') % Create the contours % [SGR,EEL,WLIM]=SGofCPLRTzpianohinge(CPLR,10,T,R,EEL,CPLCA,CPLCB,wlim,'debug') % Create the Solids % SGpianohingeanimate(SGR,WLIM,EEL); % Animate % % See also: CPLRinserthingelist % % % Copyright 2026 Tim C. Lueth |
exp_2026_03_25_kinematic_analysis- EXPERIMENT TO TEST WHICH GRAPH methods ARE SUITABLE FOR KINEMATIC STRUTURE ANALYSIS |
| % exp_2026_03_25_kinematic_analysis - EXPERIMENT TO TEST WHICH GRAPH methods ARE SUITABLE FOR KINEMATIC STRUTURE ANALYSIS % (by Tim Lueth, SG-Lib, 2026-MÄR-25 as class: 4BAR/LINKAGES) % % USE CAREFULLY: exp_2026_03_25_kinematic_analysis was not being tested % extensively % % Introduced first in SolidGeometry 5.6 % % exp_2026_03_25_kinematic_analysis % % % Copyright 2026 Tim C. Lueth |
ELlongestpath(EEL)- returns a list of unique directed kinematic chains from an edge list |
| % ELlongestpath(EEL) - returns a list of unique directed kinematic chains from an edge list % (by Tim Lueth, SG-Lib, 2026-MÄR-24 as class: 4BAR/LINKAGES) % % USE CAREFULLY: ELlongestpath was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: permutevector, shortestpath % % PP=ELlongestpath(EEL) % === INPUT PARAMETERS === % EEL: Edge list, only the fist two cols are used % === OUTPUT RESULTS ====== % PP: cell list of point indices that create longest list % % EXAMPLE: % ELlongestpath(ELofn(10)) % % See also: permutevector, shortestpath % % % Copyright 2026 Tim C. Lueth |
SGjointsample(Nr)- returns Contours and cutting frames to test fnct such as CPSinserthinge, CPSinserthingelist, SGofCPLzpianohingelist |
| % SGjointsample(Nr) - returns Contours and cutting frames to test fnct such as CPSinserthinge, CPSinserthingelist, SGofCPLzpianohingelist % (by Tim Lueth, SG-Lib, 2026-MÄR-21 as class: SAMPLES) % % USE CAREFULLY: SGjointsample was not being tested extensively % % Who to create an example % 1) [SG,T,~,~,CPLO,wlim]=SGofCPLzpianohingelist( % 2) load SGjointsamples.mat % 3) SGjointsamples=[SGjointsamples;{CPLO,T,SG,wlim,' % 4) saveTL SGjointsamples (Status of: 2026-03-24) % % Introduced first in SolidGeometry 5.6 % % See also: CPSinserthinge, CPSinserthingelist, SGofCPLzpianohingelist % % [CPL,T,SG,wlim,txt]=SGjointsample([Nr]) % === INPUT PARAMETERS === % Nr: list of examples to be shown; if one is selected, it will be extruded an % animated; default is all % === OUTPUT RESULTS ====== % CPL: Contour % T: Frames to insert cuts % SG: Solid Geometry as Reference % wlim: [wmin wmax] % txt: description % % EXAMPLE: % Videoquickstart; SGjointsample(2); Videoquickcloseandopen % [CPL,T,~,wlim]=SGjointsample(2); SGofCPLzpianohingelist(CPL,20,T,5,pi/3) % Radius 2 Opening Angle pi/3 % [SG,T]=SGofCPLzpianohingelist(CPL,20,T,5,pi/1.5); SGpianohingeanimate(SG,[0 pi/1.5]) % % See also: CPSinserthinge, CPSinserthingelist, SGofCPLzpianohingelist % % % Copyright 2026 Tim C. Lueth |
Taplot(T,wint,s,c,N)- draws an anlge interval relative to a frame (3x3 or 4x4) |
| % Taplot(T,wint,s,c,N) - draws an anlge interval relative to a frame (3x3 or 4x4) % (by Tim Lueth, SG-Lib, 2026-MÄR-20 as class: KINEMATICS AND FRAMES) % % Introduced first in SolidGeometry 5.6 % % See also: tplot, aplot % % h=Taplot([T,wint,s,c,N]) % === INPUT PARAMETERS === % T: Frame or cell list of frames % wint: Angle interval % s: size (like sofgca*200) % c: color of the angle area % N: optional name of the frame % === OUTPUT RESULTS ====== % h: handle to graphics % % EXAMPLE: % SGfigure(0,90); Taplot(TofP([10 0 0],[0 0 pi/3]),[pi/2 pi]); shg % SGfigure(0,90); Taplot(TofP([10 0 0],[0 0 pi/3]),[pi/10 pi/1.5]); shg % % See also: tplot, aplot % % % Copyright 2026 Tim C. Lueth |
SGangleoverlapT(SG,T,R,wlim,zoff)- Finds out wether a solid is insied a rotating angle of a frame and a angle interval |
| % SGangleoverlapT(SG,T,R,wlim,zoff) - Finds out wether a solid is insied a rotating angle of a frame and a angle interval % (by Tim Lueth, SG-Lib, 2026-MÄR-20 as class: KINEMATICS AND FRAMES) % % USE CAREFULLY: SGangleoverlapT was not being tested extensively % % Required in SGofCPLzpianohingelist % (Status of: 2026-03-20) % % Introduced first in SolidGeometry 5.6 % % See also: angleinterv, angleintersect, SGisInterior, SGofCPLzpianohingelist % % [isolap,wlap,wint]=SGangleoverlapT([SG,T,R,wlim,zoff]) % === INPUT PARAMETERS === % SG: Solid Geometry % T: Frame ex defines the 0 axis for rotatation % R: Radus of join (geoemtric correct, not fitting adjustment inside % SGangleoverlapT) % wlim: angle interval; default is [0 2*pi] % zoff: optional height in z about T % === OUTPUT RESULTS ====== % isolap: true or false if the angle interval at T with radius R and height zoff % cuts the solid % wlap: complete overlap interval % wint: intersection of wlap and wlim % % EXAMPLE: % SGangleoverlapT(SGbox,TofP([20 0 0]),6) % % See also: angleinterv, angleintersect, SGisInterior, SGofCPLzpianohingelist % % % Copyright 2026 Tim C. Lueth |
SGpianohingeanimate(SG,wlim,ELX,"rewind")- Animates an ordered chain of solids relative to 'B' Base Frame and an angle limit |
| % SGpianohingeanimate(SG,wlim,ELX,"rewind") - Animates an ordered chain of solids relative to 'B' Base Frame and an angle limit % (by Tim Lueth, SG-Lib, 2026-MÄR-19 as class: KINEMATICS AND FRAMES) % % USE CAREFULLY: SGpianohingeanimate was not being tested extensively % % uses animatego and NOT Videoquickanimatego % % Use SGofCPLRTzpianohinge to create the kinematic chain and DO NOT USE % SGofCPLzpianohingelist anymore % (Status of: 2026-03-20) % % Introduced first in SolidGeometry 5.6 % % See also: animatego, SGofCPLzpianohingelist % % hh=SGpianohingeanimate(SG,[wlim,ELX,"rewind"]) % === INPUT PARAMETERS === % SG: cell list of Solids that are an ordered kinematik chain including 'B' Frames % wlim: angle limit; scalar or rows of angle limits % ELX: Extended edge list to describe the kinematic chain ["B"-index "F"-index % T-Frame-index] sign(T)=> -wlim % "rewind": if used, the links move forward and backwards % === OUTPUT RESULTS ====== % hh: handle to graphics objects % % EXAMPLE: % [SG,T]=SGofCPLzpianohingelist(PLcircle(20),20,[5 0; -5 0],'',[pi/1.5]); SGfigure(-30,30); SGpianohingeanimate(SG,pi/1.5) % [SG,T]=SGofCPLzpianohingelist(PLcircle(10),20,[8 0; -8 0; 0 8; 0 -8],'',[pi/2]); SGfigure(-30,30); SGpianohingeanimate(SG,pi/2,'rewind') % [SG,T]=SGofCPLzpianohingelist(PLcircle(10),20,[8 0; -8 0; 0 8; 0 -8; 0 -8; 0 0],'',[pi/2]); SGfigure(-30,30); SGpianohingeanimate(SG,pi/2) % [SG,T]=SGofCPLzpianohingelist(PLcircle(20),20,25*[1 0; -1 0; 0 1; 0 -1; 0 -1; 0 0],'',[pi/2]); SGfigure(-30,30); SGpianohingeanimate(SG,pi/2,'rewind') % % See also: animatego, SGofCPLzpianohingelist % % % Copyright 2026 Tim C. Lueth |
centerinsideCPL(CPL,cc)- HEURISTIC APPROACH: Finds in arbitrary contours the center point within a region |
| % centerinsideCPL(CPL,cc) - HEURISTIC APPROACH: Finds in arbitrary contours the center point within a region % (by Tim Lueth, SG-Lib, 2026-MÄR-18 as class: CPL/CLOSED POLYGON LISTS) % % USE CAREFULLY: centerinsideCPL was not being tested extensively % % In contrast to centerCPL that cannot guarantee that the center point is inside % the contour, this fnctn "centerinsideCPL" guarantee that the returned point or % the list of points is always inside the contour % % CPLsample(8) % CPLsample(34) % CPLsample(35) % (Status of: 2026-03-19) % % Introduced first in SolidGeometry 5.6 % % See also: centerCPL % % [M,PL]=centerinsideCPL(CPL,[cc]) % === INPUT PARAMETERS === % CPL: Contour to analyze % cc: default is 0.5 for middle of skeleton line % === OUTPUT RESULTS ====== % M: Center point % PL: Point list of last line % % EXAMPLE: % centerinsideCPL(CPLsample(8)) % centerinsideCPL(CPLsample(33)) % centerinsideCPL(CPLsample(34)) % centerinsideCPL(CPLsample(35)) % % See also: centerCPL % % % Copyright 2026 Tim C. Lueth |
CPLradialconcaveEdges(CPL,rrr)- concave edges in CPL based on polyshape and polybuffer |
| % CPLradialconcaveEdges(CPL,rrr) - concave edges in CPL based on polyshape and polybuffer % (by Tim Lueth, SG-Lib, 2026-MÄR-15 as class: CPL/CLOSED POLYGON LISTS) % % 2026-03-28 Individual regions and contours have to be treated individually to % avoid the filling of gaps and holes (Status of: 2026-03-15) % % Introduced first in SolidGeometry 5.6 % % See also: CPLradialEdges % % CPLN=CPLradialconcaveEdges(CPL,[rrr]) % === INPUT PARAMETERS === % CPL: CPL contour % rrr: radius for concave edges % === OUTPUT RESULTS ====== % CPLN: CPL Contour with radial concave edges % % EXAMPLE: % CPLradialconcaveEdges(CPLsample(34)*2,0.5); % Holes does still exist % CPLradialconcaveEdges(CPLsample(34)*2,1); % Holes dissapear % % See also: CPLradialEdges % % % Copyright 2026 Tim C. Lueth |
AImodelNameSet(LocalmodelName)- Changes the AI model used by default in chat |
| % AImodelNameSet(LocalmodelName) - Changes the AI model used by default in chat % (by Tim Lueth, SG-Lib, 2026-MÄR-15 as class: ARTIFICIAL INTELLIGENCE) % % Since the quality of the responses from GPT chat models (especially the % "latest" version) has declined, it is important to use stable models (within % "OpenAIrequest") for critical tasks; while these models are about 10 times % slower, they do not produce meaningless drivel. % Similarly, the quality of DeepL is deteriorating: The German sentence in the % brief fnctnal description % "Verändert das AI model das bei chat defaultmäßig verwendet wird" % is then: % "Does this change the AI model used by default in chat?" % instead of % "This feature changes the AI model used by default in chat" (Status of: % 2026-03-15) % % Introduced first in SolidGeometry 5.6 % % See also: openAIgetmodels, OpenAIrequest % % res=AImodelNameSet([LocalmodelName]) % === INPUT PARAMETERS === % LocalmodelName: Name of a local model, which is a subset of openAIgetmodels % (API) % === OUTPUT RESULTS ====== % res: Name of the current model, useful if called before changing it % % EXAMPLE: % AImodelNameSet % returns the current model % AImodelNameSet('gpt-5-2025-08-07') % sets a new model % % See also: openAIgetmodels, OpenAIrequest % % % Copyright 2026 Tim C. Lueth |
exp_2026_03_13_linkages(wlim,"debug","turn")- Experiment to design linkage-lever hinges that minimize the profile of the rotating lever and integrate part of the hinge into a solid body |
| % exp_2026_03_13_linkages(wlim,"debug","turn") - Experiment to design linkage-lever hinges that minimize the profile of the rotating lever and integrate part of the hinge into a solid body % (by Tim Lueth, SG-Lib, 2026-MÄR-13 as class: EXPERIMENTS) % % USE CAREFULLY: exp_2026_03_13_linkages was not being tested extensively % % This experiment investigates whether the link joint connectors and the cutouts % correspond to the orientations of the frames and to the joint angles. In % addition, the "flip" parameter was added to the fnctn "SGpianohinge". % % The angle values for the movements are always relative to the planar motion in % the x-y plane, with the x-axis serving as the origin. When solid geometry % designing, care must be taken to ensure that when using negative angles—for % example, [-π/2...π/2] instead of [0...π]— the joint frame must also be rotated % by 90 degrees so that the relative degree value is preserved. % % ATTENTION: If this is not taken into account, effects that are difficult to % explain to the user will occur, and a tedious debugging process will begin, % since some routines rely precisely on this relationship between angle intervals % and the frame to identify the stator/rotor or base and follower of a kinematic % chain. (Status of: 2026-03-15) % % Introduced first in SolidGeometry 5.6 % % See also: SGofCPLzpianohingelist % % exp_2026_03_13_linkages([wlim,"debug","turn"]) % === INPUT PARAMETERS === % wlim: [wmin wmax] % "debug": if used,everything is in debug mode % "turn": turn angle, for testing the frame coordinate systems % % See also: SGofCPLzpianohingelist % % % Copyright 2026 Tim C. Lueth |
SGofCPLzpianohingelist(CPL,H,T,RR,wlim,"STL","debug")- extrudes a solid from a contour and inserts a set of piano hinges |
| % SGofCPLzpianohingelist(CPL,H,T,RR,wlim,"STL","debug") - extrudes a solid from a contour and inserts a set of piano hinges % (by Tim Lueth, SG-Lib, 2026-MÄR-13 as class: 4BAR/LINKAGES) % % USE CAREFULLY: SGofCPLzpianohingelist was not being tested extensively % % ======================================================================= % OBSOLETE (2026-03-26) - USE 'SGofCPLRTzpianohinge' INSTEAD % ======================================================================= % % extracted from exp_2026_03_12_pianohingelist (Status of: 2026-03-26) % % Introduced first in SolidGeometry 5.6 % % See also: [ SGofCPLRTzpianohinge ] ; SGofCPLz, CPSinserthingelist, % SGanalyzeGroupParts % % [SGall,T,ELN]=SGofCPLzpianohingelist([CPL,H,T,RR,wlim,"STL","debug"]) % === INPUT PARAMETERS === % CPL: Contour to be extruded; default is a square % H: Height for CPLz; default is 40 % T: Cell list of frames or numerical scalar for number of joints; default is 1; % RR: default is [2 1.5 pi/4] % wlim: default is: [-pi/4 pi/4] % "STL": if used an STL-File is written if nargout==0; % "debug": if used the creation of the linkages are shown % === OUTPUT RESULTS ====== % SGall: cell list of individial solids created by SGanalyzeGroupParts % T: list of frames (interactive use) % ELN: Edge-Frame-List [Base-index Follower-index Frame-index] % % EXAMPLE: % SGofCPLzpianohingelist(PLcircle([30 25]),'',1) % SGofCPLzpianohingelist(PLcircle([30 25 10]),'',2 % SGofCPLzpianohingelist(CPLsample(34)*3,'',2) % SGofCPLzpianohingelist(PLcircle([30 25 10]),'',2) % clc; close all; [SG,T,ELN]=SGofCPLzpianohingelist(CPLsample(34)*4,10,2,1.5,[0 pi/2]); SGfigure; SGplotparts(SG); % % See also: [ SGofCPLRTzpianohinge ] ; SGofCPLz, CPSinserthingelist, % SGanalyzeGroupParts % % % Copyright 2026 Tim C. Lueth |
exp_2026_03_12_pianohingelist(T)- EXPERIMENT how to integrqte several piono hinges into an extruded contour |
| % exp_2026_03_12_pianohingelist(T) - EXPERIMENT how to integrqte several piono hinges into an extruded contour % (by Tim Lueth, SG-Lib, 2026-MÄR-12 as class: EXPERIMENTS) % % USE CAREFULLY: exp_2026_03_12_pianohingelist was not being tested extensively % % will become later "SGofCPLzpianohingelist" (Status of: 2026-03-13) % % Introduced first in SolidGeometry 5.6 % % See also: exp_2026_03_07_pianohinge % % T=exp_2026_03_12_pianohingelist([T]) % === INPUT PARAMETERS === % T: % === OUTPUT RESULTS ====== % T: % % See also: exp_2026_03_07_pianohinge % % % Copyright 2026 Tim C. Lueth |
angle2vect2D(ww,cp)- returns an angle or an angle interval into two unit vectors |
| % angle2vect2D(ww,cp) - returns an angle or an angle interval into two unit vectors % (by Tim Lueth, SG-Lib, 2026-MÄR-11 as class: KINEMATICS AND FRAMES) % % originally written for testing the interactive hinge procedures of % CPSinserthinge (Status of: 2026-03-11) % % Introduced first in SolidGeometry 5.6 % % See also: acos2, aplot, TLofProt, CPSinserthinge % % [v1,v2,T1,T2]=angle2vect2D([ww,cp]) % === INPUT PARAMETERS === % ww: angle or angle intervall; default is [0 pi/3]; or pi/3 % cp: center point or 3x3 Frame; default is [0 0]; % === OUTPUT RESULTS ====== % v1: unit vector of angle min length 1 = T1(1:2,1)') % v2: unit vector of angle max length 1 = T2(1:2,1)') % T1: 3x3frame wrt to cp and v1 % T2: 3x3frame wrt to cp and v1 % % EXAMPLE: % angle2vect2D([-pi/10 , pi/2.5],[10 10]); % cp=[10 10] % angle2vect2D([-pi/10 , pi/2.5],TofP([10 10],-pi/10)); % Tc=[10 10], ex rotated -pi/10 % % See also: acos2, aplot, TLofProt, CPSinserthinge % % % Copyright 2026 Tim C. Lueth |
CPSinserthingelist(CPL,T,R,wlim,"both","debug","close")- inserts a list of hinge geoemtries into a CPL/CPS. The first frame cuts, the following not |
| % CPSinserthingelist(CPL,T,R,wlim,"both","debug","close") - inserts a list of hinge geoemtries into a CPL/CPS. The first frame cuts, the following not % (by Tim Lueth, SG-Lib, 2026-MÄR-10 as class: 4BAR/LINKAGES) % % USE CAREFULLY: CPSinserthingelist was not being tested extensively % % "both" is helpful to avoid material reduction when there are steep angles % original version (2026-03-10) just created the cuts % improved version of 2026-03-23 also creates kinematic chain plus CPL plus % turing angles and connectors (Status of: 2026-03-26) % % Introduced first in SolidGeometry 5.6 % % See also: CPSinserthinge, SGofCPLzpianohingelist % % [T,CPLNA,CPLNB,CPLU,CPLCA,CPLCB,wlimA,wlimB,CPLX]=CPSinserthingelist([CPL,T,R,w % lim,"both","debug","close"]) % === INPUT PARAMETERS === % CPL: Contour in which the hinges are to be inserted % T: cell list of Frames. Empty Frames mean interactive selection, Numeric scalar % means n interactive frames % R: same as in SGcylhinge but only R(1) used % wlim: angle limit [amax] or [amin amax] with respect to the x axis of the frame % "both": if used instead of single substraction, both parts are equally reduced. % "debug": if used, the individal steps are shown % "close": if used, the contour finally is closed again (not implemented yet) % === OUTPUT RESULTS ====== % T: cell list of frames % CPLNA: cell list of moving contours wrt T{i} % CPLNB: cell list of static contours wrt T{i} % CPLU: cell list of independent contours wrt T{i} % CPLCA: connector contour for CPLNA to a piano hinge wrt T{i} % CPLCB: connector contour for CPLNB to a piano hinge wrt T{i} % wlimA: angle limitations of CPLCA, there is also wlimB, and CPLX % % EXAMPLE: % [CPL,T,SG,wlim,txt]=SGjointsample(1) % CPSinserthingelist(CPL,T(1:5),2,wlim) % % % See also: CPSinserthinge, SGofCPLzpianohingelist % % % Copyright 2026 Tim C. Lueth |
exp_2026_03_08_Nakashima(fFemur,fTibia)- EXPERIMENT for Dr. Shinsuke Nakashima to explain the use of the SGLib for 4Bar linkagr design of Tibiua/Femur |
| % exp_2026_03_08_Nakashima(fFemur,fTibia) - EXPERIMENT for Dr. Shinsuke Nakashima to explain the use of the SGLib for 4Bar linkagr design of Tibiua/Femur % (by Tim Lueth, SG-Lib, 2026-MÄR-08 as class: 4BAR/LINKAGES) % % USE CAREFULLY: exp_2026_03_08_Nakashima was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % PS=exp_2026_03_08_Nakashima([fFemur,fTibia]) % === INPUT PARAMETERS === % fFemur: filename for Femur STL % fTibia: filename for Tibia STL % === OUTPUT RESULTS ====== % PS: Pose struct for synthesis and animation % % % Copyright 2026 Tim C. Lueth |
CPLsubtractTLbs(CPL1,TL1,CPL2,TL2,buf,"both","debug")- subtract a moving contour from another moving contour, optionally cutting both contours equally |
| % CPLsubtractTLbs(CPL1,TL1,CPL2,TL2,buf,"both","debug") - subtract a moving contour from another moving contour, optionally cutting both contours equally % (by Tim Lueth, SG-Lib, 2026-MÄR-08 as class: KINEMATICS AND FRAMES) % % helpful for any piano mover problem % improved version of CPLsubtractTL of 2022 (Status of: 2026-03-19) % % Introduced first in SolidGeometry 5.6 % % See also: CPLsweepTL, CPLanimateTL, CPLunionTL, CPLsubtractTL % % [CPLN,CPLU]=CPLsubtractTLbs([CPL1,TL1,CPL2,TL2,buf,"both","debug"]) % === INPUT PARAMETERS === % CPL1: Contour to subtract from % TL1: path of contour 1 must have the same length of TL2 or 3x3 % CPL2: Contour to be subtracted % TL2: path of contour 2 must have the same length of TL1 or 3x3 % buf: buffer to increase CPL2 before start % "both": if used both contours are cut equally to achieve collision free % movements % "debug": if used the fnctn shows results stepwise % === OUTPUT RESULTS ====== % CPLN: New contour of CPL1 % CPLU: New contour of CPL2 if 'both' has been used % % EXAMPLE: % Posesample(10); PS=ans; % fourBarposesyntheses(Posesample(10),[2 3 4],[10 1 1]); PS=ans; % fourBarposeCPLmotion(PS,1); [PL0,TL0,wcr,TA1,TB1,TA0,TB0]=fourBarposeCPLmotion(PS,1); % CPLunionTL(PLcircle(5),TA1,PLsquare(5),TL0,2); CPLN=ans; % CPLsubtractTLbs(PLcircle(5),TA1,PLsquare(2),TL0,0.1,'debug'); CPLN=ans; shg; % CPLsubtractTLbs(PLcircle(5),TA1,PLsquare(2),TL0,0.1,'debug','both'); CPLN=ans; shg; % % See also: CPLsweepTL, CPLanimateTL, CPLunionTL, CPLsubtractTL % % % Copyright 2026 Tim C. Lueth |
exp_2026_03_07_pianohinge(T)- EXPERIMENT to cut a 2D contour arbitrarily with two mouse clicks (or an HT frame), insert a rotational joint, and then extrude it using a piano hinge. |
| % exp_2026_03_07_pianohinge(T) - EXPERIMENT to cut a 2D contour arbitrarily with two mouse clicks (or an HT frame), insert a rotational joint, and then extrude it using a piano hinge. % (by Tim Lueth, SG-Lib, 2026-MÄR-07 as class: 4BAR/LINKAGES) % % USE CAREFULLY: exp_2026_03_07_pianohinge was not being tested extensively % % Experiment to show the use of "CPSinserthinge" and "SGpianohinge" to create % mechanisms (Status of: 2026-03-08) % % Introduced first in SolidGeometry 5.6 % % See also: CPSinserthinge, SGpianohinge % % T=exp_2026_03_07_pianohinge([T]) % === INPUT PARAMETERS === % T: T frame for cutting the contour; default is empty (separate by mouse clicks) % === OUTPUT RESULTS ====== % T: Frames of mouse clicks % % See also: CPSinserthinge, SGpianohinge % % % Copyright 2026 Tim C. Lueth |
SGpianohinge(R,L,CPLG,CPLY,flip,"STL","debug","flip")- creates a piano-hinge style revolute joint and attaches predefined contours as link arms |
| % SGpianohinge(R,L,CPLG,CPLY,flip,"STL","debug","flip") - creates a piano-hinge style revolute joint and attaches predefined contours as link arms % (by Tim Lueth, SG-Lib, 2026-MÄR-07 as class: 4BAR/LINKAGES) % % In contrast to "SGcylhinge" this fnctn uses the generated contours of % CPSinserthinge to create the connectors of the hinge with the two attached % links. % Those contours are important and calucated using the clearance fit size (3D % printer dependent) and the remaining contour contact surfaces taking the % rotation angle into account. % More advanced that outdated SGcylhinge (Status of: 2026-03-14) % % Introduced first in SolidGeometry 5.6 % % See also: CPSinserthinge, slfit, SGcylhinge % % [SGall,SGUO]=SGpianohinge([R,L,CPLG,CPLY,flip,"STL","debug","flip"]) % === INPUT PARAMETERS === % R: [Radius Pin-height pin-angle]; default is [2 1.5 pi/4]; 1.2 ist the lower % limit for R(1) % L: [Hinge-length segment-number]; default is [40 4] % CPLG: Connection Contour for the rotating part at [0 0 ]; default is a % rectangle in y % CPLY: Connection Contour for the static part at [0 0 ]; default is a rectangle % in y % flip: if false, the 1st hinge element is fixed to the rotor, otherwise the % stator; default is false % "STL": if used, the hinge is written as STL % "debug": if used, the creation of the hinge is shown % "flip": if used, the parameter flip is preset, but can be overwritten % === OUTPUT RESULTS ====== % SGall: {SGtop,SGmiddle,SGbottom} % SGUO: {SGbottom,SGtop} % % EXAMPLE: % SGpianohinge; % [a,b]=SGpianohinge; SGfigure(-30,30); SGplotcell(a) % [a,b]=SGpianohinge('flip'); SGfigure(-30,30); SGplotcell(a) % [a,b]=SGpianohinge; dbplot(b) % % See also: CPSinserthinge, slfit, SGcylhinge % % % Copyright 2026 Tim C. Lueth |
TLofProt(P,wlim,n)- creates a list of frames for rotations around point |
| % TLofProt(P,wlim,n) - creates a list of frames for rotations around point % (by Tim Lueth, SG-Lib, 2026-MÄR-06 as class: KINEMATICS AND FRAMES) % % Don't use aplot for this purpose (Status of: 2026-03-11) % % Introduced first in SolidGeometry 5.6 % % See also: TLofPL, TLofn % % [TL,PLa]=TLofProt([P,wlim,n]) % === INPUT PARAMETERS === % P: Point [x y]; default is [0 0]; or frames % wlim: [wmin wmax]; default is [0 pi] % n: number of frames; default is n=120 % === OUTPUT RESULTS ====== % TL: page list of Frames [3x3xn] or [4x4xn] % PLa: contour for future use % % EXAMPLE: % TLofProt([500 500],[pi/4 pi*1.1]); % TLofProt('',[-pi/10 , pi/1.5]); % TLofProt([300 200],[-pi/10 , pi/1.5]); % TLofProt(TofP([500 500],-pi/3),[-pi/4 pi*1.1]); % TLofProt(TofP([500 500],-pi/10),[-pi/4 pi/4]); % TLofProt(TofP([500 500],-pi/10),[-pi/2 +pi/4]); % % See also: TLofPL, TLofn % % % Copyright 2026 Tim C. Lueth |
CPSinserthinge(CPL,T,R,wlim,"debug","nocut")- 1st solution to integrate revolut joints into CPL/CPS tp be extruded later to SG |
| % CPSinserthinge(CPL,T,R,wlim,"debug","nocut") - 1st solution to integrate revolut joints into CPL/CPS tp be extruded later to SG % (by Tim Lueth, SG-Lib, 2026-MÄR-05 as class: 4BAR/LINKAGES) % % Introduced first in SolidGeometry 5.6 % % See also: CPLofPLcrossCPL, SGcylhinge, SGpipeclamp % % [T,CPLNA,CPLNB,CPLU,CPLCA,CPLCB,wlimA,wlimB,CPLX]=CPSinserthinge([CPL,T,R,wlim, % "debug","nocut"]) % === INPUT PARAMETERS === % CPL: Contour to be separated and supported by a joint % T: Frame to cut along the x-axis or interactive 2 point selection % R: same as in SGcylhinge % wlim: limitation for movement (angle for CPLNA and CPLNB); default is pi/2 % "debug": if used touching faces become linear but rough 'just for testing' % "nocut": if used, the relative movement during subtraction is shown % === OUTPUT RESULTS ====== % T: Frame to insert a piano hinge (SGcylhinge) % CPLNA: Contour of moving part % CPLNB: Contour of static part % CPLU: Contours that are not part of the movement % CPLCA: Contour for the hinge connector to CPLA % CPLCB: Contour for the Hinge connector to CPLB % wlimA: Frame that shows into the direction of the center of CPLCA % % EXAMPLE: % CPSinserthinge(CPLsample(12),TofP([-5 0])) % CPSinserthinge(CPLsample(8),TofP([-8 0])); % CPSinserthinge([PLsquare(40);nan nan;PLsquare(50)],'',2.5,pi/1.5); T=ans; CPSinserthinge([PLsquare(40);nan nan;PLsquare(50)],T,2.5,pi/1.5,'debug'); % % See also: CPLofPLcrossCPL, SGcylhinge, SGpipeclamp % % % Copyright 2026 Tim C. Lueth |
sendemailTUM(to,subject,body,from,pass,"nosend")- sends an email using curl via TUM LRZ SMTP postout.lrz.de:587 |
| % sendemailTUM(to,subject,body,from,pass,"nosend") - sends an email using curl via TUM LRZ SMTP postout.lrz.de:587 % (by Tim Lueth, SG-Lib, 2026-MÄR-05 as class: CODING/DEVELOP) % % sucessfully tested on barcelona mac using VPN tunnel % Much simpler than the JAVAemail class % integrated into productcode to send the codes (Status of: 2026-03-05) % % Introduced first in SolidGeometry 5.6 % % See also: JAVAemailServerImap, JAVAemailTUMimap, JAVAemailmsg2cell, % JAVAemailreadtextmessage % % [status,result]=sendemailTUM([to,subject,body,from,pass,"nosend"]) % === INPUT PARAMETERS === % to: email receiver address % subject: email subject % body: email body % from: email sender address (such as xxxx@mytum.de) % pass: passwort of sender address % "nosend": if used the email is not send, but the curl command is prompted % === OUTPUT RESULTS ====== % status: status of curl % % result: result of curl % % EXAMPLE: % sendemailTUM('tim.lueth@me.com','TEstzeile von TUM','Ich möchte gerne mehr productcodes senden'); % [a,b]=sendemailTUM('tim.lueth@me.com','TEstzeile von TUM','Ich möchte gerne mehr productcodes senden') % % See also: JAVAemailServerImap, JAVAemailTUMimap, JAVAemailmsg2cell, % JAVAemailreadtextmessage % % % Copyright 2026 Tim C. Lueth |
PosesolutionofA0B0A1B1(A0,B0,A1,B1,Tref)- returns a Pose Struct similar to a fourbar synthesis solution simply from fixed Values |
| % PosesolutionofA0B0A1B1(A0,B0,A1,B1,Tref) - returns a Pose Struct similar to a fourbar synthesis solution simply from fixed Values % (by Tim Lueth, SG-Lib, 2026-MÄR-03 as class: 4BAR/LINKAGES) % % The minimal Pose struct as result of an synthesis process contains % Single Pose: PS.A PS.B, % Four Joints: PS.A0, PS.B0, PS.A1, PS.B1, % Coupler GPL: GLPA[0 0] relative to A1 and GPLB=[0 0] relative to B1 % PS.solut : =[A0 B0 A1 B1 GPLA GPLB wlim ord=0] as single line % Inside fnctns are used: % [l1,l2,r,eb]=L1L2RofBasenAttachmentpoints(A0,B0,A1,B1); % From Joint % coordinates to robot description % wlim,segA1,wA1]=checkfourbarsegment(l1,l2,r,[A0;B0],A1,'','','','silent'); % % Analzye angle segments % PS.solut=[A0 B0 A1 B1 GPLA=A1 GPLB=B1 wmin wmax]; % Afterwards it is quite simple to create additional Pose Ai Bi % PS.CPLE, PS.CPLB, PS.CPLS, PS.CPLC % % % % (Status of: 2026-03-06) % % Introduced first in SolidGeometry 5.6 % % See also: L1L2RofBasenAttachmentpoints % % PS=PosesolutionofA0B0A1B1(A0,B0,A1,B1,Tref) % === INPUT PARAMETERS === % A0: Base point A0 % B0: Base point B0 % A1: Coupler point A1 % B1: Coupler point B1 % Tref: Pose reference in this configuration % === OUTPUT RESULTS ====== % PS: PS containing 1 Pose, four joints, relative points to define center % % EXAMPLE: % PosesolutionofA0B0A1B1([-150 0], [-100 100], [-50 100], [0 0], TofP([-100 150])); PS=ans % PosesolutionofA0B0A1B1([-150 0], [-100 100], [0 0], [-50 100], TofP([-100 150])); PS=ans % PosesolutionofA0B0A1B1([-150 0], [-100 100], [-50 100], [0 0], TofP([-100 50])); PS=ans % PosesolutionofA0B0A1B1([-150 0], [-100 100], [0 0], [-50 100], TofP([-100 50])); PS=ans % % PosesolutionofA0B0A1B1([-150 0],[0 0], [-100 100], [-50 100], TofP([-100 50])); PS=ans % % See also: L1L2RofBasenAttachmentpoints % % % Copyright 2026 Tim C. Lueth |
CPLouterboundaries(CPL)- All overlapping outer boundary contour of a CPL |
| % CPLouterboundaries(CPL) - All overlapping outer boundary contour of a CPL % (by Tim Lueth, SG-Lib, 2026-FEB-26 as class: CPL/CLOSED POLYGON LISTS) % % CPLouterboundaries is nothing else than CPLselectinout(CPL,0) % If no overlapping CPLS are desired, use % CPLunitesorted(CPLouterboundaries(CPL)) (Status of: 2026-02-26) % % Introduced first in SolidGeometry 5.6 % % See also: CPSouterboundary, CPLselectinout, CPLunitesorted % % CPLN=CPLouterboundaries(CPL) % === INPUT PARAMETERS === % CPL: Original Contour % === OUTPUT RESULTS ====== % CPLN: Outer Boundary % % EXAMPLE: % CPLouterboundaries(CPLsample(11)); % returns two contour % CPLsimplify(CPLouterboundaries(CPLsample(11))) % separate % CPLconvexhull(CPLouterboundaries(CPLsample(11))) % separates convex hull % CPLunitesorted(CPLouterboundaries(CPLsample(11)));% returns one single outer boundary % % See also: CPSouterboundary, CPLselectinout, CPLunitesorted % % % Copyright 2026 Tim C. Lueth |
LPSjointmatrix(LPS,thr)- returns a matrix of revolute joints |
| % LPSjointmatrix(LPS,thr) - returns a matrix of revolute joints % (by Tim Lueth, SG-Lib, 2026-FEB-24 as class: 4BAR/LINKAGES) % % IPL format = | contour index | hole index | hole x | hole y | joint index % (Status of: 2026-03-03) % % Introduced first in SolidGeometry 5.6 % % See also: LPSjointmatrix, LPSconnect % % [IPD,IPL]=LPSjointmatrix(LPS,[thr]) % === INPUT PARAMETERS === % LPS: Linkage polygon structure % thr: threshold for linage overlap % === OUTPUT RESULTS ====== % IPD: index point list (doubles only) % IPL: index point list (complete) % % See also: LPSjointmatrix, LPSconnect % % % Copyright 2026 Tim C. Lueth |
LPSanimate(LPS,ORD)- animation of a Linkage Polygon structure after interactive definition of the order |
| % LPSanimate(LPS,ORD) - animation of a Linkage Polygon structure after interactive definition of the order % (by Tim Lueth, SG-Lib, 2026-FEB-24 as class: 4BAR/LINKAGES) % % USE CAREFULLY: LPSanimate was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: selectLPSui, LPSconnect, LPSsupplementsubtract, LPSjointmatrix % % [PS,CC]=LPSanimate([LPS,ORD]) % === INPUT PARAMETERS === % LPS: Linkage Polygon structure % ORD: optional known order of the CPLs in LPS % === OUTPUT RESULTS ====== % PS: Connection Matrix, same format as LPSconnect % CC: % % EXAMPLE: % exp_2026_02_23_ReverseEng; LPS=ans; % LPSpunchholesui(LPS);LPS=ans; % LPSanimate(LPS) % % See also: selectLPSui, LPSconnect, LPSsupplementsubtract, LPSjointmatrix % % % Copyright 2026 Tim C. Lueth |
LPSconnect(LPS,SI,EI)- searches for a connection between two links using LPSjointmatrix |
| % LPSconnect(LPS,SI,EI) - searches for a connection between two links using LPSjointmatrix % (by Tim Lueth, SG-Lib, 2026-FEB-24) % % Introduced first in SolidGeometry 5.6 % % See also: LPSjointmatrix % % CC=LPSconnect([LPS,SI,EI]) % === INPUT PARAMETERS === % LPS: Linkage polygon structure % SI: Start index in LPS % EI: End index in LPS % === OUTPUT RESULTS ====== % CC: CC=[connection-number | Link1-index | Link1-hole-index | Link2-index | % Link2-hole-index] % % EXAMPLE: % LPSconnect(LPS,1, 2) % % See also: LPSjointmatrix % % % Copyright 2026 Tim C. Lueth |
videoquickmovecursor(p,n)- fnct to move an curson symbol on the currect axes to a specified point |
| % videoquickmovecursor(p,n) - fnct to move an curson symbol on the currect axes to a specified point % (by Tim Lueth, SG-Lib, 2026-FEB-23 as class: VIDEO/AUDIO/PDF) % % Used to record mouseclicks with ginput within videos used with videoquick ..... % (Status of: 2026-02-25) % % Introduced first in SolidGeometry 5.6 % % See also: drawnowvid, Videoquickstart, Videoquickcloseandopen % % videoquickmovecursor(p,[n]) % === INPUT PARAMETERS === % p: point coordinates % n: number of frames in drawnowvid; default is 20 (1 second) % % See also: drawnowvid, Videoquickstart, Videoquickcloseandopen % % % Copyright 2026 Tim C. Lueth |
LPSpunchholesui(LPS,RRio)- EXPERIMENT for testing LPSofgca amd LPSplot |
| % LPSpunchholesui(LPS,RRio) - EXPERIMENT for testing LPSofgca amd LPSplot % (by Tim Lueth, SG-Lib, 2026-FEB-22 as class: 4BAR/LINKAGES) % % Introduced first in SolidGeometry 5.6 % % See also: LPSplot, LPSofgca, selectLPSui % % LPS=LPSpunchholesui([LPS,RRio]) % === INPUT PARAMETERS === % LPS: Linkage polygon structure or handle to gca % RRio: Bore hole radius; default is [2 Nan] % === OUTPUT RESULTS ====== % LPS: Linkage polygon structure % % See also: LPSplot, LPSofgca, selectLPSui % % % Copyright 2026 Tim C. Lueth |
selectLPSui(LPS,typ)- selects interactively Frames or Frame connections from a lingage Polygon Struct |
| % selectLPSui(LPS,typ) - selects interactively Frames or Frame connections from a lingage Polygon Struct % (by Tim Lueth, SG-Lib, 2026-FEB-22 as class: 4BAR/LINKAGES) % % Attention this fnctn does not return a LPS but a linkage list % "FRAME" returns all Elements and Holes that corespond to ONE SINGLE hole % "LINK" returns all Elements and Holes that corespond to TWO SEPARATED holes % (Status of: 2026-02-23) % % Introduced first in SolidGeometry 5.6 % % See also: LPSplot, LPSofgca % % LL=selectLPSui([LPS,typ]) % === INPUT PARAMETERS === % LPS: Linkage Polygon Structure or handle to graphics containing LPS % typ: "Frame", "Link" % === OUTPUT RESULTS ====== % LL: {LPS element row index | name of Element | Hole index | Distance to point | % Name of Hole | Frame} % % EXAMPLE: % LPSsample(1); LPS=ans; % LPSpunchholesui(LPS);LPS=ans; % selectLPSui(LPS,'LINK') % LPS=LPSofgca % LPSanimate(LPS,[3 1 2 4]) % % See also: LPSplot, LPSofgca % % % Copyright 2026 Tim C. Lueth |
BBofLPS(LPS)- returns the Bounding box of a Linkage Polyshape struct |
| % BBofLPS(LPS) - returns the Bounding box of a Linkage Polyshape struct % (by Tim Lueth, SG-Lib, 2026-FEB-22 as class: 4BAR/LINKAGES) % % Introduced first in SolidGeometry 5.6 % % See also: BBofCPL, BBofVL, BBofSG, BBofCPS, BBofPS, BBofSGcutT % % [bb,CPL]=BBofLPS(LPS) % === INPUT PARAMETERS === % LPS: Linkage Polyshape struct % === OUTPUT RESULTS ====== % bb: bounding box % CPL: CPLincluding all CPLs of LPS % % EXAMPLE: % SGfigure; CPSplot([PLsquare(10);nan nan;PLcircle(1)+[1 1]]); % LPS=LPSofgca; % BBofLPS(CLP) % % See also: BBofCPL, BBofVL, BBofSG, BBofCPS, BBofPS, BBofSGcutT % % % Copyright 2026 Tim C. Lueth |
CPLofLPS(LPS,nn,res)- returns unsorted the CPLs of a LPS |
| % CPLofLPS(LPS,nn,res) - returns unsorted the CPLs of a LPS % (by Tim Lueth, SG-Lib, 2026-FEB-22 as class: 4BAR/LINKAGES) % % slow fnctn (Status of: 2026-02-22) % % Introduced first in SolidGeometry 5.6 % % See also: LPSplot, BBofLPS, LPSofgca % % CPL=CPLofLPS(LPS,[nn,res]) % === INPUT PARAMETERS === % LPS: Linkage Polyshape % nn: selected Polygons; default is 1:size(LPS,1) % res: resultion für CPL; default is 0.025mm % === OUTPUT RESULTS ====== % CPL: CLPs of an LPS % % EXAMPLE: % SGfigure; CPSplot([PLsquare(10);nan nan;PLcircle(1)+[1 1]]); % LPS=LPSofgca; % CPLofLPS(LPS) % CPLofLPS(LPS,2) % % See also: LPSplot, BBofLPS, LPSofgca % % % Copyright 2026 Tim C. Lueth |
LPSplot(LPS)- plots a linkage polyshape struct |
| % LPSplot(LPS) - plots a linkage polyshape struct % (by Tim Lueth, SG-Lib, 2026-FEB-22 as class: 4BAR/LINKAGES) % % Introduced first in SolidGeometry 5.6 % % See also: LPSofgca % % h=LPSplot(LPS) % === INPUT PARAMETERS === % LPS: Linkage Poly Shape % === OUTPUT RESULTS ====== % h: handle to graphics % % EXAMPLE: % SGfigure; CPSplot([PLsquare(10);nan nan;PLcircle(1)+[1 1]]); % LPS=LPSofgca; % LPSplot(LPS); % % % See also: LPSofgca % % % Copyright 2026 Tim C. Lueth |
LPSofgca(h)- Defines a new SG-Lib class LPS Linkage Polyshape and loads it from the gca polygons |
| % LPSofgca(h) - Defines a new SG-Lib class LPS Linkage Polyshape and loads it from the gca polygons % (by Tim Lueth, SG-Lib, 2026-FEB-22 as class: 4BAR/LINKAGES) % % LPS=cell(nn,7); %% It is for purpose not a struct! % 1 => handle to graphics % 2 => Name of Polygon % 3 => CPL Contour or may be later % 4 => col color of polygon % 5 => Tref | Reference Frame % 6 => cell of Framenames | Names of the holes/axis of LPS % 7 => cell of Frames | HT matrixes of the holes/axis of LPS % 8 => Cell of Inner out Radius of the holes/axis of LPS % % (Status of: 2026-02-22) % % Introduced first in SolidGeometry 5.6 % % See also: LPSplot % % LPS=LPSofgca([h]) % === INPUT PARAMETERS === % h: handle to axis; default is gca % === OUTPUT RESULTS ====== % LPS: Linkage polyshape of plot(h) % % EXAMPLE: D1=22; % dx=2; % D2=D1-dx % D3=D2-dx % PLA=PLsquare(D1,30,[-dx/2 +dx/2]); % PLB=PLsquare(D2,25,[-dx/2 +dx/2]); % PLC=PLsquare(D3,20,[-dx/2 +dx/2]); % PLB=CPLtransrelCPL(PLB,PLA,'ontop',-dx); % PLC=CPLtransrelCPL(PLC,PLB,'ontop',-dx); % SGfigure; % CPSplot(PLA,'r'); % CPSplot(PLB,'b'); % CPSplot(PLC,'g'); % LPSofgca % % See also: LPSplot % % % Copyright 2026 Tim C. Lueth |
CPLlinspace(CPL,n,all)- sets the number of points of each embedded contour of a CPL to n linspace points |
| % CPLlinspace(CPL,n,all) - sets the number of points of each embedded contour of a CPL to n linspace points % (by Tim Lueth, SG-Lib, 2026-FEB-19 as class: CPL/CLOSED POLYGON LISTS) % % much faster than CPLremdensity or CPLremauxpoints (Status of: 2026-02-19) % % Introduced first in SolidGeometry 5.6 % % See also: CPLremauxpoints, CPLremdensity % % CPLN=CPLlinspace(CPL,[n,all]) % === INPUT PARAMETERS === % CPL: CPL with enclosed CPLs % n: number of points per contour; default is n % all: if true; also contours with less than n points are processed; default is % false % === OUTPUT RESULTS ====== % CPLN: New CPL with n points per contour % % EXAMPLE: % CPLsample(37); CPL=ans; % CPLlinspace(CPL,100); % CPLlinspace(CPL,100,true); % create colinear points anyway % % See also: CPLremauxpoints, CPLremdensity % % % Copyright 2026 Tim C. Lueth |
PoseofPoseui(PS)- allows the interactive move of poses of contours that exist already in a Pose struct |
| % PoseofPoseui(PS) - allows the interactive move of poses of contours that exist already in a Pose struct % (by Tim Lueth, SG-Lib, 2026-FEB-19 as class: 4BAR/LINKAGES) % % In 2026, the fnctn PoseofCPLui was extended that it is able also to handle % Posestructs (PS) that contains already CPLE, CPLM, CPLW, CPLB and Poses in A % and B. % % Nevertheless "Posetransui" does more than just this fnctn! (Status of: % 2026-02-19) % % Introduced first in SolidGeometry 5.6 % % See also: Poseofimageui, Poseorderchange, Posetransui, PoseofCPLui, % Poseorderchange % % PS=PoseofPoseui([PS]) % === INPUT PARAMETERS === % PS: Pose Struct include A, B, CPLE, CPLB, CPLW % === OUTPUT RESULTS ====== % PS: Pose Struct include A, B, CPLE, CPLB, CPLW % % EXAMPLE: % PS=Posesample(31); % Human finger linkage % PoseofPoseui(PS); PSM=ans; % Simply allow to move and rotate poses by moving effektor CPLE % Posetransui(PS); PSN=ans; % % See also: Poseofimageui, Poseorderchange, Posetransui, PoseofCPLui, % Poseorderchange % % % Copyright 2026 Tim C. Lueth |
epo- just opens European Patent Office Login Page |
| % epo - just opens European Patent Office Login Page % (by Tim Lueth, SG-Lib, 2026-JAN-08 as class: CODING/DEVELOP) % % Introduced first in SolidGeometry 5.6 % % See also: epo, googlePatentSearch, googlePatentDownload % % epo % % See also: epo, googlePatentSearch, googlePatentDownload % % % Copyright 2026 Tim C. Lueth |
googlePatentSearch(keywords)- fnct opens browser with google patent page searches for patents and downloads patentlist as cvs |
| % googlePatentSearch(keywords) - fnct opens browser with google patent page searches for patents and downloads patentlist as cvs % (by Tim Lueth, SG-Lib, 2026-JAN-07 as class: CODING/DEVELOP) % % USE CAREFULLY: googlePatentSearch was not being tested extensively % % Because webread and urlread do not work with Google URLs in MATLAB, the % following strategy is used here. The download command is used, and the CSV file % is then loaded and processed. (Status of: 2026-01-07) % % Introduced first in SolidGeometry 5.6 % % See also: googleScholarSearch % % [data,fname]=googlePatentSearch([keywords]) % === INPUT PARAMETERS === % keywords: keywords for AND search % === OUTPUT RESULTS ====== % data: data table with the results % fname: file name that corresponds to the last search in the download directory % % EXAMPLE: % googlePatentSearch "Tim Lueth" "Juergen Bier" % % See also: googleScholarSearch % % % Copyright 2026 Tim C. Lueth |
chatscienceclozetext(clozetext)- Chat fnct to supplement scientific cloze texts |
| % chatscienceclozetext(clozetext) - Chat fnct to supplement scientific cloze texts % (by Tim Lueth, SG-Lib, 2026-JAN-05 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: chatscienceclozetext was not being tested extensively % % This chat fnctn takes a scientific text with gaps that contains a logical chain % but no quantitative statements and fills in these gaps with the missing % numerical values using openAI so that the statement can be considered % scientifically proven information. (Status of: 2026-01-07) % % Introduced first in SolidGeometry 5.6 % % See also: chat % % resp=chatscienceclozetext([clozetext]) % === INPUT PARAMETERS === % clozetext: scientific cloze text % === OUTPUT RESULTS ====== % resp: response with completed cloze text % % EXAMPLE: % xx='Amerika hat in den letzten 40 Jahren seine Bevölkerung ver-xxxfacht (Quelle: yyy). und dies hat den folgenden Grund' % yy='Ein Vollholzbalken aus Fichte der läne 1000mm mit einem Querschnitt con 200mm x 200mm hat eine Bruchlast von xxkg bei einer Restrisikowahrscheinlichkeit von 1e-6' % zz= 'Damit ein Elektrofahrzeug mit einem Elektromotor mit 6000U/min Leerlaufdrehzahl mit eine Strecke von 1km in 1 Minute zurücklegen kann braucht es einen Raddurchmesser von $X cm und einen übersetung von %YY:1' % uu='Steigt innerhalb von 50 Jahren die Lebenserwartung von 70 Jahren auf 80 Jahren führt dies zu einem Bevölkerungszuwachs von x prozent bei ausgegelichen Geburten/Sterberaten' % % chatscienceclozetext @zz; % chatscienceclozetext(uu); % % See also: chat % % % Copyright 2026 Tim C. Lueth |
FMinsertSQLcmd(xxx)- inserts an additional dataset into a FM's database's table |
| % FMinsertSQLcmd(xxx) - inserts an additional dataset into a FM's database's table % (by Tim Lueth, SG-Lib, 2026-JAN-03 as class: FILEMAKER) % % USE CAREFULLY: FMinsertSQLcmd was not being tested extensively % % FMinsertSQLcmd {'Protokolleingabe','Dies ist ein simple Test','Rec. % Nr.',3900,'Erstellungsdatum','DATE 01.01.2028','Erstellungszeit','10:20:30'} % (Status of: 2026-01-03) % % Introduced first in SolidGeometry 5.6 % % See also: FMselectSQLcmd, FMopen, FMclose % % inscmd=FMinsertSQLcmd([xxx]) % === INPUT PARAMETERS === % xxx: curly bracket term {'Fieldname 1',value1,'Fieldname 2',value2, ...} % === OUTPUT RESULTS ====== % inscmd: SQL Command in which the term $$FMTABNAM$$ must be replaced by the % table name of the database % % EXAMPLE: % FMdatabase='/Volumes/PLATTE LUETH ALL/Institut/Familie Lueth/Datenbank.fmp12'; % conn=FMopen(FMdatabase,username,password); % FMtablename='Yourtablename'; % scomm=strrep(FMinsertSQLcmd(varargin{:}),'$$FMTABNAM$$',FMtablename) % % curs=exec(conn,scomm); % %% ERROR HANDLING % if ~isempty(curs.Message) % % dbsave(curs) % error(curs.Message) % end % % See also: FMselectSQLcmd, FMopen, FMclose % % % Copyright 2026 Tim C. Lueth |
FMselectSQLcmd(FMselectfield,FMselectwords,FMgetfield,"OR","AND")- returns a SQL string for a database request in a intuitive order and syntax |
| % FMselectSQLcmd(FMselectfield,FMselectwords,FMgetfield,"OR","AND") - returns a SQL string for a database request in a intuitive order and syntax % (by Tim Lueth, SG-Lib, 2026-JAN-03 as class: FILEMAKER) % % USE CAREFULLY: FMselectSQLcmd was not being tested extensively % % FMselectSQLcmd Protokolleingabe MIMED % FMselectSQLcmd Protokolleingabe {'MIMED', 'Lueth'} % FMselectSQLcmd {'Protokolleingabe','Erstellungsdatum'} {'MIMED', '>1.1.2010'} % FMselectSQLcmd {'Protokolleingabe','Rec. Nr.'} {'MIMED', '>=1000'} 'Rec. Nr.' % FMselectSQLcmd {'Protokolleingabe','Rec. Nr.'} {'MIMED', '>=1000'} % {'Erstellungsdatum','Protokolleingabe'} % (Status of: 2026-01-03) % % Introduced first in SolidGeometry 5.6 % % See also: FMopen, FMsqlQuery % % SQLcmd=FMselectSQLcmd([FMselectfield,FMselectwords,FMgetfield,"OR","AND"]) % === INPUT PARAMETERS === % FMselectfield: Single Search Field name or a list of fields in curly brackets % FMselectwords: search term conditions name or a list in curly brackets % FMgetfield: Single return field; or a list of fields in curly brackets; default % is FMselectfield % "OR": if used, multiple conditions are connected by OR % "AND": if used, multiple conditions are connected by AND; default % === OUTPUT RESULTS ====== % SQLcmd: SQL Command in which the term $$FMTABNAM$$ must be replaced by the % table name of the database % % EXAMPLE: % FMdatabase='/Volumes/PLATTE LUETH ALL/Institut/Familie Lueth/Datenbank.fmp12'; % conn=FMopen(FMdatabase,username,password); % FMtablename='Yourtablename'; % scomm=strrep(FMselectSQLcmd(varargin{:}),'$$FMTABNAM$$',FMtablename) % % [txtinFM,curs]=FMsqlQuery(conn,scomm); % %% ERROR HANDLING % if ~isempty(curs.Message) % % dbsave(curs) % error(curs.Message) % end % % % % See also: FMopen, FMsqlQuery % % % Copyright 2026 Tim C. Lueth |
dbprintchar(m)- similar to an ancient hex editor, this fnct plots codes and chars of a string or char array |
| % dbprintchar(m) - similar to an ancient hex editor, this fnct plots codes and chars of a string or char array % (by Tim Lueth, SG-Lib, 2025-DEZ-25 as class: TEXT/STRS/CHARS/LINKS) % % USE CAREFULLY: dbprintchar was not being tested extensively % % Until R2016 a "char array" was named and considered as "string". Now it is % different and it is often unclear what is a result. In combination with hte % problems with LATIN1, UTF-8, UTF16, and some chars such as a hypen that exist % as ascii 45 and also as UTF-8 8211 but is NOT converted by % native2unicode(cc,'latin1'), makes it problematic. This fnctn clarifies a % little % (Status of: 2025-12-27) % % Introduced first in SolidGeometry 5.6 % % See also: latin1ofUTF % % dbprintchar(m) % === INPUT PARAMETERS === % m: string or char array % % EXAMPLE: % code16=unicode2native('-Lüth-','UTF-16'); str16=char(code16), dbprintchar(str16), dbprintchar(latin1ofUTF(code16)) % % See also: latin1ofUTF % % % Copyright 2025 Tim C. Lueth |
numelbytes(m)- returns the number of bytes a variable allocates |
| % numelbytes(m) - returns the number of bytes a variable allocates % (by Tim Lueth, SG-Lib, 2025-DEZ-25 as class: TEXT/STRS/CHARS/LINKS) % % bytes = whos('m').bytes - use also class to detect the call type and - % unicode2native('Lüth', 'latin1') % Since R2016b, chars are now 16 bit not a bit elements. Since R2024a it is % getting more an more problematic to distinguish between chars and strings. % numel('test')=4 % numel("test")=1 % class('test')='char' % class("test")='string' % but more problematic if useed in brackets, since the concatenation of chars and % strings is different AND it is absolutely unclear wether a fnctn returns a char % or string. In addition with java strings is getting more complex (Status of: % 2025-12-27) % % Introduced first in SolidGeometry 5.6 % % See also: numel, unicode2native, latin1ofUTF % % bytes=numelbytes(m) % === INPUT PARAMETERS === % m: variable % === OUTPUT RESULTS ====== % bytes: number of bytes allocated % % EXAMPLE: % numelbytes('test') % 8 Bytes % numelbytes("test") % 164 Bytes % % See also: numel, unicode2native, latin1ofUTF % % % Copyright 2025 Tim C. Lueth |
proxyTL(name)- sets proxy values to access API services trough the TUM proxy |
| % proxyTL(name) - sets proxy values to access API services trough the TUM proxy % (by Tim Lueth, SG-Lib, 2025-DEZ-18 as class: CODING/DEVELOP) % % USE CAREFULLY: proxyTL was not being tested extensively % % be carefull can corrupt the complete web interface from matlab. % use 'reset' (Status of: 2026-01-28) % % Introduced first in SolidGeometry 5.6 % % proxyTL([name]) % === INPUT PARAMETERS === % name: % % % Copyright 2025-2026 Tim C. Lueth |
TIMSRESEARCH(KW,"web","video","force")- creates web page content from a resesrch milestone diary |
| % TIMSRESEARCH(KW,"web","video","force") - creates web page content from a resesrch milestone diary % (by Tim Lueth, SG-Lib, 2025-DEZ-14 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: TIMSRESEARCH was not being tested extensively % % Similar to TIMSREPORTS (Status of: 2025-12-27) % % Introduced first in SolidGeometry 5.6 % % See also: TIMSREPORTS % % resp=TIMSRESEARCH([KW,"web","video","force"]) % === INPUT PARAMETERS === % KW: list of key words % "web": an existing report should be converted into html % "video": an existing report should be converted into a video (batch) % "force": a new report is enforced % === OUTPUT RESULTS ====== % resp: text response % % EXAMPLE: % TIMSRESEARCH % opens the text file % TIMSRESEARCH Keyword % creates for the text block that starts with the keywords in brackets % % % See also: TIMSREPORTS % % % Copyright 2025 Tim C. Lueth |
googleScholarSearch()- performs a google scholar search for keywords a uses openaI to process the web site content |
| % googleScholarSearch() - performs a google scholar search for keywords a uses openaI to process the web site content % (by Tim Lueth, SG-Lib, 2025-DEZ-08 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: googleScholarSearch was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: chat1, googlePatentDownload, googlePatentSearch % % [refs,pdfLinks]=googleScholarSearch([]) % === OUTPUT RESULTS ====== % refs: referneces as Harvard List % pdfLinks: link to locally copied html of the google page % % EXAMPLE: % googleScholarSearch Marmulla Lueth % % See also: chat1, googlePatentDownload, googlePatentSearch % % % Copyright 2025-2026 Tim C. Lueth |
axis4datenum- sets the xaxis to datenum ticks, for datenum diagrams wich is now different to datetime ticks |
| % axis4datenum - sets the xaxis to datenum ticks, for datenum diagrams wich is now different to datetime ticks % (by Tim Lueth, SG-Lib, 2025-DEZ-07 as class: VISUALIZATION) % % since datetime is recommended, the simple version to use datenums als x axis is % not working anymore without adding 'keepticks','keeplimits' as parameters in % datetick % (Status of: 2025-12-08) % % Introduced first in SolidGeometry 5.6 % % axis4datenum % % % Copyright 2025 Tim C. Lueth |
fcreationdate2(fname)- 2nd version fcreationdate and much faster 2019's version |
| % fcreationdate2(fname) - 2nd version fcreationdate and much faster 2019's version % (by Tim Lueth, SG-Lib, 2025-DEZ-06 as class: FILE HANDLING) % % USE CAREFULLY: fcreationdate2 was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % fList=fcreationdate2([fname]) % === INPUT PARAMETERS === % fname: % === OUTPUT RESULTS ====== % fList: % % EXAMPLE: % fcreationdate2 *.m % % % Copyright 2025 Tim C. Lueth |
OpenAIgetThreadList(,"check")- returns the list of threads stored in the file such as OPENAI- |
| % OpenAIgetThreadList(,"check") - returns the list of threads stored in the file such as OPENAI- % (by Tim Lueth, SG-Lib, 2025-DEZ-06 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: OpenAIgetThreadList was not being tested extensively % % list=OpenAIlogID('thread_'); % (Status of: 2025-12-06) % % Introduced first in SolidGeometry 5.6 % % See also: OpenAIlogID, openAIgetThread % % [thrIDs,resp,list]=OpenAIgetThreadList([,"check"]) % "check": if used, the OpenAIlogID will be updated % === OUTPUT RESULTS ====== % thrIDs: just the list of threads used in ID log file % resp: response of all still existing threads from openAIgetThread % list: list of entries in the openAI logfile % % EXAMPLE: % list=OpenAIlogID('thread_') % [a,b,c]=OpenAIgetThreadList % % See also: OpenAIlogID, openAIgetThread % % % Copyright 2025 Tim C. Lueth |
fnameofmatlabcode(txt,frntchars,backchars)- returns the name of the first matlab fnct within a matlab code |
| % fnameofmatlabcode(txt,frntchars,backchars) - returns the name of the first matlab fnct within a matlab code % (by Tim Lueth, SG-Lib, 2025-DEZ-05 as class: CODING/DEVELOP) % % USE CAREFULLY: fnameofmatlabcode was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: json2TextMatlabcodeUsecase % % fname=fnameofmatlabcode(txt,[frntchars,backchars]) % === INPUT PARAMETERS === % txt: matlabcode of a fnctn or script % frntchars: default is 'CC_' % backchars: default is '.m' % === OUTPUT RESULTS ====== % fname: fnctn name of matlabcode or empty if a script % % EXAMPLE: % txt=readtextfile('PLcircle.m'); % fnameofmatlabcode(txt) % % See also: json2TextMatlabcodeUsecase % % % Copyright 2025-2026 Tim C. Lueth |
json2TextMatlabcodeUsecase(msg,)- supports json code as response of an chat - simply processes the response struct message |
| % json2TextMatlabcodeUsecase(msg,) - supports json code as response of an chat - simply processes the response struct message % (by Tim Lueth, SG-Lib, 2025-DEZ-04 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: json2TextMatlabcodeUsecase was not being tested extensively % % THIS IS DIFFERENT TO 2024's json2matlab as part of jarvisChatSGLib and % This fnctn corresponds to the default values of openAIsetAssistantInstructions % Only if the % (Status of: 2025-12-05) % % Introduced first in SolidGeometry 5.6 % % See also: openAIsetAssistantInstructions, json2matlabcode % % [text,matlabcode,usecasemd,resp]=json2TextMatlabcodeUsecase(msg,[]) % === INPUT PARAMETERS === % msg: message as standard response struct % === OUTPUT RESULTS ====== % text: text response of the message % matlabcode: matlabcode of the message % usecasemd: usecase strategy as learned by assistant % resp: JSON struct of the answer message % % EXAMPLE: % chatas SG Write a func to create a bucket with SGLib.; resp=ans % json2TextMatlabcodeUsecase(resp{1}) % % See also: openAIsetAssistantInstructions, json2matlabcode % % % Copyright 2025 Tim C. Lueth |
openAIupdateVectorstoreFile4Asssitant(filePath,assID)- updates a single file of a vectore store of an Assistent be uploading a new version and deleting the old one |
| % openAIupdateVectorstoreFile4Asssitant(filePath,assID) - updates a single file of a vectore store of an Assistent be uploading a new version and deleting the old one % (by Tim Lueth, SG-Lib, 2025-DEZ-03 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIupdateVectorstoreFile4Asssitant was not being tested % extensively % % If assistants are to learn and develop, the necessary files in the assigned % vector store must be updated regularly. Outdated files must be deleted and the % reference removed from the vector store. The new files must be uploaded, % re-registered in the vector store (as a file search), and then the assistant % must be informed of the change to the vector store. % % ATTENTION REMOVED FILES WILL BE MISSED BY OTHER VECTOR STORES IF USED IN MORE % THAN ONE % % Use "openAIgetInfo" to egt the current structure of you openAI API server % (Status of: 2025-12-03) % % Introduced first in SolidGeometry 5.6 % % See also: openAIgetInfo, openAIgetAssistantInfo, openAIgetuploadedFiles, % openAIdeleteuploadedFile, openAIdeleteFileFromVectorStoreCurl, % openAIuploadFile, openAIaddFileToVectorstoreCurl, % openAIupdateAssistantVectorStore % % newFileID=openAIupdateVectorstoreFile4Asssitant([filePath,assID]) % === INPUT PARAMETERS === % filePath: filepath the new file % assID: Assistant's ID that should use the file in its vectore store % === OUTPUT RESULTS ====== % newFileID: newFileID % % EXAMPLE: % openAIgetCHATenvironment('SG'); % newFileID=openAIupdateVectorstoreFile4Asssitant(which('funcSignatures.json'), getenv('OPENAICHAT_SG_IDA')) % % See also: openAIgetInfo, openAIgetAssistantInfo, openAIgetuploadedFiles, % openAIdeleteuploadedFile, openAIdeleteFileFromVectorStoreCurl, % openAIuploadFile, openAIaddFileToVectorstoreCurl, % openAIupdateAssistantVectorStore % % % Copyright 2025 Tim C. Lueth |
openAIupdateAssistantVectorStore(asstID,vectID)- simple reregister a Vectorstore of an Assistant |
| % openAIupdateAssistantVectorStore(asstID,vectID) - simple reregister a Vectorstore of an Assistant % (by Tim Lueth & ChatGPT, SG-Lib, 2025-DEZ-02 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIupdateAssistantVectorStore was not being tested extensively % % used for openAIupdateVectorstoreFile4Asssitant % (Status of: 2025-12-03) % % Introduced first in SolidGeometry 5.6 % % See also: openAIupdateVectorstoreFile4Asssitant % % resp=openAIupdateAssistantVectorStore(asstID,vectID) % === INPUT PARAMETERS === % asstID: openAI assistant ID % vectID: openAI vector ID % === OUTPUT RESULTS ====== % resp: JSON response struct % % See also: openAIupdateVectorstoreFile4Asssitant % % % Copyright 2025 Tim C. Lueth |
openAIgetCHATenvironment(Name)- gets the environment variables required for the CHAT by loading the environment file |
| % openAIgetCHATenvironment(Name) - gets the environment variables required for the CHAT by loading the environment file % (by Tim Lueth, SG-Lib, 2025-DEZ-01 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIgetCHATenvironment was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIsetCHATenvironment % % [threadID,asstID,EnvNam,fullname]=openAIgetCHATenvironment(Name) % === INPUT PARAMETERS === % Name: Name of the CHAT, Case ignored % === OUTPUT RESULTS ====== % threadID: Thread ID % asstID: Assistant V2 ID % EnvNam: Environment code % fullname: full name of the environment file % % EXAMPLE: % [thrID,assID]=openAIgetCHATenvironment('SG') % % See also: openAIsetCHATenvironment % % % Copyright 2025 Tim C. Lueth |
openAIgetThreadslastMessages(thrID,nn)- returns the last n messages/conversation of the chat |
| % openAIgetThreadslastMessages(thrID,nn) - returns the last n messages/conversation of the chat % (by Tim Lueth, SG-Lib, 2025-NOV-30 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIgetThreadslastMessages was not being tested extensively % % similar tp openAIgetMessagesCurl, but more user friendly (Status of: 2025-12-06) % % Introduced first in SolidGeometry 5.6 % % See also: openAIgetThreadMessages % % [outm,resp]=openAIgetThreadslastMessages([thrID,nn]) % === INPUT PARAMETERS === % thrID: Thread ID % nn: number of messages to receive; default is 1 % === OUTPUT RESULTS ====== % outm: list of json responses % resp: response of all required answer json structs % % EXAMPLE: % OpenAIgetThreadList; list=ans % [~,resp]=openAIgetThreadslastMessages(list{end}) % [~,resp]=openAIgetThreadslastMessages(list{end},1:4) % [~,resp]=openAIgetThreadslastMessages(list{end},100) % % % See also: openAIgetThreadMessages % % % Copyright 2025 Tim C. Lueth |
chatas(chatname,message)- communicates with an openAI in a named chat based on a thread and assistant |
| % chatas(chatname,message) - communicates with an openAI in a named chat based on a thread and assistant % (by Tim Lueth, SG-Lib, 2025-NOV-29 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: chatas was not being tested extensively % % The AssistantV2 and the thread are stored in an environment variable using % openAIsetCHATenvironment, so that the chat can be stopped and continued on % another computer at a different time, as long as the Assistant ID and Thread ID % are known. Tim Lueth stores these in his "workdir" on a mobile hard drive, so % that he can always activate the chat with the hard drive. % This fnctn uses the name to identify and load the environment files created by % openAIsetCHATenvironment (Status of: 2025-11-29) % % Introduced first in SolidGeometry 5.6 % % See also: openAIsetCHATenvironment % % chatas([chatname,message]) % === INPUT PARAMETERS === % chatname: chatname % message: message to the chat (assistant / thread) % % EXAMPLE: % chatas SG womit erzeuge ich eine SG aus einer CPL durch extrusion in einer achse. Kann ich dabei kanten abrunden? % % See also: openAIsetCHATenvironment % % % Copyright 2025 Tim C. Lueth |
openAIsetCHATenvironment(Name,asstID,threadID)- sets environment variables for chats using Assistant V2 (Thread and Assistant) |
| % openAIsetCHATenvironment(Name,asstID,threadID) - sets environment variables for chats using Assistant V2 (Thread and Assistant) % (by Tim Lueth, SG-Lib, 2025-NOV-29 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIsetCHATenvironment was not being tested extensively % % SG-Lib solution for archiving the environment ids of chats in the workdir to % call workdir(pwd) first (Status of: 2025-11-29) % % Introduced first in SolidGeometry 5.6 % % See also: workdir % % EnvNam=openAIsetCHATenvironment(Name,asstID,threadID) % === INPUT PARAMETERS === % Name: Name of Chat - Such as SG' - No spaces allowed, upper case % asstID: assistant ID for the chat % threadID: thread ID for the chat % === OUTPUT RESULTS ====== % EnvNam: Environment to load % % EXAMPLE: % openAIsetCHATenvironment('SG','asst_SlvhXemU8Jhw9m6CAIWZ9tTK','thread_zpkJIFeTvt9CZPIGlb5D4qp1') % loadenv('OPENAICHAT_SG_ID.env') % getenv('OPENAICHAT_SG_IDA') % getenv('OPENAICHAT_SG_IDT') % % See also: workdir % % % Copyright 2025 Tim C. Lueth |
openAIsetAssistantInstructions(assID,newinstr)- renames an existing Assistant V2 with a new Name (CURL POST version) |
| % openAIsetAssistantInstructions(assID,newinstr) - renames an existing Assistant V2 with a new Name (CURL POST version) % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-29 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIsetAssistantInstructions was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIsetAssistantName, openAIsetVectorstoreName % % result=openAIsetAssistantInstructions(assID,newinstr) % === INPUT PARAMETERS === % assID: Assistant ID % newinstr: new inatructions for Assistant % === OUTPUT RESULTS ====== % result: JSON result struct % % See also: openAIsetAssistantName, openAIsetVectorstoreName % % % Copyright 2025 Tim C. Lueth |
openAIgetThreadRuns(thrID)- Returns all runs of a given thread (Assistant v2, curl, macOS). |
| % openAIgetThreadRuns(thrID) - Returns all runs of a given thread (Assistant v2, curl, macOS). % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-28 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIgetThreadRuns was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIwaitForRunCurl, openAIstartRunCurl, openAIgetRunStatusCurl, % openAIcreateThreadCurl % % [resp,data,use,tok]=openAIgetThreadRuns(thrID) % === INPUT PARAMETERS === % thrID: Thread ID % === OUTPUT RESULTS ====== % resp: JSON decoded struct of all RUNS % data: data of resp % use: usage of data % tok: sum of all tokens of all runs % % EXAMPLE: % [a,b,c,d]=openAIgetThreadRuns('thread_zpkJIFeTvt9CZPIGlb5D4qp1') % % See also: openAIwaitForRunCurl, openAIstartRunCurl, openAIgetRunStatusCurl, % openAIcreateThreadCurl % % % Copyright 2025 Tim C. Lueth |
openAIdeleteThreadCurl(thread_id)- deletes a thread for security reasons as threads cannot be accessed if by user throught the API if the thread id is lost |
| % openAIdeleteThreadCurl(thread_id) - deletes a thread for security reasons as threads cannot be accessed if by user throught the API if the thread id is lost % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-28 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIdeleteThreadCurl was not being tested extensively % % deletes a thread for security reasons as threads cannot be accessed or found if % by user throught the API if the thread id has been lost (Status of: 2025-11-28) % % Introduced first in SolidGeometry 5.6 % % See also: openAIcreateThreadCurl, OpenAIlogID, openAIdeleteuploadedFile, % openAIdeleteFileFromVectorStoreCurl, openAIDeleteAssistantCurl, % openAIdeleteVectorstore % % resp=openAIdeleteThreadCurl(thread_id) % === INPUT PARAMETERS === % thread_id: thread id must be logged by OpenAIlogID as in % === OUTPUT RESULTS ====== % resp: % % See also: openAIcreateThreadCurl, OpenAIlogID, openAIdeleteuploadedFile, % openAIdeleteFileFromVectorStoreCurl, openAIDeleteAssistantCurl, % openAIdeleteVectorstore % % % Copyright 2025 Tim C. Lueth |
openAIsetVectorstoreName(vector_store_id,new_name)- renames an existing Vectore-Store with a new Name (CURL POST version) |
| % openAIsetVectorstoreName(vector_store_id,new_name) - renames an existing Vectore-Store with a new Name (CURL POST version) % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-28 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIsetVectorstoreName was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIsetAssistantName % % resp=openAIsetVectorstoreName(vector_store_id,new_name) % === INPUT PARAMETERS === % vector_store_id: Vectore-Store ID % new_name: new name for Vectore-Store % === OUTPUT RESULTS ====== % resp: JSON result struct % % See also: openAIsetAssistantName % % % Copyright 2025 Tim C. Lueth |
openAIsetAssistantName(assID,newName)- renames an existing Assistant V2 with a new Name (CURL POST version) |
| % openAIsetAssistantName(assID,newName) - renames an existing Assistant V2 with a new Name (CURL POST version) % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-28 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIsetAssistantName was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIsetAssistantName, openAIsetAssistantInstructions, % openAIsetVectorstoreName % % resp=openAIsetAssistantName(assID,newName) % === INPUT PARAMETERS === % assID: Assistant ID % newName: new name for Assistant % === OUTPUT RESULTS ====== % resp: JSON result struct % % See also: openAIsetAssistantName, openAIsetAssistantInstructions, % openAIsetVectorstoreName % % % Copyright 2025 Tim C. Lueth |
openAIgetInfo- prints a list of uploaded files, vectore-stores, assistants. Threads are hidden by the API in general |
| % openAIgetInfo - prints a list of uploaded files, vectore-stores, assistants. Threads are hidden by the API in general % (by Tim Lueth, SG-Lib, 2025-NOV-28 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIgetInfo was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIgetuploadedFiles, openAIgetVectorstores, openAIgetAssistantsCurl % % openAIgetInfo % % EXAMPLE: % openAIgetInfo % plots the structure % % See also: openAIgetuploadedFiles, openAIgetVectorstores, openAIgetAssistantsCurl % % % Copyright 2025 Tim C. Lueth |
openAIdatestr(createdAI)- convertes the openAI date format into datenum into datestr (GMT) |
| % openAIdatestr(createdAI) - convertes the openAI date format into datenum into datestr (GMT) % (by Tim Lueth, SG-Lib, 2025-NOV-27 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIdatestr was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: OpenAIlogID % % ds=openAIdatestr(createdAI) % === INPUT PARAMETERS === % createdAI: datenum of openAI (posix format) % === OUTPUT RESULTS ====== % ds: datestring % % See also: OpenAIlogID % % % Copyright 2025 Tim C. Lueth |
OpenAIlogID(ID,desc)- records locally the ids of openAI structures which are not recorded anywhere, such as thread-IDs. Required to delete threads |
| % OpenAIlogID(ID,desc) - records locally the ids of openAI structures which are not recorded anywhere, such as thread-IDs. Required to delete threads % (by Tim Lueth, SG-Lib, 2025-NOV-27 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: OpenAIlogID was not being tested extensively % % OpenAIlogID can also be called with show or "thre" or "ass" or "run" to get % "vs" threads, assistant, runs, vectores stores that were logged (Status of: % 2025-11-27) % % Introduced first in SolidGeometry 5.6 % % See also: openAIcreateThreadCurl % % ccc=OpenAIlogID([ID,desc]) % === INPUT PARAMETERS === % ID: ID of openAI files, vectorstores, assistant, threads, messages etc. % desc: description, optionally % === OUTPUT RESULTS ====== % ccc: content of fname=[workdir filesep 'openAI-' username '-IDs.txt'] % % % EXAMPLE: % openAIOpenAIlogID('vs-xxxxxxx','Vectore store for Assistant') % log a vector sotre % openAIOpenAIlogID show % shows the log file % openAIOpenAIlogID ass % shows only the assistants of the log file % % % See also: openAIcreateThreadCurl % % % Copyright 2025 Tim C. Lueth |
openAIgetAssistantInfo(assistant_id)- returns the relevant inforation corresponding to an assistant ID |
| % openAIgetAssistantInfo(assistant_id) - returns the relevant inforation corresponding to an assistant ID % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-27 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIgetAssistantInfo was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % resp=openAIgetAssistantInfo(assistant_id) % === INPUT PARAMETERS === % assistant_id: assistant ID % === OUTPUT RESULTS ====== % resp: JSON response struct % % % Copyright 2025 Tim C. Lueth |
openAIaddMessageCurl(thread_id,text)- adds a "message" to a recently created "thread" |
| % openAIaddMessageCurl(thread_id,text) - adds a "message" to a recently created "thread" % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-27 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIaddMessageCurl was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % resp=openAIaddMessageCurl(thread_id,text) % === INPUT PARAMETERS === % thread_id: thrad/chat ID % text: Question/Message in the Chat % === OUTPUT RESULTS ====== % resp: JSON response struct % % % Copyright 2025 Tim C. Lueth |
openAIgetRunStatusCurl(thrID,runID)- returns the status for a "thread" "run" |
| % openAIgetRunStatusCurl(thrID,runID) - returns the status for a "thread" "run" % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-27 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIgetRunStatusCurl was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIwaitForRunCurl, openAIstartRunCurl % % resp=openAIgetRunStatusCurl(thrID,runID) % === INPUT PARAMETERS === % thrID: Thread ID % runID: Run ID % === OUTPUT RESULTS ====== % resp: JSON response struct % % See also: openAIwaitForRunCurl, openAIstartRunCurl % % % Copyright 2025 Tim C. Lueth |
openAIwaitForRunCurl(thrid,runid)- uses openAIgetRunStatusCurl to wait for a thread run |
| % openAIwaitForRunCurl(thrid,runid) - uses openAIgetRunStatusCurl to wait for a thread run % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-27 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIwaitForRunCurl was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIgetRunStatusCurl, openAIstartRunCurl % % resp=openAIwaitForRunCurl(thrid,runid) % === INPUT PARAMETERS === % thrid: Thread ID % runid: Run ID % === OUTPUT RESULTS ====== % resp: JSON response struct % % See also: openAIgetRunStatusCurl, openAIstartRunCurl % % % Copyright 2025 Tim C. Lueth |
openAIstartRunCurl(thrID,assID)- Starts an "assistant" "run" for a "thread" |
| % openAIstartRunCurl(thrID,assID) - Starts an "assistant" "run" for a "thread" % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-27 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIstartRunCurl was not being tested extensively % % 1st create an vector-store with documents for file-search % 2nd create an empty thread (chat) to prepare a message % 3rd send a message to the thread % 4th let an assistant run using the vector-store to create an answer. Works as % batch (Status of: 2025-11-27) % % Introduced first in SolidGeometry 5.6 % % See also: openAIgetRunStatusCurl, openAIwaitForRunCurl % % runID=openAIstartRunCurl(thrID,assID) % === INPUT PARAMETERS === % thrID: Thread ID % assID: Assistant ID % === OUTPUT RESULTS ====== % runID: Run ID % % See also: openAIgetRunStatusCurl, openAIwaitForRunCurl % % % Copyright 2025 Tim C. Lueth |
openAIcreateThreadCurl- creates an empty "thread" for a "message" and an "Assistant V2" (CURL version) |
| % openAIcreateThreadCurl - creates an empty "thread" for a "message" and an "Assistant V2" (CURL version) % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-27 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIcreateThreadCurl was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIgetThreadCurl, openAIdeleteThreadCurl % % thrID=openAIcreateThreadCurl % === OUTPUT RESULTS ====== % thrID: Thread ID of an empty thread % % EXAMPLE: % thrID=openAIcreateThreadCurl % % See also: openAIgetThreadCurl, openAIdeleteThreadCurl % % % Copyright 2025 Tim C. Lueth |
openAIgetAssistantsCurl- shows all assistants of your API Key (CURL version) |
| % openAIgetAssistantsCurl - shows all assistants of your API Key (CURL version) % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-27 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIgetAssistantsCurl was not being tested extensively % % helpful to delete old agents, to protect IP from less friendly people (Status % of: 2025-11-27) % % Introduced first in SolidGeometry 5.6 % % See also: openAIcreateAssistantCurl, openAIDeleteAssistantCurl, % openAIresetAssistantCurl % % [names,ids,resp]=openAIgetAssistantsCurl % === OUTPUT RESULTS ====== % names: list of names % ids: list of IDs % resp: JSON struct % % EXAMPLE: % [a,b,c]=openAIgetAssistantsCurl % % See also: openAIcreateAssistantCurl, openAIDeleteAssistantCurl, % openAIresetAssistantCurl % % % Copyright 2025 Tim C. Lueth |
openAIcreateAssistantCurl(vectID,instr)- creates an openAI V2 assistant with CURL |
| % openAIcreateAssistantCurl(vectID,instr) - creates an openAI V2 assistant with CURL % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-27 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIcreateAssistantCurl was not being tested extensively % % The body contains of % '"tools":[{"type":"file_search"}],' ... % '"tool_resources":{' ... % '"file_search":{"vector_store_ids":["%s"]}' ... % (Status of: 2025-11-27) % % Introduced first in SolidGeometry 5.6 % % See also: openAIDeleteAssistantCurl, openAIgetAssistantsCurl, % openAIresetAssistantCurl % % [assID,resp]=openAIcreateAssistantCurl(vectID,instr) % === INPUT PARAMETERS === % vectID: Vector-store id % instr: Instructions for the agent; default is especially for SG=Lib % === OUTPUT RESULTS ====== % assID: Assistant ID % resp: JSON response struct % % See also: openAIDeleteAssistantCurl, openAIgetAssistantsCurl, % openAIresetAssistantCurl % % % Copyright 2025 Tim C. Lueth |
openAIgetThreadMessages(thrID,lastmsgID)- returns the answer of an assistant's thread's message/question |
| % openAIgetThreadMessages(thrID,lastmsgID) - returns the answer of an assistant's thread's message/question % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-25 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIgetThreadMessages was not being tested extensively % % It is used by "openAIgetThreadlastRunsMessages" % (Status of: 2025-12-02) % % Introduced first in SolidGeometry 5.6 % % See also: openAIgetThreadlastRunsMessages % % [answer,resp]=openAIgetThreadMessages([thrID,lastmsgID]) % === INPUT PARAMETERS === % thrID: thread id, independent on which agent responded to the question % lastmsgID: if used, it is possible to get older Messages (is_more) % === OUTPUT RESULTS ====== % answer: text answer % resp: JSON response struct % % EXAMPLE: % [a,resp]=openAIgetThreadMessages(getenv('OPENAICHAT_SG_IDT')) % first 20 entries % [a,resp]=openAIgetThreadMessages(getenv('OPENAICHAT_SG_IDT'),resp.last_id) % next 20 entries % % See also: openAIgetThreadlastRunsMessages % % % Copyright 2025 Tim C. Lueth |
openAIDeleteAssistantCurl(assID)- deletes an v2 assistant based on its assistant ID (CURL version) |
| % openAIDeleteAssistantCurl(assID) - deletes an v2 assistant based on its assistant ID (CURL version) % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-25 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIDeleteAssistantCurl was not being tested extensively % % uses api_key = getenv("OPENAI_API_KEY"); % (Status of: 2025-11-27) % % Introduced first in SolidGeometry 5.6 % % See also: openAIcreateAssistantCurl, openAIgetAssistantsCurl, % openAIresetAssistantCurl % % resp=openAIDeleteAssistantCurl(assID) % === INPUT PARAMETERS === % assID: assistant ID % === OUTPUT RESULTS ====== % resp: JSON response struct % % See also: openAIcreateAssistantCurl, openAIgetAssistantsCurl, % openAIresetAssistantCurl % % % Copyright 2025 Tim C. Lueth |
openAIgetVectorStoreFilesCurl(vid)- get files an their status within a vector store (CURL Version) |
| % openAIgetVectorStoreFilesCurl(vid) - get files an their status within a vector store (CURL Version) % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-25 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIgetVectorStoreFilesCurl was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIgetVectorstores % % resp=openAIgetVectorStoreFilesCurl(vid) % === INPUT PARAMETERS === % vid: vectore store id % === OUTPUT RESULTS ====== % resp: response struct % % EXAMPLE: % [a,b,c]=openAIgetVectorstores % openAIgetVectorStoreFilesCurl(b{1}) % % See also: openAIgetVectorstores % % % Copyright 2025 Tim C. Lueth |
openAIdeleteFileFromVectorStoreCurl(vid,fid)- deletes (failed) files from vectore stores (CURL Version) |
| % openAIdeleteFileFromVectorStoreCurl(vid,fid) - deletes (failed) files from vectore stores (CURL Version) % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-25 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIdeleteFileFromVectorStoreCurl was not being tested % extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIgetVectorStoreFilesCurl % % resp=openAIdeleteFileFromVectorStoreCurl(vid,fid) % === INPUT PARAMETERS === % vid: vector store id % fid: file id % === OUTPUT RESULTS ====== % resp: response struct % % EXAMPLE: % openAIdeleteFileFromVectorStoreCurl('vs_692533bde7848191b125da2f725ba05e','file-RKj3gUYSLXNw2yDwwg48WK') % openAIgetVectorStoreFilesCurl('vs_692533bde7848191b125da2f725ba05e') % % See also: openAIgetVectorStoreFilesCurl % % % Copyright 2025 Tim C. Lueth |
openAIaddFileToVectorstoreCurl(file_id,vector_id)- adds or registeras an uploaded file in a vector store for assistant use (CURL Version) |
| % openAIaddFileToVectorstoreCurl(file_id,vector_id) - adds or registeras an uploaded file in a vector store for assistant use (CURL Version) % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-25 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIaddFileToVectorstoreCurl was not being tested extensively % % I do now used CURL to make sure that I do not use Matlab's interface % Did work on (Status of: 2025-11-25) % % Introduced first in SolidGeometry 5.6 % % See also: openAIgetuploadedFiles, openAIgetVectorstores % % resp=openAIaddFileToVectorstoreCurl(file_id,vector_id) % === INPUT PARAMETERS === % file_id: file id by openAIgetuploadedFiles % vector_id: vector_id by openAIgetVectorstores % === OUTPUT RESULTS ====== % resp: response struct, enthält die batch_id % % EXAMPLE: % fid=openAIuploadFile('/Volumes/LUETH-WIN/WIN AIM Matlab Libraries/SolidGeometry-Code/SGLIB_HTMLDOCU4GPT.zip') % vid=openAIcreateVectorstore('SGLIB-docustore') % % See also: openAIgetuploadedFiles, openAIgetVectorstores % % % Copyright 2025 Tim C. Lueth |
openAIdownloadFile(fid)- dobwload an uploaded binary files from openAI even with 2024b (CURL Version) |
| % openAIdownloadFile(fid) - dobwload an uploaded binary files from openAI even with 2024b (CURL Version) % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-20 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIdownloadFile was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIuploadFile, openAIdeleteuploadedFile, openAIgetuploadedFiles % % result=openAIdownloadFile(fid) % === INPUT PARAMETERS === % fid: openAI file id % === OUTPUT RESULTS ====== % result: json struct; use struct2cell(result.data)' % % EXAMPLE: % result=openAIgetuploadedFiles; % jsonencode(result.data) % struct2cell(result.data) % ids=elem2cell(result.data.id) % openAIdownloadFile(ids{end}) % % See also: openAIuploadFile, openAIdeleteuploadedFile, openAIgetuploadedFiles % % % Copyright 2025 Tim C. Lueth |
openAIgetuploadedFiles- get the list of uploaded binary files to openAI even with 2024b (CURL Version) |
| % openAIgetuploadedFiles - get the list of uploaded binary files to openAI even with 2024b (CURL Version) % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-20 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIgetuploadedFiles was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIuploadFile, openAIdeleteuploadedFile, openAIdownloadFile % % result=openAIgetuploadedFiles % === OUTPUT RESULTS ====== % result: json struct; use struct2cell(result.data)' % % EXAMPLE: % result=openAIgetuploadedFiles; % jsonencode(result.data) % struct2cell(result.data) % ids=elem2cell(result.data.id) % % openAIdeleteuploadedFile(ids{end}) % % See also: openAIuploadFile, openAIdeleteuploadedFile, openAIdownloadFile % % % Copyright 2025 Tim C. Lueth |
openAIdeleteuploadedFile(fid)- deletes uploaded binary files to openAI even with 2024b (CURL Version) |
| % openAIdeleteuploadedFile(fid) - deletes uploaded binary files to openAI even with 2024b (CURL Version) % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-20 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIdeleteuploadedFile was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIuploadFile, openAIgetuploadedFiles, openAIdownloadFile % % result=openAIdeleteuploadedFile(fid) % === INPUT PARAMETERS === % fid: file name % === OUTPUT RESULTS ====== % result: file id % % See also: openAIuploadFile, openAIgetuploadedFiles, openAIdownloadFile % % % Copyright 2025 Tim C. Lueth |
openAIuploadFile(fname)- upload binary files to openAI even with 2024b (CURL Version) |
| % openAIuploadFile(fname) - upload binary files to openAI even with 2024b (CURL Version) % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-20 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIuploadFile was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIdeleteuploadedFile, openAIgetuploadedFiles, openAIdownloadFile % % file_id=openAIuploadFile([fname]) % === INPUT PARAMETERS === % fname: file name % === OUTPUT RESULTS ====== % file_id: file id % % See also: openAIdeleteuploadedFile, openAIgetuploadedFiles, openAIdownloadFile % % % Copyright 2025 Tim C. Lueth |
openAIgetmodels- returns all API GPT models of openAI - testing fnct for openAI (webread version) |
| % openAIgetmodels - returns all API GPT models of openAI - testing fnct for openAI (webread version) % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-20 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIgetmodels was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIgetVectorstores, openAIdeleteVectorstore, % openAIcreateVectorstore % % [ccc,resp]=openAIgetmodels % === OUTPUT RESULTS ====== % ccc: cell list of model ids % resp: response struct % % EXAMPLE: % openAIgetmodels % % See also: openAIgetVectorstores, openAIdeleteVectorstore, % openAIcreateVectorstore % % % Copyright 2025 Tim C. Lueth |
openAIgetVectorstores- gets the names/IDs of all openAI vector store (CURL Version) |
| % openAIgetVectorstores - gets the names/IDs of all openAI vector store (CURL Version) % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-20 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIgetVectorstores was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIcreateVectorstore, openAIdeleteVectorstore % % [names,ids,resp]=openAIgetVectorstores % === OUTPUT RESULTS ====== % names: names of vector stores % ids: ids of vector stores % resp: response struct % % EXAMPLE: % idn=openAIcreateVectorstore('TEST-store'), % [names,id,resp]=openAIgetVectorstore % openAIdeleteVectorstores(idn) % [names,id,resp]=openAIgetVectorstores % % See also: openAIcreateVectorstore, openAIdeleteVectorstore % % % Copyright 2025 Tim C. Lueth |
openAIdeleteVectorstore(store_id)- deletes an openAI vector store by its id (webwrite Version) |
| % openAIdeleteVectorstore(store_id) - deletes an openAI vector store by its id (webwrite Version) % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-20 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIdeleteVectorstore was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIcreateVectorstore, openAIgetVectorstore % % resp=openAIdeleteVectorstore(store_id) % === INPUT PARAMETERS === % store_id: Store id returned by openAigetVectorstores % === OUTPUT RESULTS ====== % resp: response struct % % EXAMPLE: % idn=openAIcreateVectorstore('TEST-store'), % [names,id,resp]=openAIgetVectorstore % openAIdeleteVectorstores(idn) % [names,id,resp]=openAIgetVectorstores % % See also: openAIcreateVectorstore, openAIgetVectorstore % % % Copyright 2025 Tim C. Lueth |
openAIcreateVectorstore(stname)- creates an opAI vector store (CURL Version) |
| % openAIcreateVectorstore(stname) - creates an opAI vector store (CURL Version) % (by Tim Lueth & ChatGPT, SG-Lib, 2025-NOV-19 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: openAIcreateVectorstore was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: openAIgetVectorstores, openAIdeleteVectorstore % % [id,resp]=openAIcreateVectorstore([stname]) % === INPUT PARAMETERS === % stname: Store name, must be unique in the SG-Lib, in contrast to openAI % === OUTPUT RESULTS ====== % id: vectore-store id % resp: response struct % % EXAMPLE: % idn=openAIcreateVectorstore('TEST-store'), % [names,id,resp]=openAIgetVectorstore % openAIdeleteVectorstores(idn) % [names,id,resp]=openAIgetVectorstores % % See also: openAIgetVectorstores, openAIdeleteVectorstore % % % Copyright 2025 Tim C. Lueth |
SGcreateDocuZIP4GPT- creates a zip file including all SG-Lib html files od the directory SGLIB_HELP_Structures |
| % SGcreateDocuZIP4GPT - creates a zip file including all SG-Lib html files od the directory SGLIB_HELP_Structures % (by Tim Lueth, SG-Lib, 2025-NOV-19 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: SGcreateDocuZIP4GPT was not being tested extensively % % Finally opens the wordir % No xml allowed % No png allowed % No subdirs allowed (Status of: 2025-11-20) % % Introduced first in SolidGeometry 5.6 % % See also: openAIcreateVectorstore % % fname=SGcreateDocuZIP4GPT % === OUTPUT RESULTS ====== % fname: file name of the zip file % % See also: openAIcreateVectorstore % % % Copyright 2025 Tim C. Lueth |
chatimage2video(I,prompt,nvp)- creates a video file on disk by openAI' Sora (12 seconds cost about 2 Dollar) based on a picture |
| % chatimage2video(I,prompt,nvp) - creates a video file on disk by openAI' Sora (12 seconds cost about 2 Dollar) based on a picture % (by Tim Lueth & Robin Schregle, SG-Lib, 2025-NOV-18 as class: ARTIFICIAL % INTELLIGENCE) % % USE CAREFULLY: chatimage2video was not being tested extensively % % requires at least "matlab-deep-learning-llms-with-matlab-4". 1st version by % Robin Schregle % The file will be written in a mp4 on desktop and the prompt is in a textfile % with the same name % Does use the matlab.net.http.RequestMessage interface. (Status of: 2025-11-25) % % Introduced first in SolidGeometry 5.6 % % See also: chat, chatimage, chatvideo, chatpublication % % response=chatimage2video(I,prompt,nvp) % === INPUT PARAMETERS === % I: Image or file name of the image. It will be resized to fit 1280x720 or other % formats % prompt: description of the video content - the more the better % nvp: addition parameter such as "size", "720x1280" % === OUTPUT RESULTS ====== % response: response from openAI - mp4Bytes = response.Body.Data; % % EXAMPLE: % I=imread('peppers.png'); % chatimage2video(I,'Make a TUM MIMED Team eating the pepper imageand have fun',"Size","1280x720") % % See also: chat, chatimage, chatvideo, chatpublication % % % Copyright 2025 Tim C. Lueth |
SGcreateJSONfnctSignatures4GPT(fnameML,fnameGPT)- Generates a JSON for GPT from the SG-Lib documentation "JSONfnctSignatures4Matlab" |
| % SGcreateJSONfnctSignatures4GPT(fnameML,fnameGPT) - Generates a JSON for GPT from the SG-Lib documentation "JSONfnctSignatures4Matlab" % (by Tim Lueth, SG-Lib, 2025-NOV-17 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: SGcreateJSONfnctSignatures4GPT was not being tested extensively % % Typically used only once to create the (Status of: 2025-11-20) % % Introduced first in SolidGeometry 5.6 % % See also: SGcreateJSONfnctSignatures4Matlab % % fnameGPT=SGcreateJSONfnctSignatures4GPT([fnameML,fnameGPT]) % === INPUT PARAMETERS === % fnameML: default is [SGlibpath filesep 'fnctnSignatures.json'] % fnameGPT: default is [SGlibpath filesep 'GPTfnctnSignatures.json']); % === OUTPUT RESULTS ====== % fnameGPT: location of GPT JSON for SG-Lib default is fnameGPT % % EXAMPLE: % GPTJSON=SGcreateJSONfnctSignatures4GPT % without paramters; the default values are used % % See also: SGcreateJSONfnctSignatures4Matlab % % % Copyright 2025 Tim C. Lueth |
FINdataPOP(,"force","DOI")- download ans saves the population of several countries from the world bank homepage |
| % FINdataPOP(,"force","DOI") - download ans saves the population of several countries from the world bank homepage % (by Tim Lueth, SG-Lib, 2025-NOV-15 as class: TUTORIAL) % % Introduced first in SolidGeometry 5.6 % % See also: FINdataM2 % % FINdataPOP([,"force","DOI"]) % "force": if used, the download of the new data is enforced % "DOI": Day of interest to normalize the data % % EXAMPLE: % FINdataPOP PT DK SE NO FI AT % % See also: FINdataM2 % % % Copyright 2025 Tim C. Lueth |
FINdataM2EURread- delivers the EUR money supply M2 directly from European Central Bank apir |
| % FINdataM2EURread - delivers the EUR money supply M2 directly from European Central Bank apir % (by Tim Lueth, SG-Lib, 2025-NOV-15 as class: TUTORIAL) % % api.ecb.europa.eu % (Status of: 2025-11-17) % % Introduced first in SolidGeometry 5.6 % % See also: FINdataM2, FINdataM2USAread, FINdataM2CHFread % % [M2EUR,dates,values]=FINdataM2EURread % === OUTPUT RESULTS ====== % M2EUR: [datum values] as coordinate list % dates: datenum array % values: vallue array % % EXAMPLE: % FINdataM2EURread; M2CHF=ans % FINdataM2 % % See also: FINdataM2, FINdataM2USAread, FINdataM2CHFread % % % Copyright 2025 Tim C. Lueth |
chat2table(txt,"cell")- Take a char text and create a table or a cell array. |
| % chat2table(txt,"cell") - Take a char text and create a table or a cell array. % (by Tim Lueth, SG-Lib, 2025-NOV-14 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: chat2table was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: chat2diagram % % [TAB,code]=chat2table([txt,"cell"]) % === INPUT PARAMETERS === % txt: text desciption of a table % "cell": if used, an cell instead of a table is returned % === OUTPUT RESULTS ====== % TAB: matlab table % code: code to create the matlab table; cann be used in a matlab file later % % EXAMPLE: % chat zeige das Bevökerungswachstum der EU-Staaten im Euro-Raum seit 2000 im Jahresabständen; x=ans % y=chat2table(x) % y=chat2table(x,'cell') % chat Stelle die Geldemengenentwicklung M2 der USA relativ zur Bevölkerungentwicklung der USA in den Jahren 1984 bis 2025 in jährlichen Abständen und jährlich Steigerung der letzten Zahl in Prozent dar; x=ans; % % % See also: chat2diagram % % % Copyright 2025 Tim C. Lueth |
PLgearDIN(m,z,tig,n,shr)- |
| % PLgearDIN(m,z,tig,n,shr) - delivers the CHF money supply M2 directly from Swiss National Bank % (by Tim Lueth, SG-Lib, 2025-NOV-14 as class: TUTORIAL) % % The API is explained on the page % "https://data.snb.ch/de/topics/snb/cube/snbmonagg." % https://data.snb.ch/de/topics/snb/cube/snbmonagg(sidebar:-/help_api/-) (Status % of: 2025-11-14) % % Introduced first in SolidGeometry 5.6 % % See also: FINdataM2, FINdataM2USAread, FINdataM2CHFread % % [PLG,d,da,df,db]=PLgearDIN([m,z,tig,n,shr]) % === INPUT PARAMETERS === % m: % z: % tig: % n: % shr: % === OUTPUT RESULTS ====== % PLG: [datum values] as coordinate list % d: % da: % df: % db: % % EXAMPLE: % FINdataM2CHFread; M2CHF=ans % FINdataM2 % % See also: FINdataM2, FINdataM2USAread, FINdataM2CHFread % % % Copyright 2025-2026 Tim C. Lueth |
FINdataM2USAread- delivers the USD money supply M2 directly from FRED in St. Louis, USA, via API |
| % FINdataM2USAread - delivers the USD money supply M2 directly from FRED in St. Louis, USA, via API % (by Tim Lueth, SG-Lib, 2025-NOV-14 as class: TUTORIAL) % % You can ask for a cost-free FRED account at: % "https://fredaccount.stlouisfed.org" % You can ask for an cost-free API access at: % "https://fred.stlouisfed.org/docs/api/api_key.html % The fnctn stores the M2USD array as "M2USD.mat" and variable name M2USD. % (Status of: 2025-11-14) % % Introduced first in SolidGeometry 5.6 % % See also: FINdataM2, FINdataM2CHFread % % [M2USD,dates,values]=FINdataM2USAread % === OUTPUT RESULTS ====== % M2USD: [datum values*1000] as coordinate list % dates: dates as datetime struct % values: values as double list % % EXAMPLE: % FINdataM2USAread; M2USD=ans % FINdataM2 % % % See also: FINdataM2, FINdataM2CHFread % % % Copyright 2025 Tim C. Lueth |
chatclipcorrect(lang)- prepares sepell checking and translation of the clipboard |
| % chatclipcorrect(lang) - prepares sepell checking and translation of the clipboard % (by Tim Lueth, SG-Lib, 2025-NOV-13 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: chatclipcorrect was not being tested extensively % % Used for correcting and translating german and english text in emails % It is used in combination with keyboard Maestro ("Shift-Command-C") % "Above all, I am pleased that the genuine German spelling rules are used, and % not the distorted pseudo-new German. Commas and capitalization as desired." % (Status of: 2025-11-13) % % Introduced first in SolidGeometry 5.6 % % See also: chat1 % % corr=chatclipcorrect([lang]) % === INPUT PARAMETERS === % lang: languages - default is 'de en % === OUTPUT RESULTS ====== % corr: corrected and optional translated text % % EXAMPLE: % clipboard('copy', 'Es ist schön, si wider in munchn zu schauen') % chatclipcorrect de en % % % See also: chat1 % % % Copyright 2025 Tim C. Lueth |
chatcode(descr,fname)- returns matlab code and writes a matlab fnct into the working directory |
| % chatcode(descr,fname) - returns matlab code and writes a matlab fnct into the working directory % (by Tim Lueth, SG-Lib, 2025-NOV-09 as class: ARTIFICIAL INTELLIGENCE) % % uses chatGPT to create Matlab fnctns based on a quit complete definition of the % header (Status of: 2025-11-09) % % Introduced first in SolidGeometry 5.6 % % See also: chat1, chat, chatpublication % % [flong,txt]=chatcode([descr,fname]) % === INPUT PARAMETERS === % descr: Complete header including input out parameter an their description % fname: desired name of cuntin % === OUTPUT RESULTS ====== % flong: full file name of the m file; Names start with CC_ and can get an % additional % txt: code of the matlba file % % EXAMPLE: % chatcode(help('PLcircle')) % creates a func similar to the SG-Lib func % chatcode(help('PLcircle')), CC_PLcircle(10,7) % chatcode(help('normr')) % creates a func similar to "normr" of Matlab % % See also: chat1, chat, chatpublication % % % Copyright 2025 Tim C. Lueth |
testchatfunc(x,y)- returns the area of a square mit dimensions x and y |
| % testchatfunc(x,y) - returns the area of a square mit dimensions x and y % (by Tim Lueth, SG-Lib, 2025-NOV-09 as class: ARTIFICIAL INTELLIGENCE) % % This fnctn was declared as a single line in Tim Lueth's Filemaker database by % input and output params. % fnctn [a,b,c]=testchatfunc(x,y) % Afterwards the explaination of the fnctn and the description of the parameter % was added in the filemaker database. Then header was compiled by the FM % database and copied into the clipboard(!) and into a variable A % (A=clipboard('paste)) % Then chatcode(A) created the complete matlab code fnctn % (Status of: 2025-11-09) % % Introduced first in SolidGeometry 5.6 % % See also: chatcode % % [a,b,c]=testchatfunc(x,y) % === INPUT PARAMETERS === % x: dimension in x % y: dimension in y % === OUTPUT RESULTS ====== % a: area % b: area of a circle with radius x % c: volume of a cylinder iwth radius x and height y % % EXAMPLE: % [A,B,C]=testchatfunc(10,20) % % See also: chatcode % % % Copyright 2025 Tim C. Lueth |
chatimage(descr)- creates a picture/sketch/diagram/image of a text using "dall-e-3" |
| % chatimage(descr) - creates a picture/sketch/diagram/image of a text using "dall-e-3" % (by Tim Lueth & Robin Schregle, SG-Lib, 2025-NOV-06 as class: ARTIFICIAL % INTELLIGENCE) % % requires at least "matlab-deep-learning-llms-with-matlab-4". First Version by % Robin Schregle, it uses Matlabs openAIImages % (Status of: 2025-11-09) % % Introduced first in SolidGeometry 5.6 % % See also: chat, chatm, chatdiagramm % % [img,GPT]=chatimage([descr]) % === INPUT PARAMETERS === % descr: description of the picture % === OUTPUT RESULTS ====== % img: image % GPT: GPT Response of openAIImages % % EXAMPLE: % chatimage('Draw an Aston Martin Sportscar near the Lake Garde like in the Quantum James Bond') % % % See also: chat, chatm, chatdiagramm % % % Copyright 2025 Tim C. Lueth |
chatvideo(prompt,nvp)- creates a video file on disk by openAI' Sora (12 seconds cost about 2 Dollar) |
| % chatvideo(prompt,nvp) - creates a video file on disk by openAI' Sora (12 seconds cost about 2 Dollar) % (by Tim Lueth & Robin Schregle, SG-Lib, 2025-NOV-06 as class: ARTIFICIAL % INTELLIGENCE) % % requires at least "matlab-deep-learning-llms-with-matlab-4". 1st version by % Robin Schregle % The file will be written in a mp4 on desktop and the promt is in a textfile % with the same name % Does use the send interface. (Status of: 2025-11-25) % % Introduced first in SolidGeometry 5.6 % % See also: chat, chatimage, chatpublication % % response=chatvideo(prompt,nvp) % === INPUT PARAMETERS === % prompt: description of the video content - the more the better % nvp: addition parameter such as "size", "720x1280" % === OUTPUT RESULTS ====== % response: response from openAI - mp4Bytes = response.Body.Data; % % EXAMPLE: % chatvideo('Create an video about an Aston Martin Sportscar near the Lake Garde like in the Quantum James Bond',"Size","1280x720") % % See also: chat, chatimage, chatpublication % % % Copyright 2025 Tim C. Lueth |
JAVAemailmsg2cell(msgs,)- reads email as text or creates an chatGPT answer |
| % JAVAemailmsg2cell(msgs,) - reads email as text or creates an chatGPT answer % (by Tim Lueth, SG-Lib, 2025-NOV-05 as class: CODING/DEVELOP) % % USE CAREFULLY: JAVAemailmsg2cell was not being tested extensively % % Introduced first in SolidGeometry 5.6 % % See also: JAVAemailServerImap, JAVAemailTUMimap, JAVAemailreadtextmessage % % [ttxt,Efrom,Edate,Esubj,Eto,ANSW]=JAVAemailmsg2cell(msgs,[]) % === INPUT PARAMETERS === % msgs: % === OUTPUT RESULTS ====== % ttxt: % Efrom: % Edate: % Esubj: % Eto: % ANSW: % % EXAMPLE: % [msgs,store]=JAVAemailTUMimap('gu28yik','INBOX'); % JAVAemailmsg2cell(msgs(end)) % % See also: JAVAemailServerImap, JAVAemailTUMimap, JAVAemailreadtextmessage % % % Copyright 2025 Tim C. Lueth |
chatm()- single line communication with openAI's chat gpt with persistent chat history and chat-memories.txt |
| % chatm() - single line communication with openAI's chat gpt with persistent chat history and chat-memories.txt % (by Tim Lueth, SG-Lib, 2025-NOV-05 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: chatm was not being tested extensively % % For longer conversations with a lot of text, we display the number of tokens. % With SGLib 5.6, all commandline chat fnctn support matlab expressions starting % with @ % 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 % wiesoweshalb- same as chat (no memories) % Uses OpenAIrequest. Make sure that your openAI API secret key is stored in a % file called "OPENAI_API_KEY.env" % (Status of: 2025-12-22) % % Introduced first in SolidGeometry 5.6 % % See also: chat1, chatweb, chatGPT, chat, OpenAIrequest % % y=chatm([]) % === 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 % A1=1000; A2=2000; t=10; chatm what is the inflation rate if objects increase in value from @A1 to @A2 in @t years? % % See also: chat1, chatweb, chatGPT, chat, OpenAIrequest % % % Copyright 2025 Tim C. Lueth |
latin1ofUTF(txt)- Provides a latin1 code for UTF so that the ASCII files are read correctly. |
| % latin1ofUTF(txt) - Provides a latin1 code for UTF so that the ASCII files are read correctly. % (by Tim Lueth, SG-Lib, 2025-NOV-05 as class: TEXT/STRS/CHARS/LINKS) % % USE CAREFULLY: latin1ofUTF was not being tested extensively % % Characters outside latin1 just disappear. % improved for UTF-16, UTF-8, latin1 Dec 27th % It seem to me a matlab bug that a hypen (45) is somehow converted into a 255 % char (Status of: 2025-12-27) % % Introduced first in SolidGeometry 5.6 % % See also: isUTF8, isUTF16file, dbprintchar % % c=latin1ofUTF(txt) % === INPUT PARAMETERS === % txt: uint8 text chain % === OUTPUT RESULTS ====== % c: latin1 text chain % % EXAMPLE: % chat create 200 chars including UTF8 chars such as greek characters, xxx=ans; isUTF8(xxx), latin1ofUTF(xxx) % code16=unicode2native('-Lüth-','UTF-16'); str16=char(code16), latin1ofUTF(code16) % code8=unicode2native('-Lüth-','UTF-8'); str8=char(code8), latin1ofUTF(code8) % codeL=unicode2native('-Lüth-','latin1'); strL=char(codeL), latin1ofUTF(codeL) % % See also: isUTF8, isUTF16file, dbprintchar % % % Copyright 2025 Tim C. Lueth |
isUTF8(txt)- Returns the number of codes that are not in the ASCII range 0..127 or the German umlauts. |
| % isUTF8(txt) - Returns the number of codes that are not in the ASCII range 0..127 or the German umlauts. % (by Tim Lueth, SG-Lib, 2025-NOV-05) % % USE CAREFULLY: isUTF8 was not being tested extensively % % It's hard for me to express, but Matlab still hasn't found a sensible way to % handle Latin1, UTF8, UTF16, or iso files in 2024b. This is all the more % annoying because the Matlab editor itself changes the encoding of files, but % there is no way to recognize the file type in Matlab. In combination with the % text-based chat fnctns, this makes it increasingly unsafe to use the text % fnctns. The introduction of strings has not improved the situation in any way. % (Status of: 2025-11-05) % % Introduced first in SolidGeometry 5.6 % % [n,io,ochar]=isUTF8(txt) % === INPUT PARAMETERS === % txt: text to check % === OUTPUT RESULTS ====== % n: number of special chars % io: position in char(txt) % ochar: uint8 of the special chars % % EXAMPLE: % chat create 200 chars including UTF8 chars such as greek characters, xxx=ans; isUTF8(xxx) % % % Copyright 2025 Tim C. Lueth |
html2char(tinp)- Converts HTML code in UTF8 into ASCII characters. |
| % html2char(tinp) - Converts HTML code in UTF8 into ASCII characters. % (by Tim Lueth, SG-Lib, 2025-NOV-03 as class: TEXT/STRS/CHARS/LINKS) % % simple calls java fnctn java.net.URLEncoder.encode(tinp, 'UTF-8') % or java.net.URLDecoder.decode(tinp, "UTF-8") (Status of: 2025-11-03) % % Introduced first in SolidGeometry 5.6 % % See also: char2html % % tout=html2char(tinp) % === INPUT PARAMETERS === % tinp: html UTF8 code % === OUTPUT RESULTS ====== % tout: ascii code % % EXAMPLE: % char2html("Bevölkerungsentwicklung") % html2char(char2html("Bevölkerungsentwicklung")) % % See also: char2html % % % Copyright 2025 Tim C. Lueth |
chatdiagramm(data,fname,todo)- Generates MATLAB code to display a diagram based on OpenAI Chat. |
| % chatdiagramm(data,fname,todo) - Generates MATLAB code to display a diagram based on OpenAI Chat. % (by Tim Lueth, SG-Lib, 2025-OKT-31 as class: ARTIFICIAL INTELLIGENCE) % % USE CAREFULLY: chatdiagramm was not being tested extensively % % written Oct 2025 for GPT 5.x (Status of: 2025-11-03) % % Introduced first in SolidGeometry 5.6 % % See also: chatdestatisJSONfindtabs, destatisJSONreadtab % % y=chatdiagramm([data,fname,todo]) % === INPUT PARAMETERS === % data: A char text with data preferably in Excel format (columns separated by % semicolons) % fname: An optional Filename; default is titleofcaller % todo: Explanation of what exactly is desired % === OUTPUT RESULTS ====== % y: matlab code for execution % % EXAMPLE: % destatisJSONfindtabs('promovierende') % [a,b,c]=destatisJSONreadtab('21352-0002'); % Loads the table from destatis genesis % chatdiagramm(c,'','Display the table as a chart') % draws a chart % chatdiagramm(c,'','Display the table as a diagram') % draws a diagram % chatdiagramm(c,'','Plot a graph showing the ratio of medicine to engineering.') % ratio calculatioo % % % See also: chatdestatisJSONfindtabs, destatisJSONreadtab % % % Copyright 2025 Tim C. Lueth |
save2clipboard(var)- simply saves the content of a variable to the "clipboard" to use it with paste |
| % save2clipboard(var) - simply saves the content of a variable to the "clipboard" to use it with paste % (by Tim Lueth, SG-Lib, 2025-OKT-31 as class: TEXT/STRS/CHARS/LINKS) % % USE CAREFULLY: save2clipboard was not being tested extensively % % works with % a) text and % b) images (Status of: 2025-11-05) % % Introduced first in SolidGeometry 5.6 % % See also: paste2code % % save2clipboard(var) % === INPUT PARAMETERS === % var: variable to be saved into the cipboard % % EXAMPLE: % c='This is a test' % save2clipboard(c) % try command-v afterwards % A=imread('peppers.png'); % save2clipboard(A) % copy in word afterwards % % See also: paste2code % % % Copyright 2025 Tim C. Lueth |
str2datenum(txt,loc)- converts am formatted date string into a date num for numerical analysis |
| % str2datenum(txt,loc) - converts am formatted date string into a date num for numerical analysis % (by Tim Lueth, SG-Lib, 2025-OKT-31 as class: TEXT/STRS/CHARS/LINKS) % % There is only once chance in matlab by using try and catch to detect wrong % dataformat. Therefor, this fnctn uses a persistant table of formats. The last % "fnctning" or correct data format is stored in the first position in the table % so that it is checked first during subsequent calls, thereby optimising speed. % (Status of: 2025-11-03) % % Introduced first in SolidGeometry 5.6 % % See also: num2strUP, sprintfvec, num2strCNT, datestr % % [dtn,wfmt]=str2datenum(txt,[loc]) % === INPUT PARAMETERS === % txt: text of date format % loc: location default is 'de_DE' % === OUTPUT RESULTS ====== % dtn: datenum % wfmt: successful date format % % EXAMPLE: % [a,b]=str2datenum('1.1.2024'), [a,b]=str2datenum('2024-okt-12') % % See also: num2strUP, sprintfvec, num2strCNT, datestr % % % Copyright 2025 Tim C. Lueth |
char2html(tinp)- converts german "Umlaute" and other speciel characters into UTF8 html code |
| % char2html(tinp) - converts german "Umlaute" and other speciel characters into UTF8 html code % (by Tim Lueth, SG-Lib, 2025-OKT-31 as class: TEXT/STRS/CHARS/LINKS) % % simple call java fnctn java.net.URLEncoder.encode(tinp, 'UTF-8') % % java.net.URLDecoder.decode(tinp, "UTF-8") (Status of: 2025-11-03) % % Introduced first in SolidGeometry 5.6 % % See also: char2rgb, html2char % % tout=char2html(tinp) % === INPUT PARAMETERS === % tinp: string including UTH chars % === OUTPUT RESULTS ====== % tout: A character string in which the special characters have been converted % into UTF-8. % % EXAMPLE: % char2html("Bevölkerungsentwicklung") % html2char(char2html("Bevölkerungsentwicklung")) % % See also: char2rgb, html2char % % % Copyright 2025 Tim C. Lueth |
JAVAemailServerImap(account,FOI)- opens a JAVA mail server account |
| % JAVAemailServerImap(account,FOI) - opens a JAVA mail server account % (by Tim Lueth, SG-Lib, 2025-OKT-24 as class: CODING/DEVELOP) % % USE CAREFULLY: JAVAemailServerImap was not being tested extensively % % must be closed finally using store.close(); % there is also always a timeout (Status of: 2025-11-05) % % Introduced first in SolidGeometry 5.6 % % [msgs,store]=JAVAemailServerImap([account,FOI]) % === INPUT PARAMETERS === % account: such as 'tim.lueth@ergosurg.com' % FOI: Folder of interest; default is 'INBOX' % === OUTPUT RESULTS ====== % msgs: ALL Messages of the FOLDER % store: connection to the server % % EXAMPLE: % [msgs,store]=JAVAemailServerImap('tim.lueth@ergosurg.com','INBOX','','imap.1und1.de') % % % Copyright 2025 Tim C. Lueth |
JAVAemailTUMimap(account,FOI,passw)- opens a JAVA imap mail server account with certificate for mail.tum.de |
| % JAVAemailTUMimap(account,FOI,passw) - opens a JAVA imap mail server account with certificate for mail.tum.de % (by Tim Lueth, SG-Lib, 2025-OKT-24 as class: CODING/DEVELOP) % % USE CAREFULLY: JAVAemailTUMimap was not being tested extensively % % This fnctn is independent on JAVAemailServerImap since an security certificate % is requireed for mail.tum.de % must be closed finally using store.close(); % there is also always a timeout (Status of: 2025-11-05) % % Introduced first in SolidGeometry 5.6 % % See also: JAVAemailServerImap, JAVAemailreadtextmessage % % [msgs,store]=JAVAemailTUMimap([account,FOI,passw]) % === INPUT PARAMETERS === % account: default is gu28kix % FOI: Folder of interest; default is 'INBOX' % passw: password for email account. No F2A support % === OUTPUT RESULTS ====== % msgs: ALL Messages of the FOLDER % store: connection to the server % % EXAMPLE: % [msgs,store]=JAVAemailTUMimap('gu28yik','INBOX'); % JAVAemailreadtextmessage(msgs(end)) % % See also: JAVAemailServerImap, JAVAemailreadtextmessage % % % Copyright 2025 Tim C. Lueth |
datetimearray(dateS,dateE)- creates a for time rows of financial data a vector of datenum dates |
| % datetimearray(dateS,dateE) - creates a for time rows of financial data a vector of datenum dates % (by Tim Lueth, SG-Lib, 2025-OKT-21 as class: TUTORIAL) % % Introduced first in SolidGeometry 5.6 % % See also: FINdataM2 % % datevec=datetimearray(dateS,dateE) % === INPUT PARAMETERS === % dateS: % dateE: % === OUTPUT RESULTS ====== % datevec: % % EXAMPLE: % datetimearray('2024-01-01','2024-12-1') % % See also: FINdataM2 % % % Copyright 2025 Tim C. Lueth |
VLELofSGfeatureSurface(SG,)- creates edge list, contour indexe list and feature surface index list of a solid |
| % VLELofSGfeatureSurface(SG,) - creates edge list, contour indexe list and feature surface index list of a solid % (by Tim Lueth, SG-Lib, 2025-SEP-29 as class: VLEL/SURFACES) % % USE CAREFULLY: VLELofSGfeatureSurface was not being tested extensively % % SGseparate is able to separate a solid into independent closed shells % (Status of: 2025-10-01) % % Introduced first in SolidGeometry 5.6 % % See also: VLELofSGfeatureEdge, SGseparate % % [VL,EL,CIL,FSIL,TT]=VLELofSGfeatureSurface(SG,[]) % === INPUT PARAMETERS === % SG: % === OUTPUT RESULTS ====== % VL: Vertex list % EL: Edge list % CIL: Contour index list % FSIL: feature surface index list % TT: Transformation matrix of the center of a surface % % EXAMPLE: % VLELofSGfeatureSurface(SGsample(54)) % % See also: VLELofSGfeatureEdge, SGseparate % % % Copyright 2025 Tim C. Lueth |
SGsocketcover(I)- returns an image relief on top of a socket cover |
| % SGsocketcover(I) - returns an image relief on top of a socket cover % (by Tim Lueth, SG-Lib, 2025-SEP-28 as class: COMPLETED CAD DESIGNS) % % The image can be loaded by imread oder imreadui (Status of: 2025-10-11) % % Introduced first in SolidGeometry 5.6 % % See also: imreadui, CPLofimage, SGofCPLz, SGconcat % % SGall=SGsocketcover(I) % === INPUT PARAMETERS === % I: Image that should become the relief % === OUTPUT RESULTS ====== % SGall: Socket cover to print % % EXAMPLE: % I=imreadui % SGsocketcover(I) % % % See also: imreadui, CPLofimage, SGofCPLz, SGconcat % % % Copyright 2025 Tim C. Lueth |
SGwriteSTEP(SG,FNAME)- This fnct exports Solid Geometries as STEP File to disk |
| % SGwriteSTEP(SG,FNAME) - This fnct exports Solid Geometries as STEP File to disk % (by Tim Lueth & Robin Schregle, SG-Lib, 2025-SEP-26 as class: IMPORT/EXPORT) % % USE CAREFULLY: SGwriteSTEP was not being tested extensively % % ISO 10303-21 AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF % Even if the SolidWorks import works on Windows, there are problems with many % other STEP importers on Mac. % There are also general problems with the self-intrusion of solids, such as % SGsample(36). (Status of: 2025-09-26) % % Introduced first in SolidGeometry 5.6 % % See also: STEPmanifoldsolidofSG, SGwriteSTL, VLFL_EXP74 % % fname=SGwriteSTEP(SG,[FNAME]) % === INPUT PARAMETERS === % SG: Solid Geometry file name % FNAME: File name % === OUTPUT RESULTS ====== % fname: STEP file name % % EXAMPLE: % SGwriteSTEP(SGbar,'A'); % SGwriteSTEP(SGsample(53),'B'); % SGwriteSTEP(SGsample(54),'C'); % SGwriteSTEP(SGsample(27),'D'); % for i=1:54; % fn=sprintf('SGsample(%d)',i); % dbprintf('"%s"',fn); % cmd=sprintf('SGwriteSTEP(%s,''%s'');',fn,fn); % eval(cmd); % end % % See also: STEPmanifoldsolidofSG, SGwriteSTL, VLFL_EXP74 % % % Copyright 2025 Tim C. Lueth |
VLFL_EXP74- Tutorial for testing the STEP exporter |
| % VLFL_EXP74 - Tutorial for testing the STEP exporter % (by Tim Lueth, SG-Lib, 2025-SEP-25 as class: TUTORIAL) % % createss samples of Solids using SGsample and exports it to SETP files in the % desktopdir (Status of: 2025-09-26) % % Introduced first in SolidGeometry 5.6 % % See also: SGwriteSTEP, SGsample % % VLFL_EXP74 % % EXAMPLE: % VLFL_EXP74 % % See also: SGwriteSTEP, SGsample % % % Copyright 2025 Tim C. Lueth |
SGtoolboxdir- return the path during development or after toolbox installation |
| % SGtoolboxdir - return the path during development or after toolbox installation % (by Tim Lueth, SG-Lib, 2025-SEP-24 as class: FILE HANDLING) % % SGlibpath and SGtoolboxdir are the same fnctn (Status of: 2025-09-24) % % Introduced first in SolidGeometry 5.6 % % See also: SGlibpath % % tbdir=SGtoolboxdir % === OUTPUT RESULTS ====== % tbdir: toolboxdir % % EXAMPLE: % SGtoolboxdir % % See also: SGlibpath % % % Copyright 2025 Tim C. Lueth |
STEPmanifoldSolidBrepofSG(SG,alpha,mm)- returns the text lines for a ISO-10303-21 AP242 Manifold Geometry Boundary Representation |
| % STEPmanifoldSolidBrepofSG(SG,alpha,mm) - returns the text lines for a ISO-10303-21 AP242 Manifold Geometry Boundary Representation % (by Tim Lueth, SG-Lib, 2025-SEP-23 as class: IMPORT/EXPORT) % % This fnctn (originally named SG2STEP) is the core of SGwriteSTEP % It was tested in September 2025 using Solidworks (Status of: 2025-09-26) % % Introduced first in SolidGeometry 5.6 % % See also: SGreadSTEPstructure, SG2STEP % % [ttorg,mm]=STEPmanifoldSolidBrepofSG(SG,[alpha,mm]) % === INPUT PARAMETERS === % SG: Solid Geoemtry to create a Manifold Geometry Bopundary representation % alpha: Limit angle for separating feature surfaces; default is 0.01 % mm: number of used step lines already for other BREPS; default is 0 % === OUTPUT RESULTS ====== % ttorg: STEP text lines for the Manifold Geometry Bopundary representation % mm: last number of created step line % % EXAMPLE: % STEPmanifoldSolidBrepofSG(SGbar); % STEPmanifoldSolidBrepofSG(SGsample(53)); % STEPmanifoldSolidBrepofSG(SGsample(54)); % STEPmanifoldSolidBrepofSG(SGsample(27)); % % See also: SGreadSTEPstructure, SG2STEP % % % Copyright 2025 Tim C. Lueth |
VLFL_EXP73- Tutorial for testing the chat fncts for the openAI interface |
| % VLFL_EXP73 - Tutorial for testing the chat fncts for the openAI interface % (by Tim Lueth, SG-Lib, 2025-SEP-18 as class: TUTORIAL) % % Introduced first in SolidGeometry 5.6 % % See also: chat, chat1 % % VLFL_EXP73 % % EXAMPLE: % VLFL_EXP73 % % See also: chat, chat1 % % % Copyright 2025 Tim C. Lueth |
cellstradjustlen(OCC)- adjust in each col of acell array or table the length of char string |
| % cellstradjustlen(OCC) - adjust in each col of acell array or table the length of char string % (by Tim Lueth, SG-Lib, 2025-SEP-16 as class: CODING/DEVELOP) % % USE CAREFULLY: cellstradjustlen was not being tested extensively % % works with cell cols und tabel cols % required for cell2mat, since some positive matlab concepts have changed over % time. (Status of: 2025-09-18) % % Introduced first in SolidGeometry 5.6 % % See also: cell2mat, uniquecell % % CC=cellstradjustlen(OCC) % === INPUT PARAMETERS === % OCC: Original cell array or table % === OUTPUT RESULTS ====== % CC: cell array or table in which all strings of a column have the same length % % EXAMPLE: % cell2mat({'A';'A B'; 'A B C'; 'A D'}) % fails adjust strlen in column % cellstradjustlen({'A';'A B'; 'A B C'; 'A D'}) % adjust strlen in column % cell2mat(cellstradjustlen({'A';'A B'; 'A B C'; 'A D'})) % does work now % % See also: cell2mat, uniquecell % % % Copyright 2025 Tim C. Lueth |
CPLremovecollinearpoints(CPL)- removes 2D/3D collinear point with different results for opened and closed CPL/CVL |
| % CPLremovecollinearpoints(CPL) - removes 2D/3D collinear point with different results for opened and closed CPL/CVL % (by Tim Lueth, SG-Lib, 2025-SEP-14 as class: CPL/CLOSED POLYGON LISTS) % % USE CAREFULLY: CPLremovecollinearpoints was not being tested extensively % % For closed and opend CPL/CVL in 2D/3D. Start and end points can be removed for % closed CPL/CVL if there is no kink when it is a closed contour.If it is an open % contour, be aware that start an endpoint will remain, even they are collinear % points (Status of: 2025-09-14) % % Introduced first in SolidGeometry 5.6 % % See also: CPLinsertcollinearpoints, CVLremstraightAmin, CVLaddauxpoints % % CPLremovecollinearpoints(CPL) % === INPUT PARAMETERS === % CPL: 2D/3D open or closed CPL; Behavior differers % % EXAMPLE: % CPLremovecollinearpoints(circshift(CPLaddauxpoints(PLsquare(10),1), 0)) % open CPL remain Start/End % CPLremovecollinearpoints(circshift(CPLaddauxpoints(PLsquare(10),1),-1)) % open CPL remain Start/End % CPLremovecollinearpoints(circshift(CPLaddauxpoints(PLsquare(10),1),+1)) % open CPL remain Start/End % % CPLremovecollinearpoints(closedCPL((circshift(CPLaddauxpoints(PLsquare(10),1), 0)))) % closed CPL % CPLremovecollinearpoints(closedCPL((circshift(CPLaddauxpoints(PLsquare(10),1), 0)))) % closed CPL % CPLremovecollinearpoints(closedCPL((circshift(CPLaddauxpoints(PLsquare(10),1), 0)))) % closed CPL % % % See also: CPLinsertcollinearpoints, CVLremstraightAmin, CVLaddauxpoints % % % Copyright 2025 Tim C. Lueth |
openedCVL(CVL,lim)- closes all contours in CPL(2D) and CVL(3D) after removal of all consecutive identical points. |
| % openedCVL(CVL,lim) - closes all contours in CPL(2D) and CVL(3D) after removal of all consecutive identical points. % (by Tim Lueth, SG-Lib, 2025-SEP-14 as class: CPL/CLOSED POLYGON LISTS) % % USE CAREFULLY: openedCVL was not being tested extensively % % just calls "openedCPL" which ist the same fnctnlity. % new speed optimized fnctn of 2025 to replace PLofCPL in future % It removes all consecutive identical points. % concept same as VLremsuccident % ii=vecnormr(CPLi-circshift(CPLi,-1))>lim; OCPLi=CPLi(ii,:); % (Status of: 2025-09-14) % % Introduced first in SolidGeometry 5.6 % % See also: PLofCPL, CPLofPL, openedCPL, closedCPL, closedCVL % % NCVL=openedCVL(CVL,[lim]) % === INPUT PARAMETERS === % CVL: Contour 2D or 3D with NaN embedded contours % lim: default is 1e-12 for removal of succeding points % === OUTPUT RESULTS ====== % NCVL: New contours 2D/3D with all open contours without any consecutive % identical point % % EXAMPLE: % openedCVL(CPLsample(47)) % 2D case % openedCVL(VLaddz(CPLsample(47))) % 3D case % openedCVL(VLaddz(closedCVL(CPLsample(47)))) % 3D case with all closed before % % % See also: PLofCPL, CPLofPL, openedCPL, closedCPL, closedCVL % % % Copyright 2025 Tim C. Lueth |
closedCVL(CVL,lim)- closes all contours in CPL(2D) and CVL(3D) after removal of all consecutive identical point before |
| % closedCVL(CVL,lim) - closes all contours in CPL(2D) and CVL(3D) after removal of all consecutive identical point before % (by Tim Lueth, SG-Lib, 2025-SEP-14 as class: CPL/CLOSED POLYGON LISTS) % % USE CAREFULLY: closedCVL was not being tested extensively % % just calls "closedCPL" which ist the same fnctnlity. % new speed optimized fnctn of 2025 to replace CPLofPL in future % It removes all consecutive identical points and adds the first as last again % concept same as VLremsuccident % ii=vecnormr(CPLi-circshift(CPLi,-1))>lim; OCPLi=CPLi(ii,:); % (Status of: 2025-09-14) % % Introduced first in SolidGeometry 5.6 % % See also: PLofCPL, CPLofPL, openedCPL, closedCPL, openedCVL % % NCVL=closedCVL(CVL,[lim]) % === INPUT PARAMETERS === % CVL: Contour 2D or 3D with NaN embedded contours % lim: default is 1e-12 for removal of succeding points % === OUTPUT RESULTS ====== % NCVL: New contours 2D/3D with all closed contours openedCPL, closedCPL, without % any consecutive identical point % % EXAMPLE: % closedCVL(openedCVL(CPLsample(47))) % 2D case % closedCVL(VLaddz(CPLsample(47))) % 3D case % closedCVL(VLaddz(openedCVL(CPLsample(47)))) % 3D case with opening before % % % See also: PLofCPL, CPLofPL, openedCPL, closedCPL, openedCVL % % % Copyright 2025 Tim C. Lueth |
closedCPL(CPL,lim)- closes all contours in CPL(2D) and CVL(3D) without any other change beside removal of all consecutive identical point before |
| % closedCPL(CPL,lim) - closes all contours in CPL(2D) and CVL(3D) without any other change beside removal of all consecutive identical point before % (by Tim Lueth, SG-Lib, 2025-SEP-14 as class: CPL/CLOSED POLYGON LISTS) % % USE CAREFULLY: closedCPL was not being tested extensively % % new speed optimized fnctn of 2025 to replace CPLofPL in future % It removes all consecutive identical points and adds the first as last again % concept same as VLremsuccident % ii=vecnormr(CPLi-circshift(CPLi,-1))>lim; OCPLi=CPLi(ii,:); % (Status of: 2025-09-14) % % Introduced first in SolidGeometry 5.6 % % See also: PLofCPL, CPLofPL, openedCPL, openedCVL, closedCVL % % NCPL=closedCPL(CPL,[lim]) % === INPUT PARAMETERS === % CPL: Contour 2D or 3D with NaN embedded contours % lim: default is 1e-12 for removal of succeding points % === OUTPUT RESULTS ====== % NCPL: New contours 2D/3D with all closed contours without any consecutive % identical point % % EXAMPLE: % closedCPL(PLofCPL(CPLsample(47))) % 2D case % closedCPL(VLaddz(CPLsample(47))) % 3D case % closedCPL(VLaddz(openedCPL(CPLsample(47)))) % 3D case with opening before % % % See also: PLofCPL, CPLofPL, openedCPL, openedCVL, closedCVL % % % Copyright 2025 Tim C. Lueth |
openedCPL(CPL,lim)- opens all contours in CPL(2D) and CVL(3D) without any other change beside removal of all consecutive identical points. |
| % openedCPL(CPL,lim) - opens all contours in CPL(2D) and CVL(3D) without any other change beside removal of all consecutive identical points. % (by Tim Lueth, SG-Lib, 2025-SEP-14 as class: CPL/CLOSED POLYGON LISTS) % % USE CAREFULLY: openedCPL was not being tested extensively % % new speed optimized fnctn of 2025 to replace PLofCPL in future % It removes all consecutive identical points. % concept same as VLremsuccident % ii=vecnormr(CPLi-circshift(CPLi,-1))>lim; OCPLi=CPLi(ii,:); % (Status of: 2025-09-14) % % Introduced first in SolidGeometry 5.6 % % See also: PLofCPL, CPLofPL, closedCPL, openedCVL, closedCVL % % NCPL=openedCPL(CPL,[lim]) % === INPUT PARAMETERS === % CPL: Contour 2D or 3D with NaN embedded contours % lim: default is 1e-12 for removal of succeding points % === OUTPUT RESULTS ====== % NCPL: New contours 2D/3D with all open contours without any consecutive % identical point % % EXAMPLE: % openedCPL(CPLsample(47)) % 2D case % openedCPL(VLaddz(CPLsample(47))) % 3D case % openedCPL(VLaddz(CPLofPL(CPLsample(47)))) % 3D case with all closed before % % % See also: PLofCPL, CPLofPL, closedCPL, openedCVL, closedCVL % % % Copyright 2025 Tim C. Lueth |
CPLplotasPSplain(CPL)- Plots each individual embedded CPL as a separate contour. |
| % CPLplotasPSplain(CPL) - Plots each individual embedded CPL as a separate contour. % (by Tim Lueth, SG-Lib, 2025-SEP-13 as class: VISUALIZATION) % % USE CAREFULLY: CPLplotasPSplain was not being tested extensively % % Due to the constant expansion of polyshape, it is necessary to have fnctns that % can still clearly represent the underlying CPL before a simplify (split point % separation), orientation change, or removal of collinear points occurs by % default. (Status of: 2025-09-13) % % Introduced first in SolidGeometry 5.6 % % See also: CPLplotasPS, CPSplot, CPLplothatched % % h=CPLplotasPSplain(CPL) % === INPUT PARAMETERS === % CPL: CPL with nan separated CPLi % === OUTPUT RESULTS ====== % h: handle % % EXAMPLE: % CPL=[PLcircle(10);nan nan;PLcircle(10)+4]; % SGfigure; CPLplotasPSplain(CPL); % SGfigure; CPLplotasPSplain(CPLsample(47)); % % See also: CPLplotasPS, CPSplot, CPLplothatched % % % Copyright 2025 Tim C. Lueth |
PLELofCPLplain(CPL,"open","closed")- returns a PL and EL and a modified CPL based on the explicit qish of "open" or "closed" |
| % PLELofCPLplain(CPL,"open","closed") - returns a PL and EL and a modified CPL based on the explicit qish of "open" or "closed" % (by Tim Lueth, SG-Lib, 2025-SEP-13 as class: PLEL/POINT LIST/EDGE LIST) % % USE CAREFULLY: PLELofCPLplain was not being tested extensively % % Works with 2D and 3D contours. "plain" means here that there is no splitpoint % separation or descomposition done! % This fnctn of 2025 is required, since the original fnctn of 2014 was modified % 2018 using the polyshape concept, which was modified by mathwork, so that since % 2024, the original concept had to be used again. Since there is in general a % problem how to handle closed and open contours, which sometimes is used % explicitly and sometimes implicitly, this fnctn returns on default closed % contours % Remember, if you use CPLrepair in 2D, this can change the orientation of the % CPLs. (Status of: 2025-09-13) % % Introduced first in SolidGeometry 5.6 % % See also: PLELofCPL, PLELofCPLsplitpoints % % [NPL,NEL,NCPL]=PLELofCPLplain([CPL,"open","closed"]) % === INPUT PARAMETERS === % CPL: Closed Polygon list including nan separated contours % "open": if used, the results describe an open contour % "closed": if use, the results describe an closed contour % === OUTPUT RESULTS ====== % NPL: New Point List % NEL: New Edge List % NCPL: New CPL, open or closed as required; % % EXAMPLE: % PLELofCPLplain(CVLsample(18)); % PLELofCPLplain(CVLsample(18),'open'); % PLELofCPLplain(CPLsample(47)); % PLELofCPLplain(CPLrepair(CPLsample(47))); % separate contours first in 2D % % See also: PLELofCPL, PLELofCPLsplitpoints % % % Copyright 2025 Tim C. Lueth |
PLELradialEdgesofCPL(CPL,R,"open","closed")- Creates 2D/3D radial edges in closed contours and open paths |
| % PLELradialEdgesofCPL(CPL,R,"open","closed") - Creates 2D/3D radial edges in closed contours and open paths % (by Tim Lueth, SG-Lib, 2025-SEP-13 as class: PLEL/POINT LIST/EDGE LIST) % % USE CAREFULLY: PLELradialEdgesofCPL was not being tested extensively % % This fnctn from 2025 always interprets the input parameter as a closed path. % There is no check for path overlaps in 2D or 3D. This fnctn also works with VL % (3D); this fnctn does not remove collinear points. This fnctn does not correct % overlaps and intersections of contours. It does not change the orientation. The % starting point will possibly moved in case of closed contours, if there is a % kink at the start point. % For paths instead of contours, "open" must be used explicitly. % % Some other effects of matlab made it necessary to reimplement the fnctn in 2025 % PLELofCPL (2014) was reimplemented by Tim Lueth (2018) using the polyshape % class, but matlab changed the behavior of polyshape several times (collinear % points, etc.), which made it impossible to track the influences of the changes. % Even empty CPLs became a problem in 2024. % This fnctn is NOT using PLELofCPL anymore. % This fnctn uses ELofn to create the edge lists % This fnctn uses "VLremsuccident" to open CPLs % This fnctn uses VLtangentcirc to create the arcs. % It uses selectNaN to separate nan separated contours. % The concept of "open" will be used in future (Status of: 2025-09-13) % % Introduced first in SolidGeometry 5.6 % % See also: VLremsuccident, VLtangentcirc % % [NPL,NEL,NCPL]=PLELradialEdgesofCPL(CPL,[R,"open","closed"]) % === INPUT PARAMETERS === % CPL: open or closed point list in 2D or 3D % R: maximum radius >0 ; default is 1 % "open": if used, the result will be an open path not a contour % "closed": if used, the result will a closed contour; this is default. % === OUTPUT RESULTS ====== % NPL: New Point list; with modified start point % NEL: New edge list; % NCPL: NEW CPL list; open or closed as defined % % EXAMPLE: % PLELradialEdgesofCPL(VLaddz(CPLofPL(PLsquare))) % PLELradialEdgesofCPL(VLaddz(CPLofPL(PLsquare)),'open') % [a,b,c]=PLELradialEdgesofCPL(VLaddz(CPLsample(3))); SGfigure; VLplot(c,'b*-'); c % [a,b,c]=PLELradialEdgesofCPL(VLaddz(CPLsample(3)),'open'); SGfigure; VLplot(c,'b*-'); c % % See also: VLremsuccident, VLtangentcirc % % % Copyright 2025 Tim C. Lueth |
CVLinsertcollinearpoints(CVL,d)- inserts collinear auxiliary points that a minimum point distance is guaranteed |
| % CVLinsertcollinearpoints(CVL,d) - inserts collinear auxiliary points that a minimum point distance is guaranteed % (by Tim Lueth, SG-Lib, 2025-SEP-12 as class: PL/POINT LISTS) % % USE CAREFULLY: CVLinsertcollinearpoints was not being tested extensively % % slightly different to RLaddauxpoints and CPLaddauxpoints % does not create collinear auxiliary points if an edge is missing! % Only if start and end point are the same, the last edge is also processed. % Same as: % PLinsertcollinearpoints == CPLinsertcollinearpoints == % CVLinsertcollinearpoints (Status of: 2025-09-12) % % Introduced first in SolidGeometry 5.6 % % See also: RLaddauxpoints, CPLaddauxpoints, VLremsuccident, % PLinsertcollinearpoints, CPLinsertcollinearpoints % % CVLN=CVLinsertcollinearpoints(CVL,[d]) % === INPUT PARAMETERS === % CVL: Point list without nan, open or closed % d: maximum point distance to guarantee % === OUTPUT RESULTS ====== % CVLN: Point list with collinear auxiliary points, open or closed as PL % % EXAMPLE: % CVLinsertcollinearpoints(CVLsample(3),1) % open edge, identical point removed % CVLinsertcollinearpoints(CVLsample(8),1) % closed contour, identical point removed % CVLinsertcollinearpoints(CVLsample(16),1) % Does work also in 3D % CVLinsertcollinearpoints(CVLsample(18),1) % Does work also with nan separated contours % % See also: RLaddauxpoints, CPLaddauxpoints, VLremsuccident, % PLinsertcollinearpoints, CPLinsertcollinearpoints % % % Copyright 2025 Tim C. Lueth |
CPLinsertcollinearpoints(CPL,d)- inserts collinear auxiliary points that a minimum point distance is guaranteed |
| % CPLinsertcollinearpoints(CPL,d) - inserts collinear auxiliary points that a minimum point distance is guaranteed % (by Tim Lueth, SG-Lib, 2025-SEP-12 as class: PL/POINT LISTS) % % USE CAREFULLY: CPLinsertcollinearpoints was not being tested extensively % % slightly different to RLaddauxpoints and CPLaddauxpoints % does not create collinear auxiliary points if an edge is missing! % Only if start and end point are the same, the last edge is also processed. % Same as: % PLinsertcollinearpoints == CPLinsertcollinearpoints == % CVLinsertcollinearpoints (Status of: 2025-09-12) % % Introduced first in SolidGeometry 5.6 % % See also: RLaddauxpoints, CPLaddauxpoints, VLremsuccident, % PLinsertcollinearpoints, CVLinsertcollinearpoints % % CPLN=CPLinsertcollinearpoints(CPL,[d]) % === INPUT PARAMETERS === % CPL: Point list without nan, open or closed % d: maximum point distance to guarantee % === OUTPUT RESULTS ====== % CPLN: Point list with collinear auxiliary points, open or closed as PL % % EXAMPLE: % CPLinsertcollinearpoints(PLsample(3),1) % open edge, identical point removed % CPLinsertcollinearpoints(PLsample(8),1) % closed contour, identical point removed % CPLinsertcollinearpoints(VLsample(16),1) % Does work also in 3D % CPLinsertcollinearpoints(VLsample(18),1) % Does work also with nan separated contours % % See also: RLaddauxpoints, CPLaddauxpoints, VLremsuccident, % PLinsertcollinearpoints, CVLinsertcollinearpoints % % % Copyright 2025 Tim C. Lueth |
PLinsertcollinearpoints(PL,d)- inserts collinear auxiliary points that a minimum point distance is guaranteed |
| % PLinsertcollinearpoints(PL,d) - inserts collinear auxiliary points that a minimum point distance is guaranteed % (by Tim Lueth, SG-Lib, 2025-SEP-12 as class: PL/POINT LISTS) % % USE CAREFULLY: PLinsertcollinearpoints was not being tested extensively % % slightly different to RLaddauxpoints and CPLaddauxpoints % does not create collinear auxiliary points if an edge is missing! % Only if start and end point are the same, the last edge is also processed. % Same as: % PLinsertcollinearpoints == CPLinsertcollinearpoints == % CVLinsertcollinearpoints (Status of: 2025-09-12) % % Introduced first in SolidGeometry 5.6 % % See also: RLaddauxpoints, CPLaddauxpoints, VLremsuccident, % CPLinsertcollinearpoints, CVLinsertcollinearpoints % % PLN=PLinsertcollinearpoints(PL,[d]) % === INPUT PARAMETERS === % PL: Point list without nan, open or closed % d: maximum point distance to guarantee % === OUTPUT RESULTS ====== % PLN: Point list with collinear auxiliary points, open or closed as PL % % EXAMPLE: % PLinsertcollinearpoints(PLsample(3),1) % open edge, identical point removed % PLinsertcollinearpoints(PLsample(8),1) % closed contour, identical point removed % PLinsertcollinearpoints(VLsample(16),1) % Does work also in 3D % PLinsertcollinearpoints(VLsample(18),1) % Does work also with nan separated contours % % See also: RLaddauxpoints, CPLaddauxpoints, VLremsuccident, % CPLinsertcollinearpoints, CVLinsertcollinearpoints % % % Copyright 2025 Tim C. Lueth |
Tflipz(T)- rotates / flips the ez axis of a HT matrix around by by 90 degree |
| % Tflipz(T) - rotates / flips the ez axis of a HT matrix around by by 90 degree % (by Tim Lueth, SG-Lib, 2025-SEP-11 as class: KINEMATICS AND FRAMES) % % in contrast to TflipR, which changes into left hand system, this fnctn rotate % around the y axis to flip the z vector, same as Trotate(eye(4),'y',pi), % Tflipz(eye(4)) but more accurate (Status of: 2025-09-11) % % Introduced first in SolidGeometry 5.6 % % See also: Tflipz, TflipR % % TN=Tflipz(T) % === INPUT PARAMETERS === % T: Standard HT matrix % === OUTPUT RESULTS ====== % TN: rotate around y by 180 deg % % EXAMPLE: % Trotate(eye(4),'y',pi), Tflipz(eye(4)) % % See also: Tflipz, TflipR % % % Copyright 2025 Tim C. Lueth |
SGofgcfsubplots(ind)- takes the current gcf, collects all patches in the subplots and creates a cell list of solids/patches |
| % SGofgcfsubplots(ind) - takes the current gcf, collects all patches in the subplots and creates a cell list of solids/patches % (by Tim Lueth, SG-Lib, 2025-SEP-08 as class: VISUALIZATION) % % USE CAREFULLY: SGofgcfsubplots was not being tested extensively % % if nargout==0; the solids are plotted using SGplotcell (Status of: 2025-09-08) % % Introduced first in SolidGeometry 5.6 % % See also: SGofgca, VLFLofgca, VLofgca, PSofgca, SGplotmultiple, SGofgca2subplots % % SG=SGofgcfsubplots([ind]) % === INPUT PARAMETERS === % ind: indices of the axis that should be considered % === OUTPUT RESULTS ====== % SG: cell array of solids in all subplots % % EXAMPLE: % loadweb JACO_robot.mat; SGsurfaces(JC1); % SGofgca2subplots % SGofgcfsubplots % % % See also: SGofgca, VLFLofgca, VLofgca, PSofgca, SGplotmultiple, SGofgca2subplots % % % Copyright 2025 Tim C. Lueth |
