Last change of this documentation page: 2022-06-02 of SolidGeometry 4.4
exp_2019_01_27_chair- EXPERIMENT TO EXPLAIN THE DESIGN OF PATIENT INDIVIDUAL KINEMATIC OPTIMIZED CHAIRS

exp_2019_01_27_chair% exp_2019_01_27_chair - EXPERIMENT TO EXPLAIN THE DESIGN OF PATIENT INDIVIDUAL KINEMATIC OPTIMIZED CHAIRS
% (by Tim Lueth, VLFL-Lib, 2019-JAN-27 as class: EXPERIMENTS)
%
% Introduced first in SolidGeometry 4.4
%
% See also: PoseofCPLcutui
%
% exp_2019_01_27_chair
%
% See also: PoseofCPLcutui
%
%
% Copyright 2019-2021 Tim C. Lueth

poseofPSanalyze(XX,i)- returns a Pose and a CPL from an analyzeed 3 Pose Polygon

poseofPSanalyze(XX,i)% poseofPSanalyze(XX,i) - returns a Pose and a CPL from an analyzeed 3 Pose Polygon
% (by Tim Lueth, VLFL-Lib, 2019-JAN-27 as class: KINEMATICS AND FRAMES)
%
% Auxiliary fnctn to automatically select contours and creates poses from
% them (Status of: 2019-01-28)
%
% Introduced first in SolidGeometry 4.4
%
% See also: PSanalyze, TofPose, Posesample, Poseplot, Posenorm, Poseui,
% poseofPSanalyz
%
% [PS,CPL]=poseofPSanalyze(XX,i)
% === INPUT PARAMETERS ===
% XX: Result of PSanalyze
% i: optional selection if there several polygon as set of at least 3
% copies
% === OUTPUT RESULTS ======
% PS: PS.A start points PS.B end Point PS.CPL moving CPL.
% CPL: Kontour of a CPL that exist at least 3 times
%
% EXAMPLE:
% XX=PSanalyze; XX.id
% poseofPSanalyze(XX); PS=ans;
%
%
% See also: PSanalyze, TofPose, Posesample, Poseplot, Posenorm, Poseui,
% poseofPSanalyz
%
%
% Copyright 2019 Tim C. Lueth

CPLsplitbool(CPLA,CPLC);- returns a CPL that is split into two pre more parts by a second contour

CPLsplitbool(CPLA,CPLC);% CPLsplitbool(CPLA,CPLC); - returns a CPL that is split into two pre more parts by a second contour
% (by Tim Lueth, VLFL-Lib, 2019-JAN-27 as class: CLOSED POLYGON LISTS)
%
% This fnctn is helpful in combination with a interactive selected
% contour. (Status of: 2019-02-09)
%
% Introduced first in SolidGeometry 4.4
%
% See also: CPLbool, CPLboolpshape, CPLmeltbool, CPLsplitui
%
% [CPLA,CPLB,CPLC]=CPLsplitbool(CPLA,[CPLC]);
% === INPUT PARAMETERS ===
% CPLA: CPL to be splitted
% CPLC: CPL that overlaps with CPLA
% === OUTPUT RESULTS ======
% CPLA: CPLA minus CPLB (BLUE)
% CPLB: XOR of CPLA and CPLC (RED)
% CPLC: CPLC used to cut; if interactive mode was used;
%
% EXAMPLE: loadweb chair.mat
% SGfigure; CPLplot(cplchair,'b-',3);
% VLui; CPLc=ans(:,1:2); CPLplot(CPLc,'r-');
% CPLsplitbool(cplchair,CPLc);
%
% See also: CPLbool, CPLboolpshape, CPLmeltbool, CPLsplitui
%
%
% Copyright 2019 Tim C. Lueth

CPLfourbarlinkage2(P1,P2,P3,P4,P5,R12,CPLX,dw)- creates for a specified fourbar linkage the cpls for crank, coupler, swing

CPLfourbarlinkage2(P1,P2,P3,P4,P5,R12,CPLX,dw)% CPLfourbarlinkage2(P1,P2,P3,P4,P5,R12,CPLX,dw) - creates for a specified fourbar linkage the cpls for crank, coupler, swing
% (by Tim Lueth, VLFL-Lib, 2019-JAN-22 as class: CLOSED POLYGON LISTS)
%
% The same fnctn as the original of 2018-12-17 but in this version P5 has
% the definition from k=0 means P2 and k=norm(P3-P2) means P2 and the
% dimension is in millimeter. Therfore P5 is completely defined in a mm
% coordinate system realative to the coupler point P2
% 1. Create Poses as List of Startpoints A and Endpoints B uses
% Posesample or Poseui:
% >> PS=Poseui(3,.2); SGfigure; Poseplot(PS);
% >> PS.A=[-0.00 0.00; 0.00 1.00; 1.00 3.00]; PS.B=[ 1.00 0.00; 1.00
% 1.00; 1.71 2.29];
% 2. Calculate a set of parameter variations for possible Solutions:
% >> center3Pose(PS.A,PS.B,-20:20,-20:5:20,-3:.2:3); S=ans; whos C;
% 3. Calculate and analyze all possible permutations of the parameter
% variation:
% >> checkfourbar3Posepermutation(PS.A,PS.B,S); FP=ans;
% 4. Limit the Solution to your needs by limiting the permutations, for
% example
% FULL ROTATION 'u',0 DIMENSION 'l1l2rd',[5 8]
% checkfourbar3Posepermutation(PS.A,PS.B,FP,'','u',0,'l1l2rd',[2 4]);
% OR FULL ROTATION 'u',0 BASES INSIDE AN AREA
% checkfourbar3Posepermutation(PS.A,PS.B,FP,'','cpl',PLcircle(2)+[3
% 3],'l1l2rd',[0 3]);
%
% (Status of: 2019-02-22)
%
% Introduced first in SolidGeometry 4.4
%
% See also: invkinplan2, CPLfourbarlinkage, center3Pose,
% checkfourbar3Posepermutation
%
% [CPL1,CPL2,CPLR,CPL,R12,CPLX,TX,dt]=CPLfourbarlinkage2([P1,P2,P3,P4,P5,
% R12,CPLX,dw])
% === INPUT PARAMETERS ===
% P1: A0 Position of Crank Center
% P2: A1 Position of TCP (end of coupler)
% P3: B1 Position of link 1 (start of coupler)
% P4: B0 Position of Base of link 1 (2R robot base)
% P5: C0 Position of POI in mm or [POI delta x]
% R12: Ro and Ri Outer and inner Radius
% CPLX: Contour of the Shape linked to POI
% dw: turning angle
% === OUTPUT RESULTS ======
% CPL1: CPL of swing, 2R-robot link 1
% CPL2: CPL of coupler, 2R-robot link 2
% CPLR: CPL of crank, radial position specification
% CPL: complete contour for sweeping
% R12: [Ro and Ri] Outer and inner Radius
% CPLX: CPL of Final Contour
% TX: Final transformation matrix
%
% EXAMPLE:
% CPLfourbarlinkage2('','','','',20);
% CPLfourbarlinkage2('','','','',0);
% CPLfourbarlinkage2('','','','',-40);
% CPLfourbarlinkage2('','','','',+80);
% CPLfourbarlinkage2('','','','',[+20 20]);
% CPLfourbarlinkage2('','','','',[+20 20],'',CPLsample(34)*10);
%
%
% See also: invkinplan2, CPLfourbarlinkage, center3Pose,
% checkfourbar3Posepermutation
%
%
% Copyright 2019 Tim C. Lueth

checkfourbar3Posepermutation(A,B,S,dws)- calculates from a center3pose solution all possible permutations and the fourbar parameters

checkfourbar3Posepermutation(A,B,S,dws)% checkfourbar3Posepermutation(A,B,S,dws) - calculates from a center3pose solution all possible permutations and the fourbar parameters
% (by Tim Lueth, VLFL-Lib, 2019-JAN-20 as class: KINEMATICS AND FRAMES)
%
% FP contains the complete solution list for all permutations w.r.t. to
% the specified conditions
% [L1 L2 R D C U A0 B0 iA iB kA kBd w]
% Results can be animated by
% >>
% fourBarLinkageplotanim(FP(l,1),FP(l,2),FP(l,3),[FP(l,7:8);FP(l,9:10)],'
% ',FP(l,5)==2,[],[FP(l,13), FP(l,16) FP(l,15)]);
%
% THIS FNCTN IS PART OF THE SEQUENCE
% 1. Create Poses as List of Startpoints A and Endpoints B uses
% Posesample or Poseui:
% >> PS=Poseui(3,.2); SGfigure; Poseplot(PS);
% >> PS.A=[-0.00 0.00; 0.00 1.00; 1.00 3.00]; PS.B=[ 1.00 0.00; 1.00
% 1.00; 1.71 2.29];
% 2. Calculate a set of parameter variations for possible Solutions:
% >> center3Pose(PS.A,PS.B,-20:20,-20:5:20,-3:.2:3); S=ans; whos C;
% 3. Calculate and analyze all possible permutations of the parameter
% variation:
% >> checkfourbar3Posepermutation(PS.A,PS.B,S); FP=ans;
% 4. Limit the Solution to your needs by limiting the permutations, for
% example
% FULL ROTATION 'u',0 DIMENSION 'l1l2rd',[5 8]
% checkfourbar3Posepermutation(PS.A,PS.B,FP,'','u',0,'l1l2rd',[2 4]);
% OR FULL ROTATION 'u',0 BASES INSIDE AN AREA
% checkfourbar3Posepermutation(PS.A,PS.B,FP,'','cpl',PLcircle(2)+[3
% 3],'l1l2rd',[0 3]);
% (Status of: 2019-01-22)
%
% Introduced first in SolidGeometry 4.4
%
% See also: center3Pose, checkfourbar3Pose, checkfourbar3Posepermutation
%
%
% [FP,FPall]=checkfourbar3Posepermutation(A,B,S,[dws])
% === INPUT PARAMETERS ===
% A: Pose starting points
% B: Pose end points
% S: Solutions created by center3Pose
% dws: distance and angle; default is first
% === PROPERTY NAMES =====
% 'L1' : Interval for L1; default is [0 inf]
% 'L2' : Interval for L12; default is [0 inf]
% 'R' : Interval for R; default is [0 inf]
% 'D' : Interval for D; default is [0 inf]
% 'C' : Interval for elbow-config C; default is [1 2]
% 'U' : Values for rotation [0 1 10 11]
% 'ka' : Interval for kA; default is [0 inf]
% 'kb' : Interval for kB; default is [0 inf]
% 'x' : ?
% 'y' : ?
% 'CPLA' : ?
% 'CPLB' : ?
% === OUTPUT RESULTS ======
% FP: Existing Solution list [L1 L2 R D C U A0 B0 iA iB kA kBd w]
% FPall: Table containing all possible parameters
%
% EXAMPLE:
% center3Pose(PS.A,PS.B,[-20:.1:20],'',0); S=ans; CPLplot(CPLsample(4)); FP=checkfourbar3Posepermutation(PS.A,PS.B,S);
% checkfourbar3Posepermutation(PS.A,PS.B,FP,'');
% checkfourbar3Posepermutation(PS.A,PS.B,FP,'','l1rd',[4 12]);
%
%
% See also: center3Pose, checkfourbar3Pose, checkfourbar3Posepermutation
%
%
%
% Copyright 2019 Tim C. Lueth

CPLremFFT(CPLin,percent)- removes points from a CPL by removing high frequencies

CPLremFFT(CPLin,percent)% CPLremFFT(CPLin,percent) - removes points from a CPL by removing high frequencies
% (by Alexandra Mercader, VLFL-Lib, 2019-JAN-16 as class: CLOSED POLYGON
% LISTS)
%
% This fnctn removes high frequencies of x and y coordinates of contours.
% The FFT is the method that is used for selecting the low frequencies
% and deleting high frequencies of the point list.
% Remark: in fftshift matlab tutorial, for even number of elements there
% is one frequence more in the negative part of the transformated vector
%
% In contrast to CPLfft this fnctn does not insert auxiliary points into
% the shape and therefor the fourier analysis considers the points as
% minimum equidistant number of points(!). Therefor CPLremFFT removes
% redundant auxiliary points of a shape. BE SURE that you know the number
% of relevant points before using this fnctn.
%
% (Status of: 2019-03-06)
%
% See also: CPLfft, CPLremstraightAmin, CVLremstraight
%
% CPLout=CPLremFFT(CPLin,percent)
% === INPUT PARAMETERS ===
% CPLin: Close point list
% percent: Percentage <0..100> of the number of points that remain
% === OUTPUT RESULTS ======
% CPLout: CPL with reduced number of points
%
% EXAMPLE:
% CPLremFFT(PLcircle(5),50)
% CPL=PLcircle(5); whos CPL, CPLremFFT(CPL,50); CPLN=ans; whos CPLN
% CPL=PLcircle(5); whos CPL, CPLremFFT(CPL,50); CPLN=ans; whos CPLN
% CPL=PLcircle(5); whos CPL, CPLremFFT(CPL,100); CPLN=ans; whos CPLN
% CPL=PLsquare(5); whos CPL, CPLremFFT(CPL,50); CPLN=ans; whos CPLN
%
% See also: CPLfft, CPLremstraightAmin, CVLremstraight
%

exp_2019_01_16_4barcases- EXPERIMENT THAT SHOWS THE MAIN CONFIGURATIONS OF A FOURBAR LINKAGE

exp_2019_01_16_4barcases% exp_2019_01_16_4barcases - EXPERIMENT THAT SHOWS THE MAIN CONFIGURATIONS OF A FOURBAR LINKAGE
% (by Tim Lueth, VLFL-Lib, 2019-JAN-16 as class: EXPERIMENTS)
%
% Educational Purpose
% This fnctn shows the most common configurations of a fourbarlinkage for
% educational purpose (Status of: 2019-01-16)
%
% Introduced first in SolidGeometry 4.4
%
% See also: invkinplan2, fourBarLinkageplotanim
%
% exp_2019_01_16_4barcases
%
% See also: invkinplan2, fourBarLinkageplotanim
%
%
% Copyright 2019 Tim C. Lueth

CPLgripperjaw(CPL,P0,CPL0,hg)- creates a contour for a gripper design

CPLgripperjaw(CPL,P0,CPL0,hg)% CPLgripperjaw(CPL,P0,CPL0,hg) - creates a contour for a gripper design
% (by Tim Lueth, VLFL-Lib, 2019-JAN-16 as class: CLOSED POLYGON LISTS)
%
% This fnctn can be used to create a first design for a gripper jaw for a
% known contour. The first parameter is the contour to be gripped at the
% zero line Y=0; the second parameter is the relative position P0 of the
% TCP or the attachment point of the gripper to a kinematic system. The
% third parameter is the contour around the attachment points P0. The
% fourth parameter h0 describes how deep the gripper should plunge into
% the contour to be gripped under Y=0 line. Y=0-h0
% The fifth parameter describes whether the gripper should only represent
% the convex hull of the object. (Status of: 2019-01-18)
%
% Introduced first in SolidGeometry 4.4
%
% See also: CPLfourbarlinkage
%
% [CPLF,CPLF0]=CPLgripperjaw([CPL,P0,CPL0,hg])
% === INPUT PARAMETERS ===
% CPL: Object contour to be grasped (Orange)
% P0: Position of TCP
% CPL0: Contour around TCP (green)
% hg: depth of gripper jaw into the object
% === OUTPUT RESULTS ======
% CPLF: Final Gripper Jaw Contour (red contour)
% CPLF0: Final Gripper Jaw Contour (red contour) with origin in P0
%
% EXAMPLE:
% CPLgripperjaw(CPLsample(4)-[0 9],[0 5],PLsquare(30,2),5)
% CPLgripperjaw(CPLsample(21)-[0 9],[0 30],PLsquare(30,2),0);
% CPLgripperjaw(CPLsample(21)-[0 9],[0 30],PLsquare(30,2),0,true);
% CPLgripperjaw(PLsquare(20,2)-[0,1],[0 10],PLcircle(4));
% [a,b]=CPLgripperjaw; SGfigure; CPLplot(a,'r-');CPLplot(b,'-b')
%
% See also: CPLfourbarlinkage
%
%
% Copyright 2019 Tim C. Lueth

realfourbarsolutions(rs,mtyp)- creates an index list to map fourbarlinkage solution points to movement types

realfourbarsolutions(rs,mtyp)% realfourbarsolutions(rs,mtyp) - creates an index list to map fourbarlinkage solution points to movement types
% (by Tim Lueth, VLFL-Lib, 2019-JAN-15 as class: KINEMATICS AND FRAMES)
%
% This fnctn analyzes the results of the invkinplan2 fnctn for a circular
% path and generates an index list with which all invkinplan2 results can
% be mapped for a motion simulation. (Status of: 2019-05-12)
%
% Introduced first in SolidGeometry 4.4
%
% See also: miofPLA0B0, invkinplan2, checkfourbarsegment,
% shiftindexofinvkinplan2
%
% [nni,seg]=realfourbarsolutions(rs,[mtyp])
% === INPUT PARAMETERS ===
% rs: real solution flag of invkinplan2
% mtyp: 'forw', 'backw', 'alt'
% === OUTPUT RESULTS ======
% nni: mapping index for PL, B1, B2, W, U of invkinplan2
% seg: 0 = closed movement, 1 = one segment, 2 - two segments
%
% EXAMPLE:
% invkinplan2(70,40,[50 -65 0]); [~,~,B1,B2,rs,PL]=invkinplan2(70,40,[50 -65 0]);
% [nni,seg]=realfourbarsolutions(rs,'forw'), PLA=PL(nni(seg==1),:), PLB=PL(nni(seg==2),:)
% PLplot(PLA,'c',4); PLplot(PLB,'y',4); shg;
%
% [~,~,B1,B2,rs,PL]=invkinplan2(70,40,[50 -65 0]);
% [nni,seg]=realfourbarsolutions(rs,'forw'), PLA=PL(nni(seg==1),:), PLB=PL(nni(seg==2),:)
% ns=max(seg); for i=1:ns; PLi=PL(nni(seg==i),:), PLplot(PLi,colofn(i+1,'bcy'),4); end; shg; view(0,90);
%
% See also: miofPLA0B0, invkinplan2, checkfourbarsegment,
% shiftindexofinvkinplan2
%
%
% Copyright 2019 Tim C. Lueth

miofPLA0B0(PL,A0,B0)- returns the index of the minimal relative angle to the axis between A0 and B0

miofPLA0B0(PL,A0,B0)% miofPLA0B0(PL,A0,B0) - returns the index of the minimal relative angle to the axis between A0 and B0
% (by Tim Lueth, VLFL-Lib, 2019-JAN-14 as class: KINEMATICS AND FRAMES)
%
% This fnctn is used to find the circshift index for the point list of a
% fourbar-linkage. The original PL describes a circle around P0 starting
% at 0 degrees to 360 degrees. However, it makes more sense to rotate the
% PL relative to the axis A0B0. Therefore all results of invkinplan2 have
% to be circshifted.
% This auxiliary fnctn is used in fourBarLinkageplotanim. (Status of:
% 2019-05-12)
%
% Introduced first in SolidGeometry 4.4
%
% See also: invkinplan2, fourBarLinkageplotanim, checkfourbarsegment,
% shiftindexofinvkinplan2, realfourbarsolutions
%
% mi=miofPLA0B0(PL,A0,B0)
% === INPUT PARAMETERS ===
% PL: Point List (A1) of a fourbar linkage
% A0: Base Point A0
% B0: Base Point B0
% === OUTPUT RESULTS ======
% mi: shift index for PL=circshift(PL,-mi)
%
% EXAMPLE:
% miofPLA0B0(PLcircle(10),[0 0],[10 10])
% miofPLA0B0(PLcircle(10)+[5 4],[5 4],[10 10])
% % mi=miofPLA0B0(PL,A0,B0); PL=circshift(PL,-mi); B1=circshift(B1,-mi);
%
% See also: invkinplan2, fourBarLinkageplotanim, checkfourbarsegment,
% shiftindexofinvkinplan2, realfourbarsolutions
%
%
% Copyright 2019 Tim C. Lueth

checkfourbarcouplerlength(B1,B2,PL,l2chk,tol)- checks the solutions of invkinplan2 for a fourbar linkage calculation

checkfourbarcouplerlength(B1,B2,PL,l2chk,tol)% checkfourbarcouplerlength(B1,B2,PL,l2chk,tol) - checks the solutions of invkinplan2 for a fourbar linkage calculation
% (by Tim Lueth, VLFL-Lib, 2019-JAN-13 as class: KINEMATICS AND FRAMES)
%
% for some unexpected and unclear reasons, the inverse kinematic
% equations have some numerical instability. This fnctn was implemented
% and is used within invkinplan2 to warn if the calculations contains
% numerical errors. (Status of: 2019-01-13)
%
% Introduced first in SolidGeometry 4.4
%
% See also: invkinplan2
%
% [ok,ind1,ind2,err,r1,r2]=checkfourbarcouplerlength(B1,B2,PL,[l2chk,tol])
% === INPUT PARAMETERS ===
% B1: REAL Solutions of joint 1 configuration ellbow down
% B2: REAL Solutions of joint 1 configuration ellbow up
% PL: REAL Point list for TCP
% l2chk: expected length of link 2
% tol: tolerance default is 1e-7 , i.e. eps2
% === OUTPUT RESULTS ======
% ok: true of there is no problem
% ind1: index of B1 with problem
% ind2: index of B2 with problem
% err: maximum accoured error
% r1: average link length l2 for configuration ellbow down
% r2: average link length l2 for configuration ellbow up
%
% EXAMPLE:
% [~,~,B1,B2,rs,PL]=invkinplan2(70,40,[40 -110 0 120]); B1=B1(rs,:); B2=B2(rs,:); PL=PL(rs,:); checkfourbarcouplerlength(B1,B2,PL,40)
%
% See also: invkinplan2
%
%
% Copyright 2019 Tim C. Lueth

center3Poseconditions(S,)- returns a reduced Solution matrix for the given S values of

center3Poseconditions(S,)% center3Poseconditions(S,) - returns a reduced Solution matrix for the given S values of
% (by Tim Lueth, VLFL-Lib, 2019-JAN-13 as class: KINEMATICS AND FRAMES)
%
% =======================================================================
% OBSOLETE (2019-01-26) - USE 'checkfourbar3Posepermutation' INSTEAD
% =======================================================================
%
% The condition independent on the displacement and turning angle are
% Radius - To limit the radius of Crank and Swing
% Area - To define the base point area from the design point of view
%
% The condition that on the displacement and turning angle are
% Pair Distance - To limit the distance of a pair of base points
% Exist 4bar - there exist a fourbar configuration solution
%
% The sequence of 3 Pose synthesis calculation of fourbar linkages is:
% 1. center3Pose - calculates a 3D array of solutions for 3 poses
% 2. center3Poseconditions, - reduces solutions f.e. radius,area
% 3. checkfourbar3Poses - analyses the configuration of the solution
% 4. checkallfourbar3Poses - analyses all solutions's configurations
% The shape of a linkage is created by:
% A) CPLfourbarlinkage - creates 2D contours of the links
% B) CPLgripperjaw - creates 2D contour of a gripper that grasps an object
% and animated by:
% B) fourBarLinkageplot - shows several solutions for two configurations
% C) fourBarLinkageplotanim - animates the movement of a complete contour
% All those fnctns are based on
% invkinplan2 - that calculates both configurations for a planar 2bar
% linkage
% (Status of: 2019-01-26)
%
% Introduced first in SolidGeometry 4.4
%
% See also: [ checkfourbar3Posepermutation ] ; center3Pose,
% checkfourbar3Poses
%
% S=center3Poseconditions(S,[])
% === INPUT PARAMETERS ===
% S: Original Solution list from center3Pose
% === PROPERTY NAMES =====
% 'r' : maximal Radius [Rmax] or [Rmin Rmax] - RED ERRORS
% 'area' : CPL of the allowed area for Centers - BLUE ERRORS
% 'pair' : Distance of base point pairs [dmax] or [dmin dmax]
% === OUTPUT RESULTS ======
% S: Solution list with removed lines that do not fullful the conditions
%
% EXAMPLE:
% PS.A=[-3.88 10.85; -3.88 12.40; 10.08 17.05]; PS.B=[ -2.88 10.85; -2.88 12.40; 11.04 16.79];
% center3Pose(PS.A,PS.B,-10:40); S=ans, CPLplot(CPLsample(4));
% center3Poseconditions(S,'r',[10 60]), CPLplot(CPLsample(4)); Poseplot(PS)
%
% See also: [ checkfourbar3Posepermutation ] ; center3Pose,
% checkfourbar3Poses
%
%
% Copyright 2019 Tim C. Lueth

fourBarLinkageplot(l1,l2,r,A0,np)- plots and animates the movement of a fourbar linkage

fourBarLinkageplot(l1,l2,r,A0,np)% fourBarLinkageplot(l1,l2,r,A0,np) - plots and animates the movement of a fourbar linkage
% (by Tim Lueth, VLFL-Lib, 2019-JAN-12 as class: VISUALIZATION)
%
% Introduced first in SolidGeometry 4.4
%
% See also: CPLfourbarlinkage, fourBarLinkageplotanim
%
% h=fourBarLinkageplot([l1,l2,r,A0,np])
% === INPUT PARAMETERS ===
% l1: length of link1 at Base B0
% l2: length of link2 / coupler
% r: radius of crank at Base A0 or Point List around A0
% A0: distance, A0-B0, Position of A0 or List [A0;B0]
% np: number of points on the crank circle
% === OUTPUT RESULTS ======
% h: handle to last graphics objects
%
% EXAMPLE:
% SGfigure; axis([-100 100 -100 100]); h=fourBarLinkageplot (50,70,50,[30 30; 35 35]); shg
% SGfigure; axis([-100 100 -100 100]); h=fourBarLinkageplot (50,70,50,[30 30; 35 35],10); shg
% SGfigure; axis([-100 100 -100 100]); h=fourBarLinkageplot (100,70,40,100,50); shg
% SGfigure; fourBarLinkageplot(4,4,PLcircle(3,3)+[-4 0]); shg
%
% See also: CPLfourbarlinkage, fourBarLinkageplotanim
%
%
% Copyright 2019 Tim C. Lueth

fourBarLinkageplotanim(l1,l2,r,A0,tmove,elup,transl,ka)- plots and animates the movement of a fourbar linkage

fourBarLinkageplotanim(l1,l2,r,A0,tmove,elup,transl,ka)% fourBarLinkageplotanim(l1,l2,r,A0,tmove,elup,transl,ka) - plots and animates the movement of a fourbar linkage
% (by Tim Lueth, VLFL-Lib, 2019-JAN-12 as class: VISUALIZATION)
%
% THERE ARE MORE THAN 8 PARAMETER! 9th parameter is CPLE Effector Contour
% 10th is 'angle' is an optional Porpertyname for angle areas. Important
% fnctn for simulating the movement of forbarlinkages.There is a ninth
% parameter, the CPL-shape of the tool attached to the coupler position
% at [ka w d]. By default this CPL is a L-shaped ccordinate system.
% (Status of: 2021-12-05)
%
% Introduced first in SolidGeometry 4.4
%
% See also: CPLfourbarlinkage, fourBarLinkageplot, CPLfourbarlinkage2,
% CPLfourbarcontour
%
% h=fourBarLinkageplotanim([l1,l2,r,A0,tmove,elup,transl,ka])
% === INPUT PARAMETERS ===
% l1: length of link1 at Base B0
% l2: length of link2 / coupler
% r: radius of crank at Base A0
% A0: distance, A0-B0, Position of A0 or List [A0;B0]
% tmove: time to animate; default is 2 sec
% elup: elbow up (true) elbow down (false); default is false;
% transl: transparancey for swept volume (0..1); default is 0;
% ka: either ka or[ka w] or [ka w disp]
% === PROPERTY NAMES =====
% 'alpha' : optional angle limitation [wmin wmax]
% === OUTPUT RESULTS ======
% h: handle to last graphics objects
%
% EXAMPLE:
% axis([-100 100 -100 100]); h=fourBarLinkageplotanim (50,70,50,[30 30; 35 35],10,true); shg
% axis([-100 100 -100 100]); h=fourBarLinkageplotanim (50,70,50,[30 30; 35 35],10,false); shg
% SGfigure; fourBarLinkageplotanim(70,40,40,[0 0; 0 110]);
% SGfigure; fourBarLinkageplotanim([110,50,110,60]); % A0-B0, B0-B1, B1-A1; A1-A0
%
% See also: CPLfourbarlinkage, fourBarLinkageplot, CPLfourbarlinkage2,
% CPLfourbarcontour
%
%
% Copyright 2019-2021 Tim C. Lueth

checkallfourbar3Poses(A,B,Sall,CPL)- checks whether a fourbar joint solution exists for results of center3Pose

checkallfourbar3Poses(A,B,Sall,CPL)% checkallfourbar3Poses(A,B,Sall,CPL) - checks whether a fourbar joint solution exists for results of center3Pose
% (by Tim Lueth, VLFL-Lib, 2019-JAN-10 as class: KINEMATICS AND FRAMES)
%
% =======================================================================
% OBSOLETE (2019-01-26) - USE 'checkfourbar3Posepermutation' INSTEAD
% =======================================================================
%
% r= S(ka,4); % radius of crank
% l1=S(kb,4); % radius of follower
% l2=S(kb,1)-S(ka,1); % length of coupler
% do=S(ka,5); % displacement of coupler
% wo=S(ka,6); % Angle deviation before displacement
% A0=S(ka,2:3); % Base of crank
% B0=S(kb,2:3); % Base of follower
% d=norm(A0-B0); % distance between both bases
%
% The sequence of 3 Pose synthesis calculation of fourbar linkages is:
% 1. center3Pose - calculates a 3D array of solutions for 3 poses
% 2. center3Poseconditions, - reduces solutions f.e. radius,area
% 3. checkfourbar3Poses - analyses the configuration of the solution
% 4. checkallfourbar3Poses - analyses all solutions's configurations
% The shape of a linkage is created by:
% A) CPLfourbarlinkage - creates 2D contours of the links
% B) CPLgripperjaw - creates 2D contour of a gripper that grasps an object
% and animated by:
% B) fourBarLinkageplot - shows several solutions for two configurations
% C) fourBarLinkageplotanim - animates the movement of a complete contour
% All those fnctns are based on
% invkinplan2 - that calculates both configurations for a planar 2bar
% linkage
%
% (Status of: 2019-01-24)
%
% Introduced first in SolidGeometry 4.4
%
% See also: [ checkfourbar3Posepermutation ] ; center3Pose,
% checkfourbar3Pose, Posesample, Poseplot, TofPose, Posenorm, Poseui
%
% [C,SNN]=checkallfourbar3Poses(A,B,Sall,[CPL])
% === INPUT PARAMETERS ===
% A: Starting Points of 3 Poses
% B: Ending Points of 3 Poses
% Sall: Solutions comming from center3Pose
% CPL: selected pair of distance and angle
% === OUTPUT RESULTS ======
% C: configuration for pose of a fourbar linkage
% SNN:
%
% EXAMPLE:
% PS.A=[10.50 -4.38; 3.50 -10.50; -5.25 -10.50]; PS.B=[ 9.79 -5.08; 2.50 -10.50; -5.96 -9.79];
% center3Pose(PS.A,PS.B,[-10 00],0,-pi/4); S=ans, CPLplot(CPLsample(4)); checkfourbar3Pose(PS.A,PS.B,S,'verbose
%
% See also: [ checkfourbar3Posepermutation ] ; center3Pose,
% checkfourbar3Pose, Posesample, Poseplot, TofPose, Posenorm, Poseui
%
%
% Copyright 2019 Tim C. Lueth

TofPose(AL,BL,ind)- returns 3x3 HT matrices for planar transformation in 2D from pose list

TofPose(AL,BL,ind)% TofPose(AL,BL,ind) - returns 3x3 HT matrices for planar transformation in 2D from pose list
% (by Tim Lueth, VLFL-Lib, 2019-JAN-05 as class: KINEMATICS AND FRAMES)
%
% Powerful planar fnctn to create either a HT matrix from two points or a
% list of HT matrixes from a list of points or from a Pose struct PS.A,
% PS.B.
% TofPose - Frame of A1 from Point A1 and B1
% TofPoseGPL - Frames of A1 and B1 from Pose and GPL
% TofA1B1GPL - Frame of Pose from A1 and B1 and GPL
% TofPoseattachmentpoints - Frames of B1 and A1 from Pose qnd Points A1
% and B1
% (Status of: 2021-12-10)
%
% Introduced first in SolidGeometry 4.4
%
% See also: TofPoseattachmentpoints, Posesample, Poseplot, Posenorm,
% Poseui, center3Pose, checkfourbar3Pose, poseofPSanalyze
%
% TAi=TofPose(AL,[BL,ind])
% === INPUT PARAMETERS ===
% AL: Point list [n x 2] for points A or a struct with fields A and B
% BL: Point list [n x 2] for points B
% ind: selected indices; default is all
% === OUTPUT RESULTS ======
% TAi: Transformation Matrix in A for each Pose; ex = B(i,:)-A(i,:);
% t=A(i,;)
%
% EXAMPLE:
% Pose=Posesample(7), TofPose(Pose.A,Pose.B)
% PS.A=PLcircle(10,36); PS.B=PS.A*2; TofPose(PS)
%
% See also: TofPoseattachmentpoints, Posesample, Poseplot, Posenorm,
% Poseui, center3Pose, checkfourbar3Pose, poseofPSanalyze
%
%
% Copyright 2019-2021 Tim C. Lueth

Posenorm(PS,l,ka)- changes the length of pose vectors to a common length and shifts the start point

Posenorm(PS,l,ka)% Posenorm(PS,l,ka) - changes the length of pose vectors to a common length and shifts the start point
% (by Tim Lueth, VLFL-Lib, 2019-JAN-05 as class: KINEMATICS AND FRAMES)
%
% Introduced first in SolidGeometry 4.4
%
% See also: Posesample, Poseplot, TofPose, Poseui, center3Pose,
% checkfourbar3Pose
%
% [PS,e,o]=Posenorm(PS,[l,ka])
% === INPUT PARAMETERS ===
% PS: Pose.A and Pose.B
% l: desired length; default is 1
% ka: starting offset relative to A
% === OUTPUT RESULTS ======
% PS: Adjusted Pose.A and Pose.B
% e: direction vector
% o: orthogonal vector
%
% EXAMPLE:
% Posenorm(Posesample(7))
% Posenorm(Posesample(7),10)
% Posenorm(Posesample(7),10,-10)
% [a,b,c]=Posenorm(PS,10)
%
% See also: Posesample, Poseplot, TofPose, Poseui, center3Pose,
% checkfourbar3Pose
%
%
% Copyright 2019 Tim C. Lueth

Poseui(m,res,ax)- returns a pose struct

Poseui(m,res,ax)% Poseui(m,res,ax) - returns a pose struct
% (by Tim Lueth, VLFL-Lib, 2019-JAN-05 as class: USER INTERFACE)
%
% Pose.A = Start Points of pose
% Pose.B = End Points of pose (Status of: 2019-02-20)
%
% Introduced first in SolidGeometry 4.4
%
% See also: Posesample, Poseplot, Poseplotspace, TofPose, Posenorm,
% center3Pose, checkfourbar3Pose
%
% Pose=Poseui([m,res,ax])
% === INPUT PARAMETERS ===
% m: number of poses; default is 3
% res: resolution; default is 2% of sofBB
% ax: axis; default is unchanged
% === OUTPUT RESULTS ======
% Pose: Pose.A = Start Points of pose, Pose.B = End Points of pose
%
% EXAMPLE:
% CPLsample(4); Poseui('',1)
%
% See also: Posesample, Poseplot, Poseplotspace, TofPose, Posenorm,
% center3Pose, checkfourbar3Pose
%
%
% Copyright 2019 Tim C. Lueth

Poseplot(PS,l,col,CPLE,k,ts,psel)- plots a pose struct

Poseplot(PS,l,col,CPLE,k,ts,psel)% Poseplot(PS,l,col,CPLE,k,ts,psel) - plots a pose struct
% (by Tim Lueth, VLFL-Lib, 2019-JAN-02 as class: KINEMATICS AND FRAMES)
%
% Poseplot supports the following struct elements
% PS.A Pose Start Point
% PS.B Pose End Point
% PS.CPLE Contour of the effector
% PS.A0 Center Point of Crank either [x y] or [x y R]
% PS.B0 Center Point of Swing either [x y] or [x y R]
% PS.A1 Attachment Point of Crank either [x y] or [x y Pose#]
% PS.B1 Attachment Point of Swing either [x y] or [x y Pose#]
% (Status of: 2019-02-26)
%
% Introduced first in SolidGeometry 4.4
%
% See also: Posesample, Poseplotspace, TofPose, Posenorm, Poseui,
% center3Pose, checkfourbar3Pose, poseofPSanalyze
%
% [h,l]=Poseplot(PS,[l,col,CPLE,k,ts,psel])
% === INPUT PARAMETERS ===
% PS: PS.A = Starting Points, PS.B = End Points
% l: optional length
% col: optional color
% CPLE: optional shape contour
% k: displacement along axis; default is 0
% ts: text size of descriptor; default is 0
% psel: selected poses to plot; default is 1:size(PS.A,1)
% === OUTPUT RESULTS ======
% h: handle to plot
% l: selected pose length if cal. automatic
%
% EXAMPLE:
% PS=Posesample(1); SGfigure; Poseplot(PS);
% close all; Poseplot(Posesample(10),100,'r-*',PLsquare(5,2),5,16); pause(1); delete(ans)
%
% PS=Posesample(7); PS.A1=[0 1]; PS.B1=[2 1]; cla; Poseplot(PS); % Attachment points relative to [0 0]
% PS=Posesample(7); PS.A1=[0 1 1]; PS.B1=[2 1 1]; cla; Poseplot(PS); % Attachment points relative to Pose 1
% PS.A0=[5 5]; PS.B0=[3 3]; cla; Poseplot(PS); shg % Now show Center Points and Fourbarlinkage
% PS.CPLE=PLsquare([6,2]); cla; Poseplot(PS); shg % Show also the effektor
%
% See also: Posesample, Poseplotspace, TofPose, Posenorm, Poseui,
% center3Pose, checkfourbar3Pose, poseofPSanalyze
%
%
% Copyright 2019-2021 Tim C. Lueth

Posesample(n)- creates sample poses for the pose syntheses of linkages

Posesample(n)% Posesample(n) - creates sample poses for the pose syntheses of linkages
% (by Tim Lueth, VLFL-Lib, 2019-JAN-02 as class: KINEMATICS AND FRAMES)
%
% load Posesamples.mat
% Posesample{10,1}='Tiegel'; Posesample{10,2}=PSnew
% save ('Posesamples','Posesamples')
% saveTL(Posesamples) (Status of: 2022-01-07)
%
% Introduced first in SolidGeometry 4.4
%
% See also: exp_2019_01_16_4barcases, CPLoftext, CPLsample, SGsample,
% VLsample, PLsample, VLFLsample, CSGsample, SGerrorsample,
% SGfischertechniksample, SGcmdsample, testfunctTL, permutevector, saveTL
%
% PS=Posesample([n])
% === INPUT PARAMETERS ===
% n: selection number or string in Posesampels.mat(:,1)
% === OUTPUT RESULTS ======
% PS: PS.A = list of start point; PS.B=list of end points
%
% EXAMPLE:
% Posesample
% Posesample(1)
% Posesample('?')
% Posesample('Angiotable15')
%
% See also: exp_2019_01_16_4barcases, CPLoftext, CPLsample, SGsample,
% VLsample, PLsample, VLFLsample, CSGsample, SGerrorsample,
% SGfischertechniksample, SGcmdsample, testfunctTL, permutevector, saveTL
%
%
% Copyright 2019-2022 Tim C. Lueth

checkfourbar3Pose(A,B,S,dws,k,pl,ki)- checks whether a fourbar joint solution exists for results of center3Pose

checkfourbar3Pose(A,B,S,dws,k,pl,ki)% checkfourbar3Pose(A,B,S,dws,k,pl,ki) - checks whether a fourbar joint solution exists for results of center3Pose
% (by Tim Lueth, VLFL-Lib, 2019-JAN-01 as class: KINEMATICS AND FRAMES)
%
% r= S(ka,4); % radius of crank
% l1=S(kb,4); % radius of follower
% l2=S(kb,1)-S(ka,1); % length of coupler
% do=S(ka,5); % displacement of coupler
% wo=S(ka,6); % Angle deviation before displacement
% A0=S(ka,2:3); % Base of crank
% B0=S(kb,2:3); % Base of follower
% d=norm(A0-B0); % distance between both bases
%
% ======================================================================
% THIS FNCTN IS PART OF THE SEQUENCE
% 1. Create Poses as List of Startpoints A and Endpoints B uses
% Posesample or Poseui:
% >> PS=Poseui(3,.2); SGfigure; Poseplot(PS);
% >> PS.A=[-0.00 0.00; 0.00 1.00; 1.00 3.00]; PS.B=[ 1.00 0.00; 1.00
% 1.00; 1.71 2.29];
% 2. Calculate a set of parameter variations for possible Solutions:
% >> center3Pose(PS.A,PS.B,-20:20,-20:5:20,-3:.2:3); S=ans; whos C;
% 3. Calculate and analyze all possible permutations of the parameter
% variation:
% >> checkfourbar3Posepermutation(PS.A,PS.B,S); FP=ans;
% >> checkfourbar3Pose(PS.A,PS.B,S); % if there is only one assembly
% 4. Limit the Solution to your needs by limiting the permutations, for
% example
% FULL ROTATION 'u',0 DIMENSION 'l1l2rd',[5 8]
% checkfourbar3Posepermutation(PS.A,PS.B,FP,'','u',0,'l1l2rd',[2 4]);
% OR FULL ROTATION 'u',0 BASES INSIDE AN AREA
% checkfourbar3Posepermutation(PS.A,PS.B,FP,'','cpl',PLcircle(2)+[3
% 3],'l1l2rd',[0 3]);
% ======================================================================
% All those fnctns are based on
% invkinplan2 - that calculates both configurations for a planar 2bar
% linkage (Status of: 2019-03-26)
%
% Introduced first in SolidGeometry 4.4
%
% See also: checkfourbarsegment, center3Pose, Posesample, Poseplot,
% TofPose, Posenorm, Poseui
%
% [ci,s,ord,corg,wres,A0,B0]=checkfourbar3Pose(A,B,S,[dws,k,pl,ki])
% === INPUT PARAMETERS ===
% A: Starting Points of 3 Poses
% B: Ending Points of 3 Poses
% S: Solutions comming from center3Pose
% dws: selected pair of distance and angle
% k: selected values for k; default are first and last of S
% pl: length of pose
% ki: Direct access to k values
% === OUTPUT RESULTS ======
% ci: configuration for pose of a fourbar linkage
% s: rotation segment for earch pose
% ord: movement order of poses; right-hand-rule
% corg: original configuration for each pose
% wres: angle segments; 0 => no solution exist; [] => no limits exist
% A0: Rotation center of crank
% B0: Rotation center of swing
%
% EXAMPLE:
% PS=Posesample(7);
% center3Pose(PS.A,PS.B,[0 1],0,0); S=ans, CPLplot(CPLsample(4)); checkfourbar3Pose(PS.A,PS.B,S)
% center3Pose(PS.A,PS.B,[0 3],0,0); S=ans, CPLplot(CPLsample(4)); checkfourbar3Pose(PS.A,PS.B,S)
% center3Pose(PS.A,PS.B,[-3 3],0,0); S=ans, CPLplot(CPLsample(4)); checkfourbar3Pose(PS.A,PS.B,S)
%
% See also: checkfourbarsegment, center3Pose, Posesample, Poseplot,
% TofPose, Posenorm, Poseui
%
%
% Copyright 2019 Tim C. Lueth

center3Pose(A,B,k,dall,wall,CPL);- return center points for 3 poses (position and orientation)

center3Pose(A,B,k,dall,wall,CPL);% center3Pose(A,B,k,dall,wall,CPL); - return center points for 3 poses (position and orientation)
% (by Tim Lueth, VLFL-Lib, 2019-JAN-01 as class: ANALYTICAL GEOMETRY)
%
% center3Pose is a very powerful fnctn for the design of fourbar linkages
% under a variety of optimization criterias.
% k stands for the distance of the coupler point to the poses
% r stands for the radius of the crank
% C stands for the base of the crank
% d stands for the distance of coupler to pose
% w stand for angle deviation of coupler to pose
% e stands for the distance error of the found solution
% For a fourbar linkage it is necessary to select two k points to get two
% center points for crank and follower.
% ======================================================================
% THIS FNCTN IS PART OF THE SEQUENCE
% 1. Create Poses as List of Startpoints A and Endpoints B uses
% Posesample or Poseui:
% >> PS=Poseui(3,.2); SGfigure; Poseplot(PS);
% >> PS.A=[-0.00 0.00; 0.00 1.00; 1.00 3.00]; PS.B=[ 1.00 0.00; 1.00
% 1.00; 1.71 2.29];
% 2. Calculate a set of parameter variations for possible Solutions:
% >> center3Pose(PS.A,PS.B,-20:20,-20:5:20,-3:.2:3); S=ans; whos C;
% 3. Calculate and analyze all possible permutations of the parameter
% variation:
% >> checkfourbar3Posepermutation(PS.A,PS.B,S); FP=ans;
% 4. Limit the Solution to your needs by limiting the permutations, for
% example
% FULL ROTATION 'u',0 DIMENSION 'l1l2rd',[5 8]
% checkfourbar3Posepermutation(PS.A,PS.B,FP,'','u',0,'l1l2rd',[2 4]);
% OR FULL ROTATION 'u',0 BASES INSIDE AN AREA
% checkfourbar3Posepermutation(PS.A,PS.B,FP,'','cpl',PLcircle(2)+[3
% 3],'l1l2rd',[0 3]);
% ======================================================================
% All those fnctns are based on
% invkinplan2 - that calculates both configurations for a planar 2bar
% linkage (Status of: 2019-01-31)
%
% Introduced first in SolidGeometry 4.4
%
% See also: center3P, center3Poseeffektorgrid, center3Poseconditions,
% checkfourbar3Pose, checkallfourbar3Poses, Posesample, Poseplot,
% TofPose, Posenorm, Poseui, KDWPosevariation
%
% [S,rs,Sall,PSall,dw]=center3Pose([A,B,k,dall,wall,CPL]);
% === INPUT PARAMETERS ===
% A: List of at least 3 points that define a pose
% B: List of at least 3 points that define a direction in combination
% with A
% k: list of checking values for a point along the line A+k*(B-A)/|(B-A)|
% dall: displacement orthogonal to pose line; default is 0
% wall: turning angle of the pose relative to pose; default is 0;
% CPL: Optional area for solutions
% === OUTPUT RESULTS ======
% S: [k C r d w]
% rs: real solutions if CPL is used
% Sall: All Solutions S=Sall(rs,:)
% PSall: All Poses
% dw:
%
% EXAMPLE:
% k=-2:0.2:2; center3Pose([0 0;6 0; 6 5],'',k)
% close all; k=-10:0.4:10; center3Pose([0 0;6 0; 6 5],'',k'); S=ans
% close all; center3Pose('','',-30:30,'','',PLsquare(10,8)+[-10 0]); S=ans
%
% See also: center3P, center3Poseeffektorgrid, center3Poseconditions,
% checkfourbar3Pose, checkallfourbar3Poses, Posesample, Poseplot,
% TofPose, Posenorm, Poseui, KDWPosevariation
%
%
% Copyright 2019 Tim C. Lueth

BBofPS(ps)- returns the bounding box of a polyshape

BBofPS(ps)% BBofPS(ps) - returns the bounding box of a polyshape
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-31 as class: CLOSED POLYGON LISTS)
%
% 2018a - faster than the matlab implementation (Status of: 2018-12-31)
%
% Introduced first in SolidGeometry 4.4
%
% See also: CPLofBB, BBofVL, BBofSG, BBofCPL, BBofSGcutT
%
% bb=BBofPS(ps)
% === INPUT PARAMETERS ===
% ps: polyshape
% === OUTPUT RESULTS ======
% bb: bounding box
%
% EXAMPLE:
% ps=polyshape(CPLsample(33)); plot(ps)
% BBofPS(ps)
%
% See also: CPLofBB, BBofVL, BBofSG, BBofCPL, BBofSGcutT
%
%
% Copyright 2018 Tim C. Lueth

PSanalyze(ps)- classifies the polyshapes regions outer boundaries into equal shapes

PSanalyze(ps)% PSanalyze(ps) - classifies the polyshapes regions outer boundaries into equal shapes
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-30 as class: CLOSED POLYGON LISTS)
%
% The polyshape is recursively separated into regions.
% S.id = identifier
% S.T = HT matrix
% S.ps = polyshape region
% S.cs = polyshape centerted at origin
% S.bs = polyshape region outer boundary (Status of: 2019-01-28)
%
% Introduced first in SolidGeometry 4.4
%
% See also: BBofPS, poseofPSanalyze
%
% S=PSanalyze([ps])
% === INPUT PARAMETERS ===
% ps: Polyshape
% === OUTPUT RESULTS ======
% S: struct containing each region
%
% EXAMPLE:
% SGfigure; load ('fourbar4Pose.mat'); cla; plot(ps); shg
% PSanalyze; S=ans
% SGfigure; hold on; for i=1:3; CPLplotasPS(PLtransR(CPLsample(34)+rand(1,2)*10,rot(randminv([-pi pi])))), end; PSanalyze
%
% See also: BBofPS, poseofPSanalyze
%
%
% Copyright 2018-2019 Tim C. Lueth

class2cell(objs)- converts an array of a class into a cell list of the same type

class2cell(objs)% class2cell(objs) - converts an array of a class into a cell list of the same type
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-30 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.4
%
% See also: get, elem2array, arrayof, cell2class, array2cell
%
% c=class2cell(objs)
% === INPUT PARAMETERS ===
% objs: object array of a class
% === OUTPUT RESULTS ======
% c: cell list of the class array
%
% EXAMPLE:
% SGfigure; CPLplotasPS(CPLsample(14)); ps=PSofgca; ps=regions(ps) % array of polyshape
% ps, cell2class(class2cell(ps))
%
% See also: get, elem2array, arrayof, cell2class, array2cell
%
%
% Copyright 2018 Tim C. Lueth

cell2class(cells)- converts a cell list of elements of the same class into an array of this class

cell2class(cells)% cell2class(cells) - converts a cell list of elements of the same class into an array of this class
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-30 as class: AUXILIARY PROCEDURES)
%
% In more and more cases, the get command of matlab returns cell lists of
% specific classes, but the methods of those classes are unable to
% process cell lists. Therefor this fnctn converts a cell list into an
% array of the class type (Status of: 2018-12-30)
%
% Introduced first in SolidGeometry 4.4
%
% See also: get, elem2array, arrayof, class2cell, array2cell
%
% x=cell2class(cells)
% === INPUT PARAMETERS ===
% cells: cell list of any class type
% === OUTPUT RESULTS ======
% x: resulting array of the class type
%
% EXAMPLE:
% SGfigure; CPLplotasPS(CPLsample(14)); h=findobj(gca,'type','polygon')
% a=get(h,'Shape'), x=cell2class(a)
% cla; plot(x); shg
%
% See also: get, elem2array, arrayof, class2cell, array2cell
%
%
% Copyright 2018 Tim C. Lueth

elem2array(elem)- converts elements of a list into an array

elem2array(elem)% elem2array(elem) - converts elements of a list into an array
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-30 as class: AUXILIARY PROCEDURES)
%
% =======================================================================
% OBSOLETE (2022-04-30) - USE 'elem2rows, elem2cols' INSTEAD
% =======================================================================
%
% Some fnctns such as 'findobj' return a cell list of objects as
% separated results. Accessing structured properties/methods of those
% objects is possible by
% a) using the "get command' which returns a cell list for instance
% "get(h,'Shape')"
% b) use the property name directly similar to a struct, or instance
% "h.Shape"
% In the second case (b) the property methods is called repeated times
% for each element of the object list which returns several individual
% results.
% This fnctn converts the results list into an array of the same class
% type
% (Status of: 2022-04-30)
%
% Introduced first in SolidGeometry 4.4
%
% See also: [ elem2rows, elem2cols ] ; squeeze, elem2cols, elem2rows,
% get, arrayof, cell2class, class2cell, array2cell
%
% vec=elem2array([elem])
% === INPUT PARAMETERS ===
% elem: results list of several elements
% === OUTPUT RESULTS ======
% vec: array of same type as elem{1} filled with elem{:}
%
% EXAMPLE:
% SGfigure; CPLplotasPS(CPLsample(14)); h=findobj(gca,'type','polygon')
% h.Shape % creates 4 results
% get(h,'Shape') % creates a cell list with 4 entries
% elem2array(h.Shape) % converts the 4 results in an class type array with 4 elements
% cell2class(get(h,'Shape')) % returns the same result as elem2arry from the get result
%
% See also: [ elem2rows, elem2cols ] ; squeeze, elem2cols, elem2rows,
% get, arrayof, cell2class, class2cell, array2cell
%
%
% Copyright 2018-2022 Tim C. Lueth

arrayof(cobj,r,c)- returns an array of a class object

arrayof(cobj,r,c)% arrayof(cobj,r,c) - returns an array of a class object
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-30 as class: LANGUAGE PROCEDURES)
%
% Some class objects such as polyshape (2017b) are created by simply
% using the class name
% Nevertheless arrays of such objects have to be created by the repmat
% fnctn.
% Typically the matlab convention is (,) for creating
% arrays for example
% zeros(20,3) or ones (10,10,10) or nan (4)
% This fnctn support the same conventions for class objects (Status of:
% 2018-12-30)
%
% Introduced first in SolidGeometry 4.4
%
% See also: repmat, elem2array, cell2class, class2cell, array2cell
%
% clarr=arrayof(cobj,[r,c])
% === INPUT PARAMETERS ===
% cobj: class object
% r: rows
% c: cols
% === OUTPUT RESULTS ======
% clarr: array of class objects
%
% EXAMPLE:
% arrayof(polyshape,1,4)
% arrayof(polyshape,2)
% arrayof(polyshape,4,1)
%
% See also: repmat, elem2array, cell2class, class2cell, array2cell
%
%
% Copyright 2018 Tim C. Lueth

PSregions(PS)- returns the regions of a polyshape

PSregions(PS)% PSregions(PS) - returns the regions of a polyshape
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-30 as class: CLOSED POLYGON LISTS)
%
% This fnctn extends the concept of regions of a polyshape which is
% available only for scalar polyshapes to arrays and cells of polyshape.
% SGfigure; CPLplotasPS(CPLsample(14)); ps=PSofgca; ps=regions(ps),
% r=regions(ps) % fails!
% create polyshape arrays: (Status of: 2018-12-30)
%
% Introduced first in SolidGeometry 4.4
%
% See also: PSofgca
%
% PSR=PSregions(PS)
% === INPUT PARAMETERS ===
% PS:
% === OUTPUT RESULTS ======
% PSR:
%
% EXAMPLE:
% SGfigure; CPLplotasPS(CPLsample(14)); ps=PSofgca; ps=regions(ps) % array of polyshape
% ps, ps=regions(ps); % fails
% ps=PSregions(ps) % works
%
% See also: PSofgca
%
%
% Copyright 2018 Tim C. Lueth

PSplot(ps,)- plots a polyshape but also a cell list of polyshapes

PSplot(ps,)% PSplot(ps,) - plots a polyshape but also a cell list of polyshapes
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-29 as class: VISUALIZATION)
%
% This fnctn is required since currently the concept of polygon arrays
% and polyshape arrays seems to have less methods than the cell concept
% isa(ps,'polyshape'), isa(ps,'polygon') (Status of: 2018-12-30)
%
% Introduced first in SolidGeometry 4.4
%
% See also: plot, PLplot, CPLplotasPS
%
% h=PSplot(ps,[])
% === INPUT PARAMETERS ===
% ps: polyshape or list of polyshapes
% === OUTPUT RESULTS ======
% h: handle to plat, ie. polygons
%
% EXAMPLE:
% SGfigure; CPLplotasPS(CPLsample(14));
% ps=PSofgca(true)
% cla; PSplot(ps)
%
% See also: plot, PLplot, CPLplotasPS
%
%
% Copyright 2018 Tim C. Lueth

PSofgca(nocells)- return the polyshapes of the polygons of current axis

PSofgca(nocells)% PSofgca(nocells) - return the polyshapes of the polygons of current axis
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-29 as class: CLOSED POLYGON LISTS)
%
% This fnctn is required since currently the concept of polygon arrays
% and polyshape arrays seems to have less methods than the cell concept
% (Status of: 2018-12-30)
%
% Introduced first in SolidGeometry 4.4
%
% See also: VLFLofgca, VLofgca, SGofgca
%
% [ps,CPL]=PSofgca([nocells])
% === INPUT PARAMETERS ===
% nocells: false = separated as cells; true = only on polyspahe
% === OUTPUT RESULTS ======
% ps: polyshape of current axis
% CPL: closed polygon line of ps
%
% EXAMPLE:
% SGfigure; CPLplotasPS(CPLsample(34));
% PSofgca
%
% See also: VLFLofgca, VLofgca, SGofgca
%
%
% Copyright 2018-2019 Tim C. Lueth

TofPL(PL)- returns a 2D HT matrix for a point list

TofPL(PL)% TofPL(PL) - returns a 2D HT matrix for a point list
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-28 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.4
%
% See also: TofR, TofVL, TPL, TofDPhiH, T3ofT2, T3P, T2P, TofP, TofPLpath
%
% T=TofPL(PL)
% === INPUT PARAMETERS ===
% PL: Point list
% === OUTPUT RESULTS ======
% T: 3x3 HT matrix
%
% EXAMPLE:
% TofPL(CPLsample(14))
%
% See also: TofR, TofVL, TPL, TofDPhiH, T3ofT2, T3P, T2P, TofP, TofPLpath
%
%
% Copyright 2018-2019 Tim C. Lueth

array2cell(array)- convert object arrays into cell arrays

array2cell(array)% array2cell(array) - convert object arrays into cell arrays
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-28 as class: AUXILIARY PROCEDURES)
%
% % 2018-12-28 by Tim Lueth
% fnctn c=array2cell(varargin)
%
% c=varargin';
%
% (Status of: 2018-12-30)
%
% Introduced first in SolidGeometry 4.4
%
% See also: get, elem2array, arrayof, cell2class, class2cell
%
% c=array2cell([array])
% === INPUT PARAMETERS ===
% array: arrays of structs
% === OUTPUT RESULTS ======
% c: cell list of input values
%
% EXAMPLE:
% a=dir(pwd); array2cell(a.name)
%
% See also: get, elem2array, arrayof, cell2class, class2cell
%
%
% Copyright 2018-2022 Tim C. Lueth

CPLofpolyshape(ps,ascell)- creates a CPL from an array of polyshapes

CPLofpolyshape(ps,ascell)% CPLofpolyshape(ps,ascell) - creates a CPL from an array of polyshapes
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-28 as class: CLOSED POLYGON LISTS)
%
% for simple polyshapes it is possible to use ps.Vertices but for arrays
% of polyshapes, this fnctn is required (Status of: 2019-02-01)
%
% Introduced first in SolidGeometry 4.4
%
% See also: polyshape, CPLofPolygon
%
%
% CPL=CPLofpolyshape(ps,[ascell])
% === INPUT PARAMETERS ===
% ps: polyshape
% ascell: returns polyshape array elements as cell list
% === OUTPUT RESULTS ======
% CPL: CPL
%
% EXAMPLE:
% a=polyshape(PLcircle(10)), CPLofpolyshape(a)
%
% a=polyshape([PLcircle(4);nan nan;PLcircle(3)+[3 3]]); a=regions(a)
% CPLofpolyshape(a)
% CPLofpolyshape(a,true)
%
% See also: polyshape, CPLofPolygon
%
%
%
% Copyright 2018-2019 Tim C. Lueth

uipolygoncontextmenu- create the ui context menu for polygon

uipolygoncontextmenu% uipolygoncontextmenu - create the ui context menu for polygon
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-27 as class: USER INTERFACE)
%
% This fnctn makes shure that the ui contect menu for polygons is the
% same for all polygons
% This fnctn is used by uipolygonSelectWindowButtonUp
% (Status of: 2018-12-28)
%
% Introduced first in SolidGeometry 4.4
%
% See also: uipolygonSelectWindowButtonUp,
% uipolygonmoveWindowButtonDownFcn, uipolygonselect
%
% cm=uipolygoncontextmenu
% === OUTPUT RESULTS ======
% cm: context menu
%
% EXAMPLE:
% h=findobj(gca,'Type','polygon','selected','on');
% cm=uipolygoncontextmenu; set(h,'UIContextMenu',cm);
%
%
%
% See also: uipolygonSelectWindowButtonUp,
% uipolygonmoveWindowButtonDownFcn, uipolygonselect
%
%
% Copyright 2018 Tim C. Lueth

uipolygonSelectWindowButtonUp(srch,cbdat)- MAIN CALLBACK FUNCT for a figure to make polygons movable if rotate3d is off

uipolygonSelectWindowButtonUp(srch,cbdat)% uipolygonSelectWindowButtonUp(srch,cbdat) - MAIN CALLBACK FUNCT for a figure to make polygons movable if rotate3d is off
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-27 as class: USER INTERFACE)
%
% The concepts works as follows if rotate3d is off (mandatory):
% This callback fnctn uipolygonSelectWindowButtonUp is the Mouse Button
% Up fnctn and
% - deselects all polygons in the current figure BY CLICKING SOMEWHERE
% WHERE THERE IS NO POLYGON
% - select all polygons in the current figure BY DOUBLE CLICKING NEAR
% POLYGONS
% Selecting a polygon means:
% 1. show the selected mode; points a marked
% 2. Attach the fnctn uipolygonmoveWindowButtonDownFcn as Mouse Button
% Down fnctn to those polygons
% 3. A UIContextMenu is attached inside the fnctn
% uipolygonmoveWindowButtonDownFcn to polygons
% Deselecting a polygon means:
% 1. show the unselected mode; no points are marked
% 2. Remove the fnctn uipolygonmoveWindowButtonDownFcn as Mouse Button
% Down fnctn of those polygons
% 3. Still have the UIContextMenu existing
% HOW TO USE THESE FNCTNS
% Just add this fnctn as Button up fnctn to a figure window AFTER
% deselecting rotate3d
% rotate3d off;
% set(gcf,'WindowButtonUpFcn',@uipolygonSelectWindowButtonUp)
% Now, it is possible to select and move polygons.
% FUTURE:
% a) This concept could be extended to CPLs and CVL and SG
% b) the UIContextMenu could be extended to modify the shape by
% stretching/shrinking a polygon
% c) the UIContextMenu could be extended to add or remove points of a
% polygon
% d) the UIContextMenu could be extended to move points of a polygon
% (Status of: 2018-12-28)
%
% Introduced first in SolidGeometry 4.4
%
% See also: uipolygoncontextmenu, uipolygonmoveWindowButtonDownFcn
%
% uipolygonSelectWindowButtonUp(srch,cbdat)
% === INPUT PARAMETERS ===
% srch: source handle - not used yet
% cbdat: call back data - not used yet
%
% EXAMPLE:
% SGfigure; hold on; plot(polyshape(PLcircle(10,4))); plot(polyshape(PLcircle(10,8)+20));
% rotate3d off; set(gcf,'WindowButtonUpFcn',@uipolygonSelectWindowButtonUp) % Now double click works
%
% See also: uipolygoncontextmenu, uipolygonmoveWindowButtonDownFcn
%
%
% Copyright 2018-2020 Tim C. Lueth

uipolygonmoveWindowButtonDownFcn(h,st)- callback fnct and interactive fnct to move and rotate polygons and to attach ui context menu

uipolygonmoveWindowButtonDownFcn(h,st)% uipolygonmoveWindowButtonDownFcn(h,st) - callback fnct and interactive fnct to move and rotate polygons and to attach ui context menu
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-26 as class: USER INTERFACE)
%
% This fnctn is typically installed automatically as callback fnctn for
% polygons by the figure fnctn uipolygonSelectWindowButtonUp.
%
% This fnctn can be used to move a polygon from the command line or to
% attach it as callback fnctn to a polygon (Status of: 2018-12-28)
%
% Introduced first in SolidGeometry 4.4
%
% See also: uipolygonSelectWindowButtonUp, uipolygoncontextmenu,
% uipolygonselect
%
% [h,hp]=uipolygonmoveWindowButtonDownFcn(h,st)
% === INPUT PARAMETERS ===
% h: calling fnctn
% st: calling event
% === OUTPUT RESULTS ======
% h: handle to polygon
% hp: gandle to all polygons
%
% EXAMPLE:
% SGfigure; CPLplotasPS(CPLsample(14)); h=uipolygonselect([0 0 ]); set(h,'Selected','on');
% h=findobj(gca,'Type','polygon','selected','on'); set(h,'ButtonDownFcn',@uipolygonmoveWindowButtonDownFcn);
% rotate3d off
%
% See also: uipolygonSelectWindowButtonUp, uipolygoncontextmenu,
% uipolygonselect
%
%
% Copyright 2018 Tim C. Lueth

uipolygonselect(p)- returns the handles of the polygon near a point or the cursor position

uipolygonselect(p)% uipolygonselect(p) - returns the handles of the polygon near a point or the cursor position
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-26 as class: USER INTERFACE)
%
% This fnctn can be called to get the handles of polygons near the cursor
% or a point.
% It is possible to call the fnctn manually similar to select3d by
% ginput(1); uipolygonselect
% This fnctn is used in may callback fnctns (Status of: 2018-12-28)
%
% Introduced first in SolidGeometry 4.4
%
% See also: uipolygonSelectWindowButtonUp, uipolygoncontextmenu,
% uipolygonmoveWindowButtonDownFcn
%
% [h,hp,pins,pnv]=uipolygonselect(p)
% === INPUT PARAMETERS ===
% p: explicit point or use cursor position if p is empty
% === OUTPUT RESULTS ======
% h: handle of relative polygons
% hp: handle of all polygons
% pins: polygons in which p is located
% pnv: polygons, pi is near a vertex
%
% EXAMPLE:
% SGfigure; CPLplotasPS(CPLsample(14));
% uipolygonselect([10 -20]) % nothing to select
% uipolygonselect([10 -2]) % inside
% uipolygonselect % Checks current cursor position
% ginput(1); uipolygonselect % asks first for crosshair selction
%
%
% See also: uipolygonSelectWindowButtonUp, uipolygoncontextmenu,
% uipolygonmoveWindowButtonDownFcn
%
%
% Copyright 2018-2020 Tim C. Lueth

CPLofPolygon(h,ascell);- returns the CPL of a graphics object type polygon

CPLofPolygon(h,ascell);% CPLofPolygon(h,ascell); - returns the CPL of a graphics object type polygon
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-26 as class: CLOSED POLYGON LISTS)
%
% Auxiliary fnctn to convert the polygon graphics object handle into a
% CPL. Used in interactive fnctns such as uipolygoncontextmenu. (Status
% of: 2019-01-31)
%
% Introduced first in SolidGeometry 4.4
%
% See also: CPLofpolyshape, uipolygoncontextmenu
%
% CPL=CPLofPolygon(h,[ascell]);
% === INPUT PARAMETERS ===
% h: handle to polygon
% ascell: if return as cell list or as array
% === OUTPUT RESULTS ======
% CPL: Closed Polygon line
%
% EXAMPLE:
% h=plot(polyshape(PLcircle(4)))
% CPLofPolygon(h)
% h=plot(polyshape([PLcircle(4);nan nan; PLcircle(4)+[5 5]])); shg
% CPLofPolygon(h)
%
% See also: CPLofpolyshape, uipolygoncontextmenu
%
%
% Copyright 2018-2019 Tim C. Lueth

CPLplotasPS(CPL,simp)- plots a CPL as polyshape using the plot(polyshape(CPL)) command

CPLplotasPS(CPL,simp)% CPLplotasPS(CPL,simp) - plots a CPL as polyshape using the plot(polyshape(CPL)) command
% (by Tim Lueth, Video-Lib, 2018-DEZ-26 as class: CLOSED POLYGON LISTS)
%
% =======================================================================
% OBSOLETE (2022-01-30) - USE 'CPSplot' INSTEAD
% =======================================================================
%
% plots as CPL as polyshape (simplify==false) instead of a contour line
% (Status of: 2019-02-16)
%
% Introduced first in SolidGeometry 4.4
%
% See also: [ CPSplot ] ; CPLanimateTL, CPLplot, CPLfaceplot,
% CPLplotregions, CPLplotcolors, CPLplotinout
%
% h=CPLplotasPS(CPL,[simp])
% === INPUT PARAMETERS ===
% CPL: closed polygon line
% simp: true for simplify; false=unmodified; default is true;
% === OUTPUT RESULTS ======
% h: handle
%
% EXAMPLE: SGfigure; CPLplotasPS(CPLsample(14)); CPLplotasPS(CPLsample(16));
%
% See also: [ CPSplot ] ; CPLanimateTL, CPLplot, CPLfaceplot,
% CPLplotregions, CPLplotcolors, CPLplotinout
%
%
% Copyright 2018-2022 Tim C. Lueth

CPLplotinout(CPL,col)- plots the CPLs in colors depending in the enclosure level

CPLplotinout(CPL,col)% CPLplotinout(CPL,col) - plots the CPLs in colors depending in the enclosure level
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-23 as class: CLOSED POLYGON LISTS)
%
% plots the enclosing level using the colorstring 'rbgymcwk'
%
% (Status of: 2019-07-06)
%
% Introduced first in SolidGeometry 4.4
%
% See also: CPLplot, CPLplotcolors, CPLplotregions, CPLplotcwccw
%
% h=CPLplotinout(CPL,[col])
% === INPUT PARAMETERS ===
% CPL: Closed Polygon line
% col: line type; first char (color) is ignored
% === OUTPUT RESULTS ======
% h: handle to plot
%
% EXAMPLE:
% SGfigure; CPLplotinout(CPLsample(14))
% SGfigure; CPLplotinout(CPLsample(14),'?-.')
% SGfigure; CPLplotinout(CPLsample(14),'?-.',4)
%
% See also: CPLplot, CPLplotcolors, CPLplotregions, CPLplotcwccw
%
%
% Copyright 2018-2019 Tim C. Lueth

exp_2018_12_22_CPL2CPLchain(CPL);- EXPERIMENT to analyze a CPL to identify links and revolute joints of a mechanism

exp_2018_12_22_CPL2CPLchain(CPL);% exp_2018_12_22_CPL2CPLchain(CPL); - EXPERIMENT to analyze a CPL to identify links and revolute joints of a mechanism
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-22 as class: EXPERIMENTS)
%
% This fnctn takes over the 2D sketch of a joint kinematics as CPL and
% analyzes the pivot points from the overlapping contours as well as the
% kinematic chain as edge list and the contours of three pins.
% The result are four strutures
% CCPL contains the contours of the links = [Outer contour; nan nan; base
% contour; nan nan; joint contour]
% EL contains a sorted edge list of the links that represents the
% kinematic chain
% DCPL it the shape of the connecting axis
% lm are the centers of the axis (Status of: 2018-12-24)
%
% Introduced first in SolidGeometry 4.4
%
% [CCPL,EL,DCPL,lm]=exp_2018_12_22_CPL2CPLchain([CPL]);
% === INPUT PARAMETERS ===
% CPL): CLosed Polygon line
% === OUTPUT RESULTS ======
% CCPL: cell list of link structures
% EL: edge list to connect the links
% DCPL: shape of the connecting joints
% lm: centers of the contours
%
% EXAMPLE:
% [~,~,~,CPL]=CPLfourbarlinkage('','','','',[0.2 20],'',CPLsample(34)*10);
% exp_2018_12_22_CPL2CPLchain(CPL)
%
%
% Copyright 2018 Tim C. Lueth

exp_2018_12_20_cuttingshape(k,rp,b,CPLT,CPLX)- EXPERIMENT to automatically cut a shape to fit into another shape during 4bar movement

exp_2018_12_20_cuttingshape(k,rp,b,CPLT,CPLX)% exp_2018_12_20_cuttingshape(k,rp,b,CPLT,CPLX) - EXPERIMENT to automatically cut a shape to fit into another shape during 4bar movement
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-20 as class: EXPERIMENTS)
%
% This fnctn rotates a Contour CPLT with a four-bar-linkage and cuts the
% contour so that a specified polygon CPLX is not left.
% (Status of: 2018-12-22)
%
% Introduced first in SolidGeometry 4.4
%
% See also: exp_2012_12_16_plan_2r_rob.mlx, exp_2018_12_18_walking,
% exp_2018_12_19_walkingshape
%
% CPLT=exp_2018_12_20_cuttingshape([k,rp,b,CPLT,CPLX])
% === INPUT PARAMETERS ===
% k: position along the couple length of POI [0..1, 0..1]
% rp: radius relation to l1+l2
% b: base point [0 .. 1) with respect to minmal and maximal distance
% CPLT: Moving Contour attached to POI
% CPLX: Crossing Contour that limits the shape of CPLT
% === OUTPUT RESULTS ======
% CPLT: Optimized Contour that with maximum area within CPLX
%
% EXAMPLE:
% exp_2018_12_20_cuttingshape; a=ans
% exp_2018_12_20_cuttingshape('','','',a); b=ans
%
% See also: exp_2012_12_16_plan_2r_rob.mlx, exp_2018_12_18_walking,
% exp_2018_12_19_walkingshape
%
%
% Copyright 2018 Tim C. Lueth

im2vec(Iset)- simply converts/reshapes an image into a 1 x n vector

im2vec(Iset)% im2vec(Iset) - simply converts/reshapes an image into a 1 x n vector
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-19 as class: IMAGES)
%
% used for polynomical classificators (Status of: 2019-02-01)
%
% Introduced first in SolidGeometry 4.4
%
% Vec=im2vec(Iset)
% === INPUT PARAMETERS ===
% Iset: Image
% === OUTPUT RESULTS ======
% Vec: Vector
%
% EXAMPLE:
% imread('corn.tif',3); I=ans; whos I
% V=im2vec(I);
% whos V
%
%
% Copyright 2018-2021 Tim C. Lueth

exp_2018_12_19_walkingshape(k,rp,b,CPLT)- EXPERIMENT to show the swept hull of the links

exp_2018_12_19_walkingshape(k,rp,b,CPLT)% exp_2018_12_19_walkingshape(k,rp,b,CPLT) - EXPERIMENT to show the swept hull of the links
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-19 as class: EXPERIMENTS)
%
% This fnctn shows the swept area of a circumferential four bar linkage.
% (Status of: 2018-12-22)
%
% Introduced first in SolidGeometry 4.4
%
% See also: exp_2018_12_18_walking, exp_2018_12_20_cuttingshape,
% exp_2018_12_22_CPL2CPLchain
%
% [A,B,C,D,a,b,c,d]=exp_2018_12_19_walkingshape([k,rp,b,CPLT])
% === INPUT PARAMETERS ===
% k: position of the foot relative to the 4bar
% rp: radius of the crank relative to link 1
% b: position of base between minimum and maximum value
% CPLT: Contour attached to c
% === OUTPUT RESULTS ======
% A: Area touched by link 1
% B: Area touched by link 2
% C: Area touched by crank
% D: Area touched by contour CPLT
% a:
% b:
% c:
%
% EXAMPLE:
% exp_2018_12_19_walkingshape
% [~,~,~,~,a,b,c,d,]=exp_2018_12_19_walkingshape('',0.4)
% exp_2018_12_22_CPL2CPLchain([a;nan nan;c;nan nan;CPLmeltbool([b;nan nan;d])]);
%
% See also: exp_2018_12_18_walking, exp_2018_12_20_cuttingshape,
% exp_2018_12_22_CPL2CPLchain
%
%
% Copyright 2018 Tim C. Lueth

exp_2018_12_18_walking(k,r)- Walking fourbar

exp_2018_12_18_walking(k,r)% exp_2018_12_18_walking(k,r) - Walking fourbar
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-18 as class: EXPERIMENTS)
%
% This fnctn shows the movement of the crosspoint (POI) of a
% four-bar-linkage (Status of: 2018-12-22)
%
% Introduced first in SolidGeometry 4.4
%
% See also: exp_2012_12_16_plan_2r_rob.mlx, exp_2018_12_19_walkingshape,
% exp_2018_12_20_cuttingshape
%
% exp_2018_12_18_walking([k,r])
% === INPUT PARAMETERS ===
% k: position of the foot relative to the 4bar
% r: radius of the crank relative to link 1
%
% EXAMPLE:
% exp_2018_12_18_walking(-4)
%
% See also: exp_2012_12_16_plan_2r_rob.mlx, exp_2018_12_19_walkingshape,
% exp_2018_12_20_cuttingshape
%
%
% Copyright 2018 Tim C. Lueth

CPLfourbarlinkage(P1,P2,P3,P4,P5,R12,CPLX,dw)- creates for a specified fourbar linkage the cpls for crank, coupler, swing

CPLfourbarlinkage(P1,P2,P3,P4,P5,R12,CPLX,dw)% CPLfourbarlinkage(P1,P2,P3,P4,P5,R12,CPLX,dw) - creates for a specified fourbar linkage the cpls for crank, coupler, swing
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-17 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.4
%
% See also: invkinplan2, exp_2012_12_16_plan_2r_rob.mlx,
% exp_2018_12_18_walking, exp_2018_12_19_walkingshape,
% exp_2018_12_20_cuttingshape
%
% [CPL1,CPL2,CPLR,CPL,R12o,CPLX,TX,dt]=CPLfourbarlinkage([P1,P2,P3,P4,P5,
% R12,CPLX,dw])
% === INPUT PARAMETERS ===
% P1: Position of Crank Center
% P2: Position of TCP (end of coupler)
% P3: Position of link 1 (start of coupler)
% P4: Position of Base of link 1 (2R robot base)
% P5: Position of POI (0=P3 1= P2) or [POI delta x]
% R12: Ro and Ri Outer and inner Radius
% CPLX: Contour of the Shape linked to POI
% dw: optional turing angle
% === OUTPUT RESULTS ======
% CPL1: CPL of swing, 2R-robot link 1
% CPL2: CPL of coupler, 2R-robot link 2
% CPLR: CPL of crank, radial position specification
% CPL: complete contour for sweeping
% R12o: [Ro and Ri] Outer and inner Radius
% CPLX: CPL of Final Contour
% TX: Final transformation matrix
%
% EXAMPLE:
% CPLfourbarlinkage;
% CPLfourbarlinkage('','','','',0.5);
% CPLfourbarlinkage('','','','',-3);
% CPLfourbarlinkage('','','','',[0.5 20]);
% CPLfourbarlinkage('','','','',[0.5 20],'',CPLsample(34)*10);
%
%
% See also: invkinplan2, exp_2012_12_16_plan_2r_rob.mlx,
% exp_2018_12_18_walking, exp_2018_12_19_walkingshape,
% exp_2018_12_20_cuttingshape
%
%
% Copyright 2018-2019 Tim C. Lueth

exp_2018_12_16_plan_2r_rob- EXPERIMENT to explain relationship between planar 2R-robot and fourbar linkage

exp_2018_12_16_plan_2r_rob% exp_2018_12_16_plan_2r_rob - EXPERIMENT to explain relationship between planar 2R-robot and fourbar linkage
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-16 as class: TUTORIAL)
%
% This LiveScript explains the movements of a four-bar-linkage as the
% movement of a planar 2R robot that has a rotating joint at the
% base/frame point and between each of the two links. In order for the
% robot to become a four-bar linkage, the end point (TCP) of the robot
% must be forced onto a circular path. This requires a rotating crank.
% The TCP of the robot rotates on a circular path and the second link of
% the robot corresponds to the coupling of the four bar linkage. (Status
% of: 2018-12-22)
%
% Introduced first in SolidGeometry 4.4
%
% See also: exp_2012_12_16_plan_2r_rob.mlx, exp_2018_12_18_walking,
% exp_2018_12_19_walkingshape, exp_2018_12_20_cuttingshape
%
% exp_2018_12_16_plan_2r_rob
%
% See also: exp_2012_12_16_plan_2r_rob.mlx, exp_2018_12_18_walking,
% exp_2018_12_19_walkingshape, exp_2018_12_20_cuttingshape
%
%
% Copyright 2018 Tim C. Lueth

randT(d)- return a random T matrix

randT(d)% randT(d) - return a random T matrix
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-08 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.4
%
% See also: randminv
%
% T=randT([d])
% === INPUT PARAMETERS ===
% d: distance from original; default is 10..20
% === OUTPUT RESULTS ======
% T: HT Matrix
%
% EXAMPLE:
% randT
%
% See also: randminv
%
%
% Copyright 2018 Tim C. Lueth

SGshowcolors (n)- shows different colors to understand how to set rgb values

SGshowcolors (n)% SGshowcolors (n) - shows different colors to understand how to set rgb values
% (by Tim Lueth, VLFL-Lib, 2018-DEZ-03 as class: VISUALIZATION)
%
% This fnctn was more or less to test different colors of SGwrtiteSTL
% (Status of: 2018-12-04)
%
% Introduced first in SolidGeometry 4.4
%
% See also: camlightTL, VLFLplotlight, SGshadelight, nofcolmap
%
% SGshowcolors(n)
% === INPUT PARAMETERS ===
% n:
%
% EXAMPLE: SGshowcolors (2)
% SGshowcolors (3)
% SGshowcolors (4)
%
% See also: camlightTL, VLFLplotlight, SGshadelight, nofcolmap
%
%
% Copyright 2018-2020 Tim C. Lueth

VLFL_EXP46- TUTORIAL 46 - Publishable Tutorial for creating a planetary gear using SGofCPLcommand

VLFL_EXP46% VLFL_EXP46 - TUTORIAL 46 - Publishable Tutorial for creating a planetary gear using SGofCPLcommand
% (by Yilun Sun, VLFL-Lib, 2018-NOV-30 as class: TUTORIAL)
%
% Creates a planetary gear using the Solid Geometry Coding Language
% (SGC-Language). The tutorial was created by Yilun Sun.
% (Status of: 2018-12-12)
%
% Introduced first in SolidGeometry 4.4
%
% See also: SGofCPLcommand
%
% VLFL_EXP46
%
% See also: SGofCPLcommand
%

SGreadOBJ(FName,mag,check)- reads in an OBJ file

SGreadOBJ(FName,mag,check)% SGreadOBJ(FName,mag,check) - reads in an OBJ file
% (by Tim Lueth, VLFL-Lib, 2018-NOV-30 as class: FILE HANDLING)
%
% Simply uses VLFLreadOBJ
% Since there are different formats in OBJ files
% currently only the format
% f v1 v2 v3
% and f v1/vn v2/vn v3/vn
% and f v1//vn v2//vn v3//vn
% are supported (Status of: 2018-12-03)
%
% Introduced first in SolidGeometry 4.4
%
% See also: SGreadSTL, SGwriteSTL, VLFLwriteSTL, VLFLreadSTL, VLFLreadOBJ
%
% [SG,H,AbC,FName]=SGreadOBJ([FName,mag,check])
% === INPUT PARAMETERS ===
% FName: File Name
% mag: magnification; default is 1
% check: checker; default is false
% === OUTPUT RESULTS ======
% SG: Solid Geometry
% H: Colors, not used in SG-Lib 4.7
% AbC: Colors, not used in SG-Lib 4.7
% FName: File Name, added in SG-Lib 4.7
%
% See also: SGreadSTL, SGwriteSTL, VLFLwriteSTL, VLFLreadSTL, VLFLreadOBJ
%
%
% Copyright 2018-2019 Tim C. Lueth

rgbofall(x)- return all different methods of matlab into a rgb set as type double

rgbofall(x)% rgbofall(x) - return all different methods of matlab into a rgb set as type double
% (by Tim Lueth, VLFL-Lib, 2018-NOV-29 as class: VISUALIZATION)
%
% Introduced first in SolidGeometry 4.4
%
% See also: rgb2char, char2rgb, rgb2bgr16
%
% rgb=rgbofall(x)
% === INPUT PARAMETERS ===
% x: input character 'b' or [255 0 0] etc.
% === OUTPUT RESULTS ======
% rgb: rgb value between 0 and 1
%
% EXAMPLE:
% rgbofall('y')
% rgbofall(['y','g'])
% rgbofall([255 0 64])
%
% See also: rgb2char, char2rgb, rgb2bgr16
%
%
% Copyright 2018 Tim C. Lueth

bgr162rgb(AbC)- converts a 16 Bit AbC color code (BGR 3 x 5 + 1 Bit) into a color vector [R G B] 3 x 8 Bit

bgr162rgb(AbC)% bgr162rgb(AbC) - converts a 16 Bit AbC color code (BGR 3 x 5 + 1 Bit) into a color vector [R G B] 3 x 8 Bit
% (by Tim Lueth, VLFL-Lib, 2018-NOV-29 as class: FILE HANDLING)
%
% Used for READING COLORED STL FILES
% Support of VisCAM and SolidView Colors as attribute by Byte
% bits 0 to 4 are the intensity level for blue (0 to 31),
% bits 5 to 9 are the intensity level for green (0 to 31),
% bits 10 to 14 are the intensity level for red (0 to 31),
% bit 15 is 1 if the color is valid, or 0 if the color is not valid (as
% with normal STL files).
% The Company Materialize defined a color code for the BINARY STL format
% that exist only in binary STL files. Unfortunately is wasn't clear from
% left to right or right to left. Therefor the common used Software
% Meshlab does interpret the colors other than Materialize Software.
% In the SG-Lib this is handled by swiching the Facet Colors for RED and
% BLUE channel. FC=FC(:,[3 2 1]) (Status of: 2019-07-03)
%
% Introduced first in SolidGeometry 4.4
%
% See also: rgb2bgr16
%
% rgb=bgr162rgb(AbC)
% === INPUT PARAMETERS ===
% AbC: List of "Attribute by Count" or BRG16Bit code
% === OUTPUT RESULTS ======
% rgb: List of Matlab RGB Values
%
% EXAMPLE:
% a=rgb2bgr16('m'), b=bgr162rgb(a), rgb2char(b*255)
% a=rgb2bgr16([255 0 0]), b=bgr162rgb(a), rgb2char(b*255)
% a=rgb2bgr16([0.1 0.9 1.0])
%
%
% See also: rgb2bgr16
%
%
% Copyright 2018-2019 Tim C. Lueth

SGshadelight(nr)- sets shading and lightinhg

SGshadelight(nr)% SGshadelight(nr) - sets shading and lightinhg
% (by Tim Lueth, VLFL-Lib, 2018-NOV-29 as class: AUXILIARY PROCEDURES)
%
% In contrast to other calls, this fnctns shows an example result only if
% there is an output results
% For face coloring and shading only the combination values 1, 2, 4 are
% recommended.
% Interpolation and Gouraud shading create problems with coulored faces
% and are useful only in combination with colored vertices. (Status of:
% 2020-07-03)
%
% Introduced first in SolidGeometry 4.4
%
% See also: camlightTL, VLFLplotlight, SGshowcolors, rotate3dlight
%
% nr=SGshadelight(nr)
% === INPUT PARAMETERS ===
% nr: 1..9 for different shadings
% === OUTPUT RESULTS ======
% nr: use less parameter; used only for creating an example result
%
% EXAMPLE: A=SGshadelight(4)
%
% See also: camlightTL, VLFLplotlight, SGshowcolors, rotate3dlight
%
%
% Copyright 2018-2020 Tim C. Lueth

rgb2bgr16(RGB)- converts a RGB 3 x 8 Bit color into a BGR 3 x 5 + 1 Bit = 16 Bit Value for STL attribute by color values

rgb2bgr16(RGB)% rgb2bgr16(RGB) - converts a RGB 3 x 8 Bit color into a BGR 3 x 5 + 1 Bit = 16 Bit Value for STL attribute by color values
% (by Tim Lueth, VLFL-Lib, 2018-NOV-28 as class: VISUALIZATION)
%
% Used for WRITING COLORED STL FILES
% Support of VisCAM and SolidView Colors as attribute by Byte
% bits 1 to 5 are the intensity level for blue (0 to 31),
% bits 6 to 10 are the intensity level for green (0 to 31),
% bits 11 to 15 are the intensity level for red (0 to 31),
% bit 16 is 1 if ONE color is used, or 0 if the faces color are used.
% SG-Lib 4.7 with support of Yannick Krieger (Status of: 2019-07-03)
%
% Introduced first in SolidGeometry 4.4
%
% See also: SGwriteSTL, SGwriteVRML, char2rgb, rgb2char, bgr162rgb
%
% bgr16=rgb2bgr16(RGB)
% === INPUT PARAMETERS ===
% RGB: [0..255 0..255 0.255] or 'r', 'y', 'b' etc.
% === OUTPUT RESULTS ======
% bgr16: Attribute by Count Value 16 Bit
%
% EXAMPLE:
% a=rgb2bgr16('m'), b=bgr162rgb(a), rgb2char(b*255)
% a=rgb2bgr16([255 0 0]), b=bgr162rgb(a), rgb2char(b*255)
% a=rgb2bgr16([0.1 0.9 1.0])
%
%
% See also: SGwriteSTL, SGwriteVRML, char2rgb, rgb2char, bgr162rgb
%
%
% Copyright 2018-2019 Tim C. Lueth

SGwriteVRML(SG,FNAME,ONAME,vcol)- Writen an STL Geometry in a VRML File Format.

SGwriteVRML(SG,FNAME,ONAME,vcol)% SGwriteVRML(SG,FNAME,ONAME,vcol) - Writen an STL Geometry in a VRML File Format.
% (by Tim Lueth & Alexandra Mercader, VLFL-Lib, 2018-NOV-27 as class:
% FILE HANDLING)
%
% This fnctn was required by Alexandra Mercader, to use the3-Printer of
% 2006 in combination with the starch powder and colored binder liquids.
% This printer is not able to use OBJ or STL Files that support the
% "materialize color convention" for integration color information into
% the geometries.
% The problem of using matlabs STL2vrml convter could be that this
% "materialize color convention" is may be not convertet. Therefor, the
% need could be to write the vrml exporter to integrate colors and many
% other features that are supported by VRML but not by STL such as
% separation of differeet solids.
% Matlab's stl2vrml converter comes from humusoft that made the product
% orbisnap
% On mac there is view3dscene-3.15.0-macosx available (Status of:
% 2018-11-28)
%
% Introduced first in SolidGeometry 4.4
%
% See also: SGwriteSTL
%
% fname=SGwriteVRML(SG,[FNAME,ONAME,vcol])
% === INPUT PARAMETERS ===
% SG: Solid Geoemtry
% FNAME: Optional Filename
% ONAME: optional Solid name; default is by username
% vcol: optional Color for the solid
% === OUTPUT RESULTS ======
% fname:
%
% EXAMPLE:
% A=SGbox([30,20,10]); A.col='g'; A.alpha=0.4; A
% fname=SGwriteVRML(A)
% openbydoubleclick(fname)
%
% See also: SGwriteSTL
%
%
% Copyright 2018 Tim C. Lueth

char2rgb(c)- returns a RGB value from a color character

char2rgb(c)% char2rgb(c) - returns a RGB value from a color character
% (by Tim Lueth, VLFL-Lib, 2018-NOV-26 as class: VISUALIZATION)
%
% SG-Lib 4.5 supports list of colors (Status of: 2019-01-30)
%
% Introduced first in SolidGeometry 4.4
%
% See also: rgb2char, rgb2bgr16
%
%
% rgb=char2rgb(c)
% === INPUT PARAMETERS ===
% c: color character
% === OUTPUT RESULTS ======
% rgb: [R G B] color
%
% EXAMPLE:
% char2rgb('r')
% char2rgb('krgbw')
%
% See also: rgb2char, rgb2bgr16
%
%
%
% Copyright 2018-2019 Tim C. Lueth

rgb2char(RGB)- returns a color character from an RGB value

rgb2char(RGB)% rgb2char(RGB) - returns a color character from an RGB value
% (by Tim Lueth, VLFL-Lib, 2018-NOV-26 as class: VISUALIZATION)
%
% SG-Lib 4.5 supports list of colors (Status of: 2019-01-30)
%
% Introduced first in SolidGeometry 4.4
%
% See also: char2rgb, rgb2bgr16
%
% c=rgb2char(RGB)
% === INPUT PARAMETERS ===
% RGB: [R G B] color
% === OUTPUT RESULTS ======
% c: color character
%
% EXAMPLE:
% rgb2char([255 255 0])
% rgb2char(char2rgb('krgbw'))
%
% See also: char2rgb, rgb2bgr16
%
%
% Copyright 2018-2019 Tim C. Lueth

VLFL_EXP45- Tutorial to demonstrate the power of SGofCPLcommand

VLFL_EXP45% VLFL_EXP45 - Tutorial to demonstrate the power of SGofCPLcommand
% (by Tim Lueth, VLFL-Lib, 2018-NOV-25 as class: TUTORIAL)
%
% Tutorial zum Demonstrieren der Leistungsfähigkeit der Solid Geometry
% Coding Language -
% SGofCPLcommand, VLFL_EXP46 (Status of: 2018-12-12)
%
% Introduced first in SolidGeometry 4.4
%
% See also: SGofCPLcommand, VLFL_EXP46
%
% VLFL_EXP45
%
% See also: SGofCPLcommand, VLFL_EXP46
%
%
% Copyright 2018 Tim C. Lueth

CVL2periodic(CVL,tp)- converts a perodic spatial contour into three periodic discrete fnct

CVL2periodic(CVL,tp)% CVL2periodic(CVL,tp) - converts a perodic spatial contour into three periodic discrete fnct
% (by Tim Lueth, VLFL-Lib, 2018-NOV-25 as class: ANALYTICAL GEOMETRY)
%
% This is an auxiliary fnctn for the analysis and synthesis of
% periodically repeating contours: number, length, angle.
% The topic of decomposing an orbital contour into a periodic fnctn is a
% problem very similar to the problem of correlating two curves. For this
% reason, it makes sense to take a closer look at the fnctns
% SGof2CPLzheurist, SGof2CPLs and PLcorrelate. It is possible to use the
% existing grid points of a coordinate axis:
% a) simply map to an angular revolution
% b) Map the total length of the contour to the angular revolution.
% c) map the total sum of the angles of the contour to the angular
% revolution
% In all three cases, additional interpolation values may have to be
% found to prepare the fnctn for Fourier decomposition. Points may also
% need to be removed.
% Another question is the "beginning" of the curve. If this is defined
% due to a maximum deflection of a value and if yes, which dimension is
% dominant or due to an angle relative to the center of the curve. It is
% about the discovery of the similarity of curves on the basis of initial
% criteria. (Status of: 2018-12-04)
%
% Introduced first in SolidGeometry 4.4
%
% See also: fourBarLinkage, fourBarLinkageCPL, SGof2CPLzheurist,
% SGof2CPLs, PLcorrelate
%
% [CPLx,CPLy,CPLz,t]=CVL2periodic(CVL,[tp])
% === INPUT PARAMETERS ===
% CVL: CPL or PL; only the first are used
% tp: time; default is 2* pi
% === OUTPUT RESULTS ======
% CPLx: CPL [t x]
% CPLy: CPL [t y]
% CPLz: CPL [t z]
% t: time vector
%
% EXAMPLE:
% CVL2periodic(PLcircle(30))
% CVL2periodic(PLcircle(30,6))
% CVL2periodic(CPLaddauxpoints(PLcircle(30,6),1))
% CVL2periodic(CPLaddauxpoints(PLsquare(10),1))
%
% See also: fourBarLinkage, fourBarLinkageCPL, SGof2CPLzheurist,
% SGof2CPLs, PLcorrelate
%
%
% Copyright 2018 Tim C. Lueth

SGscrewDIN(D,L,p,CPL,shr,left)- returns a screw geometry related to DIN13

SGscrewDIN(D,L,p,CPL,shr,left)% SGscrewDIN(D,L,p,CPL,shr,left) - returns a screw geometry related to DIN13
% (by Tim Lueth, VLFL-Lib, 2018-NOV-24 as class: PARAMETRIC DESIGN)
%
% =======================================================================
% OBSOLETE (2022-03-19) - USE 'SGDIN13' INSTEAD
% =======================================================================
%
% complete new fnctn, written for SG-Lib 4.4 and SGofCPLcommand
% It is used to create wrt DIN13 watertight threads for
% a) Screws (Positive Diameter, no outer CPL contour)
% b) Screw tap (Negative Diameter, no outer CPL contour)
% c) Nuts (Negative Diameter, outer Radius or CPL contour)
% In SG 4.5 the Screw starts at z=0 (Michael Kruttschnitt)
% In SG 4.7 bug using CPLs removed by comment from Simon Schiele
% In SG 5.0, left-hand threads are also supported (Status of: 2020-12-22)
%
% Introduced first in SolidGeometry 4.4
%
% See also: [ SGDIN13 ] ; SGthread, PLthreadDIN
%
% SG=SGscrewDIN(D,L,[p,CPL,shr,left])
% === INPUT PARAMETERS ===
% D: Diameter (negative creates a screw cutter or nut)
% L: Length
% p: optional pitch
% CPL: Outer Diameter or CPL, creates nuts in combination with negative D
% shr: shrinkage because of printer oversize; default is 0
% left: if true, a left
% === OUTPUT RESULTS ======
% SG: Solid Geometry
%
% EXAMPLE:
% SGscrewDIN( 32,50) % Screw
% SGscrewDIN(-32,50) % Screw cutter
% SGscrewDIN(-32,50,'',35) % circular nut
% SGscrewDIN(-32,50,'',PLcircle(40,7)); nut hexagon shape
% SGscrewDIN( 32,50,'','','',true) % Screw - Left orientation
%
%
% See also: [ SGDIN13 ] ; SGthread, PLthreadDIN
%
%
% Copyright 2018-2022 Tim C. Lueth

exp_2018_11_24_SGcuterror- return a SG with two open boundaries resulting from SGcut

exp_2018_11_24_SGcuterror% exp_2018_11_24_SGcuterror - return a SG with two open boundaries resulting from SGcut
% (by Tim Lueth, VLFL-Lib, 2018-NOV-24 as class: EXPERIMENTS)
%
% This short fnctn creates an internal thread with the fnctns DIN13,
% PLthreadDIN and SGofCPLrota. After generation, the SG is watertight.
% Then the SG is cut with SGcut at two z- planes.
% After that there are unfortunately open edges at the upper edge and
% lower edge of the cut surface. This fnctn serves to generate a test
% body for searching and correcting this limit case for SGCut, since
% otherwise the SGcut fnctn works very reliably.
% Since similar errors also occur with other threads from IGES/STEP
% files, it makes sense to search for errors. (Status of: 2018-11-24)
%
% Introduced first in SolidGeometry 4.4
%
% SG=exp_2018_11_24_SGcuterror
% === OUTPUT RESULTS ======
% SG: Solid Geometry with two open edges resulting from SGcut
%
% EXAMPLE: exp_2018_11_24_SGerror
%
%
% Copyright 2018 Tim C. Lueth

PLthreadDIN(D,P)- Fnct to create the crosssection contour using DIN13 for a thread

PLthreadDIN(D,P)% PLthreadDIN(D,P) - Fnct to create the crosssection contour using DIN13 for a thread
% (by Tim Lueth, VLFL-Lib, 2018-NOV-23 as class: CLOSED POLYGON LISTS)
%
% This fnctn is an extract of first SGthread fnctn!
% Attention: Every Pitch (also the one from DIN 13) will create
% overlapping facets if rotated using SGofCPLrota. The reason is the
% limited number polygon points of a circle or in this case a helix. This
% problem is solved in SGofCPLrota by default. (Status of: 2018-11-24)
%
% Introduced first in SolidGeometry 4.4
%
% See also: PLgearrackDIN, PLgearDIN, SGofCPLrota, SGcut
%
% [PLB,P,KD]=PLthreadDIN(D,[P])
% === INPUT PARAMETERS ===
% D: DIN diameter; negative values for nuts
% P: optional pitch, otherwise taken from DIN13
% === OUTPUT RESULTS ======
% PLB: CPL for the cross section if the thread
% P: Pitch of the tread
% KD: Core diameter of the core of bold or nut
%
% EXAMPLE:
% PLthreadDIN (+5)
% PLthreadDIN (-5)
% [PL,P]=PLthreadDIN(5); SGfigure; CPLplot(PL,'r-',2);
% SG=SGofCPLrota(PL,pi*6,false,'',3*P); SGfigure; view(-30,30); SGplot(SG);
% SGcut(SG,[P,3*P]);
%
% See also: PLgearrackDIN, PLgearDIN, SGofCPLrota, SGcut
%
%
% Copyright 2018 Tim C. Lueth

SGlim(VL,dim,lim,rat)- compresses the vertex coordinates outside a limit without changing the VL or FL

SGlim(VL,dim,lim,rat)% SGlim(VL,dim,lim,rat) - compresses the vertex coordinates outside a limit without changing the VL or FL
% (by Tim Lueth, VLFL-Lib, 2018-NOV-22 as class: SURFACES)
%
% This is an auxiliary to "cut" the shape of a solid by simply
% compressing the coordianates outside by changing the scale outside the
% intervall.
% typically is rat 1000 to convert millimeter in micrometer but if values
% for ratio are < 1; we see a elongation. (Status of: 2018-11-23)
%
% Introduced first in SolidGeometry 4.4
%
% See also: SGcut
%
% VLN=SGlim(VL,[dim,lim,rat])
% === INPUT PARAMETERS ===
% VL: Vertex list
% dim: dimension 1 2 3 ord 'x' 'y' 'z'
% lim: limit max or [min max]
% rat: compression ratio default is 1000;
% === OUTPUT RESULTS ======
% VLN:
%
% EXAMPLE:
% SGgearwormDIN(1,'','',CPLmotorshaft); A=ans; view(-30,30);
% SGlim(A,'y',[-18 18])
% SGlim(A,'x',[-5 5])
% SGlim(A,'y',[-18 18],.1)
%
% See also: SGcut
%
%
% Copyright 2018 Tim C. Lueth

SGfischertechnikaxle- A pluggable axle for edges and gears for Fischertechnik

SGfischertechnikaxle% SGfischertechnikaxle - A pluggable axle for edges and gears for Fischertechnik
% (by Yilun Sun, VLFL-Lib, 2018-NOV-20 as class: MODELING PROCEDURES)
%
% Eine steckbare Achse für Ränder und Getriebe (Status of: 2018-11-20)
%
% Introduced first in SolidGeometry 4.4
%
% See also: SGfischertechniksample
%
% SG=SGfischertechnikaxle
% === OUTPUT RESULTS ======
% SG: SOlid Geometry
%
% EXAMPLE: SG1 = SGftpin;
% SGdimensioning(SG1,0,0,[0 0 0]);
% SGdimensioning(SG1,90,0,[1 0 0]);
%
% See also: SGfischertechniksample
%

PLELofCPLsplitpoints(CPL)- inserts split points into a CPL but does not change the direction of the CPL

PLELofCPLsplitpoints(CPL)% PLELofCPLsplitpoints(CPL) - inserts split points into a CPL but does not change the direction of the CPL
% (by Tim Lueth, VLFL-Lib, 2018-NOV-19 as class: CLOSED POLYGON LISTS)
%
% This fnctn replaces CPLsplitpoints and inserts by delaunaytriangulation
% splits points into contour without changing the direction of the edge
% lists. Overlapping contour still overlap.
% [PL,EL,FL]=PLELofCPLsplitpoints(PLB); TR=triangulation(FL,PL);
% EL=freeBoundary(TR);
% would return a corrected EL but still with non manifold vertices/points
% Use [a,b]=FLseparate(FL) to detect the separated surfaces and solve the
% non manifold vertices problem
%
% (Status of: 2018-11-19)
%
% Introduced first in SolidGeometry 4.4
%
% See also: PLELofCPL, FLseparate
%
% [PL,EL]=PLELofCPLsplitpoints(CPL)
% === INPUT PARAMETERS ===
% CPL: Closed Polygon List
% === OUTPUT RESULTS ======
% PL: POINT LIST
% EL: Edge List
%
% EXAMPLE:
% PLA=[PLcircle(4); nan nan; PLcircle(4)+3]; SGfigure; CVLplot(PLA);
% PLB=[PLcircle(4); nan nan; flipud(PLcircle(4)+3)]; SGfigure; CVLplot(PLB);
% PLELofCPLsplitpoints(PLA);
% PLELofCPLsplitpoints(PLB);
%
% See also: PLELofCPL, FLseparate
%
%
% Copyright 2018 Tim C. Lueth

SGprintervalues- sets some basic printer specific parameters for automatic design fncts

SGprintervalues% SGprintervalues - sets some basic printer specific parameters for automatic design fncts
% (by Tim Lueth, VLFL-Lib, 2018-NOV-19 as class: LANGUAGE PROCEDURES)
%
% Introduced first in SolidGeometry 4.4
%
% See also: nofrd, dofn, sofrd, phiofsr
%
% val=SGprintervalues
% === OUTPUT RESULTS ======
% val: struct
%
% EXAMPLE:
% SGprintervalues
%
%
% See also: nofrd, dofn, sofrd, phiofsr
%
%
% Copyright 2018-2019 Tim C. Lueth

SGinspect (SG,vi,fi)- zooms to inspect specific vertices or facets

SGinspect (SG,vi,fi)% SGinspect (SG,vi,fi) - zooms to inspect specific vertices or facets
% (by Tim Lueth, VLFL-Lib, 2018-NOV-18 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.4
%
% See also: zoompatch
%
% SGinspect(SG,[vi,fi])
% === INPUT PARAMETERS ===
% SG: Solid Geoemetry
% vi: vertex indices to inspect
% fi: facet indices to inspect
%
% See also: zoompatch
%
%
% Copyright 2018 Tim C. Lueth

VLFLreadOBJ(FName,mag,check)- reads in an OBJ file

VLFLreadOBJ(FName,mag,check)% VLFLreadOBJ(FName,mag,check) - reads in an OBJ file
% (by Tim Lueth, VLFL-Lib, 2018-NOV-18 as class: FILE HANDLING)
%
% Since there are different formats in OBJ files
% currently only the format
% f v1 v2 v3
% and f v1/vn v2/vn v3/vn
% and f v1//vn v2//vn v3//vn
% are supported (Status of: 2018-11-18)
%
% Introduced first in SolidGeometry 4.4
%
% See also: SGreadSTL, SGwriteSTL, VLFLwriteSTL, VLFLreadSTL
%
% [VL,FL,H,AbC,FName]=VLFLreadOBJ([FName,mag,check])
% === INPUT PARAMETERS ===
% FName: File Name
% mag: magnification; default is 1
% check: checker; default is false
% === OUTPUT RESULTS ======
% VL: Vertex list
% FL: Facet list
% H: Header, not used in SG-Lib 4.7
% AbC: Colors, not used in SG-Lib 4.7
% FName: Filename
%
% See also: SGreadSTL, SGwriteSTL, VLFLwriteSTL, VLFLreadSTL
%
%
% Copyright 2018-2019 Tim C. Lueth

username- returns user name and host name using JAVA

username% username - returns user name and host name using JAVA
% (by Daniel Shub, VLFL-Lib, 2018-NOV-17 as class: AUXILIARY PROCEDURES)
%
% ..found in the internet.. (Status of: 2018-11-17)
%
% See also: expname, smbFilename, smbPSLibname
%
% [user,host]=username
% === OUTPUT RESULTS ======
% user: user name
% host: host name
%
% EXAMPLE:
% [u,h]=username
%
% See also: expname, smbFilename, smbPSLibname
%

SGselect3d(SG,tx)- Interactive slection of a point, vertex, or facet in a axis

SGselect3d(SG,tx)% SGselect3d(SG,tx) - Interactive slection of a point, vertex, or facet in a axis
% (by Tim Lueth, VLFL-Lib, 2018-NOV-16 as class: USER INTERFACE)
%
% Introduced first in SolidGeometry 4.4
%
% See also: select3d, SGhelptext, SGselect3dPL, SGselect3Dsurface
%
% [p,v,vi,f,fi,haxis]=SGselect3d([SG,tx])
% === INPUT PARAMETERS ===
% SG: Solid geometry; if empty gca is used
% tx: optional menue header
% === OUTPUT RESULTS ======
% p: point
% v: vertex
% vi: vertex index
% f: facet
% fi: facet index
% haxis: gca
%
% EXAMPLE:
% SGselect3d(SGsample(25),'test')
% SGselect3d(SGofSG(SG)), TofPcam(ans)
%
%
%
% See also: select3d, SGhelptext, SGselect3dPL, SGselect3Dsurface
%
%
% Copyright 2018-2020 Tim C. Lueth

FSofSGfacet(SG,fi,alpha)- returns the facet index list of a Feature Surface for a given facet index

FSofSGfacet(SG,fi,alpha)% FSofSGfacet(SG,fi,alpha) - returns the facet index list of a Feature Surface for a given facet index
% (by Tim Lueth, VLFL-Lib, 2018-NOV-16 as class: SURFACES)
%
% This fnctn searches for the corresponding feature surface (FS) based on
% a single facet index (fi). (Status of: 2021-09-13)
%
% Introduced first in SolidGeometry 4.4
%
% See also: FSnormalofSG, FSofSG, FSplot, FSselect
%
% [FIL,fcl]=FSofSGfacet(SG,fi,[alpha])
% === INPUT PARAMETERS ===
% SG: Solid Geoemtry
% fi: Facet index
% alpha: Alpha angle; default is .76
% === OUTPUT RESULTS ======
% FIL: Facet index list for one feature surface
% fcl: facet connectionlist
%
% EXAMPLE:
% FSofSGfacet(SGsample(25),210)
% FSofSGfacet(SGsample(25))
%
% See also: FSnormalofSG, FSofSG, FSplot, FSselect
%
%
% Copyright 2018-2021 Tim C. Lueth

SGcutTa(SG,To,a,delta,bs)- inserts a revolute joint in the center of a solid

SGcutTa(SG,To,a,delta,bs)% SGcutTa(SG,To,a,delta,bs) - inserts a revolute joint in the center of a solid
% (by Tim Lueth, VLFL-Lib, 2018-NOV-15 as class: MODELING PROCEDURES)
%
% Introduced first in SolidGeometry 4.4
%
% See also: SGcutTfischertechnik
%
% [C,A,B,Tc]=SGcutTa([SG,To,a,delta,bs])
% === INPUT PARAMETERS ===
% SG: Solid Geoemtry
% To: Position of the Joint
% a: alpha (amin, amax)
% delta: slot size
% bs: length and height of joint
% === OUTPUT RESULTS ======
% C: Joint Solid
% A: Solid with hole (green)
% B: Solid with pin (Yellow)
% Tc: Center transformation matrix
%
% EXAMPLE:
% SGcutTA(SGtransP(SGcylinder(6,50),[10 0 0]),TofR(rot(0,pi/2,0)))
%
% See also: SGcutTfischertechnik
%
%
% Copyright 2018-2020 Tim C. Lueth

SGcylinder(r,h,n,ri,ry,al)- returns a simple cylinder

SGcylinder(r,h,n,ri,ry,al)% SGcylinder(r,h,n,ri,ry,al) - returns a simple cylinder
% (by Tim Lueth, VLFL-Lib, 2018-NOV-15 as class: SURFACES)
%
% Introduced first in SolidGeometry 4.4
%
% See also: SGbox, SGcone, SGsphere, SGarrow, SGspherelink,
% SGpinwrenchsize, SGspherelink, SGrodlink
%
% SG=SGcylinder([r,h,n,ri,ry,al])
% === INPUT PARAMETERS ===
% r: Radius
% h: Height
% n: number of points
% ri: Inner Radius
% ry: Radius in y
% al: Angle of circle; default is 2*pi
% === OUTPUT RESULTS ======
% SG: Solid Geometry
%
% EXAMPLE:
% SGcylinder(5,30)
% SGcylinder(5,30,6)
% SGcylinder(5,30,6,2)
% SGcylinder(5,30,6,2,10)
% SGcylinder(5,30,'',2,10,2*pi/1.5) % Elliptic with inner bore
%
% See also: SGbox, SGcone, SGsphere, SGarrow, SGspherelink,
% SGpinwrenchsize, SGspherelink, SGrodlink
%
%
% Copyright 2018-2021 Tim C. Lueth

CVLzofSGsliceauto(SG,dz)- returns the slices with a significant z distance

CVLzofSGsliceauto(SG,dz)% CVLzofSGsliceauto(SG,dz) - returns the slices with a significant z distance
% (by Tim Lueth, VLFL-Lib, 2018-NOV-13 as class: SLICES)
%
% same fnctn as CPLofSGsliceauto (Status of: 2018-12-15)
%
% Introduced first in SolidGeometry 4.4
%
% See also: CPLofSGslice, CPLofSGslice2, CPLofSGslice3, CPLofSGsliceauto
%
% CVL=CVLzofSGsliceauto(SG,[dz])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% dz: minimal z change; default is soBB(SG)/50
% === OUTPUT RESULTS ======
% CVL: Closed Vertex List of all z values
%
% EXAMPLE:
% SGreadSTL; A=ans; SGrotateservo(A); B=ans
% CVLzofSGsliceauto(B);
%
%
% See also: CPLofSGslice, CPLofSGslice2, CPLofSGslice3, CPLofSGsliceauto
%
%
% Copyright 2018-2020 Tim C. Lueth

CPLremstraightAmin(CPL,Amin)- removes points with a minal distance/area to a predecessor or successor

CPLremstraightAmin(CPL,Amin)% CPLremstraightAmin(CPL,Amin) - removes points with a minal distance/area to a predecessor or successor
% (by Tim Lueth, EXPERIMENT, 2018-NOV-13 as class: CLOSED POLYGON LISTS)
%
% Same as CVLremstraightAmin
% This fnctn seperates individual CPLs by nan and processes them using
% VLremstraightAmin The result is always an open end CPL! Ohter fnctn
% such as CVLinsertT or CPLaddauxpoints insert additional points into a
% contour (Status of: 2019-03-04)
%
% Introduced first in SolidGeometry 4.4
%
% See also: CVLremstraightAmin, CVLremstraight, CVLinsertT
%
% NPL=CPLremstraightAmin(CPL,[Amin])
% === INPUT PARAMETERS ===
% CPL: Closed Polygon Line in 2D or 3D
% Amin: Minimal Area between two succeeding points; default is 1e-3;
% === OUTPUT RESULTS ======
% NPL: New Vertex List
%
% EXAMPLE:
% CPLremstraightAmin(VLaddz([PLcircle(10,100); nan nan;PLcircle(1,100)]),1)
% CPLremstraightAmin([PLcircle(10,100); nan nan;PLcircle(1,100)],1)
%
% See also: CVLremstraightAmin, CVLremstraight, CVLinsertT
%
%
% Copyright 2018-2019 Tim C. Lueth

CVLzsweep(CVL,)- returns a swept CVL z Contour and a 2.5d solid

CVLzsweep(CVL,)% CVLzsweep(CVL,) - returns a swept CVL z Contour and a 2.5d solid
% (by Tim Lueth, VLFL-Lib, 2018-NOV-13 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.4
%
% See also: CVLsweepslices
%
% CVLn=CVLzsweep(CVL,[])
% === INPUT PARAMETERS ===
% CVL: CVL sliced Contour
% === OUTPUT RESULTS ======
% CVLn: Swept CVLz
%
% EXAMPLE:
% A=SGcmdsample('3156'); CVLzofSGsliceauto(A); CVL=ans;
% CVLzsweep(CVL,pi/2)
%
% See also: CVLsweepslices
%
%
% Copyright 2018-2020 Tim C. Lueth

CPLofSGhull2018(SG)- returns the outer contour of a solid

CPLofSGhull2018(SG)% CPLofSGhull2018(SG) - returns the outer contour of a solid
% (by Tim Lueth, VLFL-Lib, 2018-NOV-12 as class: CLOSED POLYGON LISTS)
%
% =======================================================================
% OBSOLETE (2019-07-01) - USE 'CPLofSGhull' INSTEAD
% =======================================================================
%
% Introduced first in SolidGeometry 4.4
%
% See also: [ CPLofSGhull ] ; CPLofSGslicer, CPLofSGhull
%
% [XY,XZ,YZ]=CPLofSGhull2018(SG)
% === INPUT PARAMETERS ===
% SG: Solid Geoemetry
% === OUTPUT RESULTS ======
% XY: Contour blue
% XZ: Contour green
% YZ: Contour red
%
% EXAMPLE:
% A=SGcmdsample('3156'); CPLofSGhull(A)
%
% See also: [ CPLofSGhull ] ; CPLofSGslicer, CPLofSGhull
%
%
% Copyright 2018-2019 Tim C. Lueth

CPLrepair(OCPL)- returns a corrected polyshape contour

CPLrepair(OCPL)% CPLrepair(OCPL) - returns a corrected polyshape contour
% (by Tim Lueth, VLFL-Lib, 2018-NOV-12 as class: CLOSED POLYGON LISTS)
%
% This fnctn is nothing else polyshape but explains the principle of
% polyshape.
% PLA=[PLcircle(4); nan nan; PLcircle(4)+3];
% ps=polyshape(PLA,'Simplify',false); CPL=ps.Vertices; SGfigure;
% CVLplot(CPL);
% ps=polyshape(PLA,'Simplify',true); CPL=ps.Vertices; SGfigure;
% CVLplot(CPL);
%
% (Status of: 2018-11-19)
%
% Introduced first in SolidGeometry 4.4
%
% See also: CPLsplitpoints, CPLrecontour, CPLmeltbool
%
% [CPL,NP]=CPLrepair(OCPL)
% === INPUT PARAMETERS ===
% OCPL: Original Contour line
% === OUTPUT RESULTS ======
% CPL: Closed
% NP:
%
% EXAMPLE:
% PLA=[PLcircle(4); nan nan; PLcircle(4)+3];
% CPLrepair(PLA); CVLplot(ans); view(0,90);
%
% See also: CPLsplitpoints, CPLrecontour, CPLmeltbool
%
%
% Copyright 2018-2019 Tim C. Lueth

CPLoftesthinge(rmin,delta,sx,sy,txt,h)- returns a shape and a Geometry for a flexible hinge with 180 degree radius

CPLoftesthinge(rmin,delta,sx,sy,txt,h)% CPLoftesthinge(rmin,delta,sx,sy,txt,h) - returns a shape and a Geometry for a flexible hinge with 180 degree radius
% (by Tim Lueth, VLFL-Lib, 2018-NOV-12)
%
% For designing test hinges with different Materials, this fnctn creates
% a coontour and a solid to test those.
% For brittle materials with a low mating limit:
% Select the radius as small as possible so that the stress path is as
% small as possible.
% 2. define the stiffness with the value delta, the thinner the more
% flexible
% 3 Do not design continuous hinge surfaces, otherwise further critical
% torsion stresses will be added, but parallelise in a yarnlike manner.
% (Status of: 2019-02-10)
%
% Introduced first in SolidGeometry 4.4
%
% [CPL,SG]=CPLoftesthinge([rmin,delta,sx,sy,txt,h])
% === INPUT PARAMETERS ===
% rmin: minimal radius; default is 0.5
% delta: Thickness of circle
% sx: size in x ; default is 10 mm
% sy: size in y ; default is 5 mm
% txt: text; default is rminand delta
% h: height of the solid; default is 1
% === OUTPUT RESULTS ======
% CPL: Closed Polygon line
% SG: Solid Geoemtry
%
% EXAMPLE:
% [a,b]=CPLoftesthinge(0.5,3.0,'','',' '); SGfigure; SGplot(b);
%
%
% Copyright 2018-2019 Tim C. Lueth

CPLBezier(CPL,ns);- returns Bezier Curves from CPLs

CPLBezier(CPL,ns);% CPLBezier(CPL,ns); - returns Bezier Curves from CPLs
% (by Tim Lueth, VLFL-Lib, 2018-NOV-09 as class: CLOSED POLYGON LISTS)
%
% Introduced first in SolidGeometry 4.4
%
% See also: VLBezierC, CPLfft, CPLBezier
%
%
% CPLB=CPLBezier(CPL,[ns]);
% === INPUT PARAMETERS ===
% CPL: CPL
% ns: number of Beziercoefficients
% === OUTPUT RESULTS ======
% CPLB: Contours of CPL as Bezier Curves
%
% EXAMPLE:
% CPLBezier(CPLsample(12),5);
% CPLBezier(PLtransT(CPLsample(12),TofR(rot(10),[30 30])),5);
% CPLBezier(PLtransT(CPLsample(12),TofR(rot(10),[30 30])),100);
%
% See also: VLBezierC, CPLfft, CPLBezier
%
%
%
% Copyright 2018-2019 Tim C. Lueth

RPofTrelT(TA,TB)- returns the frame T2 in relation to frame T1

RPofTrelT(TA,TB)% RPofTrelT(TA,TB) - returns the frame T2 in relation to frame T1
% (by Tim Lueth, VLFL-Lib, 2018-NOV-07 as class: ANALYTICAL GEOMETRY)
%
% simple fnctn T=inv(T1)*T2 or T1\T2;
% afterwards rotm2eul(T(1:3,1:3),'XYZ'); (Status of: 2018-11-07)
%
% Introduced first in SolidGeometry 4.4
%
% See also: TofR
%
% [R,P,A_T_B]=RPofTrelT(TA,TB)
% === INPUT PARAMETERS ===
% TA: Frame A
% TB: Frame B
% === OUTPUT RESULTS ======
% R: Rotation angles (euler) XYZ
% P: Distance
% A_T_B: Frame B relative to Frame A
%
% EXAMPLE:
% rotm2axang(rot(a))
% SG=SGbending(SGofCPLzdelaunayGrid(PL,4,2,2,2),40);
%
% See also: TofR
%
%
% Copyright 2018 Tim C. Lueth

SGcutTcrossblade(SG,T,d,ct)- removes a part out of a solid

SGcutTcrossblade(SG,T,d,ct)% SGcutTcrossblade(SG,T,d,ct) - removes a part out of a solid
% (by Tim Lueth, VLFL-Lib, 2018-NOV-07 as class: SURFACES)
%
% Cuts out a block using a Transformation matrix and a slot size. In case
% of an interactive specification of the T matrix (TofPcam) it is
% possible to specify 'a'xial, 'c'oronal or 's'agittal as orientation.
% (Status of: 2022-01-20)
%
% Introduced first in SolidGeometry 4.4
%
% See also: SGcutT, BBofSGcutT, SGcut, SGcut2, SGcutBB, SGcutTCPL,
% SGcutTcylindricblade, SGseparatebyT
%
% [A,B,Tc]=SGcutTcrossblade([SG,T,d,ct])
% === INPUT PARAMETERS ===
% SG: Solid Geoemtry
% T: cutting frame
% d: slot in size
% ct: orientation 'default' is '-a',; 'c', 's', 'a'
% === OUTPUT RESULTS ======
% A: Cutted Solid (green)
% B: Blade solid (red)
% Tc: Used cutting Frame
%
% EXAMPLE:
% loadweb ADAM_A.mat; SGsurfaces(ADAM_A); A=ans; % Separate STL into limbs
% SGcutTcrossblade(A{1})
%
%
% See also: SGcutT, BBofSGcutT, SGcut, SGcut2, SGcutBB, SGcutTCPL,
% SGcutTcylindricblade, SGseparatebyT
%
%
% Copyright 2018-2022 Tim C. Lueth

randminv(r,c,rmin)- returns a random fnct that has a minimal value

randminv(r,c,rmin)% randminv(r,c,rmin) - returns a random fnct that has a minimal value
% (by Tim Lueth, VLFL-Lib, 2018-NOV-07 as class: AUXILIARY PROCEDURES)
%
% Introduced first in SolidGeometry 4.4
%
% See also: randsupp, randol
%
% r=randminv(r,c,[rmin])
% === INPUT PARAMETERS ===
% r: rows
% c: cols
% rmin: minimal value or [rmin rmax]; default is [rmin 1]
% === OUTPUT RESULTS ======
% r: random matrix
%
% See also: randsupp, randol
%
%
% Copyright 2018-2020 Tim C. Lueth
RapidWeaver Icon

Last Change Oct 2023 for SG-Lib 5.3