Last change of this documentation page: 2022-06-02 of SolidGeometry 3.4
PLoutercontour(CPL,out)- returns a point list that has no crossings

PLoutercontour(CPL,out)% PLoutercontour(CPL,out) - returns a point list that has no crossings
% (by Tim Lueth and Jelena Prsa, VLFL-Lib, 2017-FEB-27 as class: CLOSED
% POLYGON LISTS)
%
% In some cases, a fnctn such as CPLgrow creates cross that cross itself.
% In this case, cw-oriented CPLs should return only the outer parts of
% the contour and ccw-oriented CPLs should return the inner part of the
% contour; The direction is detected automatically but can be overwritten
% by the parameter out. Out=true => the outer contour is returned.
% Out=false => the inner contour is returned.
% ATTENTION: PLoutercontour may create split points; use
% PL=unique([PL;PLN],'rows','stable') to add the splits points to the
% original points list (Status of: 2017-02-28)
%
% Introduced first in SolidGeometry 3.4
%
% See also: CPLoutercontour, CPLgrow
%
% [PLN,PLX]=PLoutercontour([CPL,out])
% === INPUT PARAMETERS ===
% CPL: Point List
% out: returns the FIRST outer contour if true; if false the first inner;
% default is true
% === OUTPUT RESULTS ======
% PLN: Single Point List of the FIRST outer contour
% PLX: Singe Point List of the FIRST outer contour
%
% EXAMPLE:
% PLoutercontour(CPLgrow(CPLofPL(PLgearDIN(0.5,25)),-0.3),false);
%
% See also: CPLoutercontour, CPLgrow
%
%
% Copyright 2017 Tim C. Lueth

TregisterConvexHull(VLA,VLB)- returns the registration matrix based on the convex hull of the vertices

TregisterConvexHull(VLA,VLB)% TregisterConvexHull(VLA,VLB) - returns the registration matrix based on the convex hull of the vertices
% (by Tim Lueth, VLFL-Lib, 2017-FEB-24 as class: ANALYTICAL GEOMETRY)
%
% This fnctn is just a simple fnctn for registering voxel models with
% their original Solid Geoemtry (Status of: 2017-02-24)
%
% T=TregisterConvexHull(VLA,VLB)
% === INPUT PARAMETERS ===
% VLA: Vertex list A or Solid A
% VLB: Vertex list B or Solid B
% === OUTPUT RESULTS ======
% T: Transformation from B into A
%
% EXAMPLE: Show the result of a random geoemtry
% T=TofR(rot(pi/3,pi,6,pi/9,[10 10 10])), inv(T), VL=rand(10,3);
% TregisterConvexHull(VL,VLtransT(VL,T))
%
%

VMofSG(SG,n,adjxy,shsl)- returns a voxel model of a Solid Geoemtry

VMofSG(SG,n,adjxy,shsl)% VMofSG(SG,n,adjxy,shsl) - returns a voxel model of a Solid Geoemtry
% (by Tim Lueth, VLFL-Lib, 2017-FEB-23 as class: VOXELS)
%
% The voxel size is adjusted automatically to maximize the resolution.
% The absolute position in space is lost. The orientation is unchanged.
% (Status of: 2018-08-24)
%
% Introduced first in SolidGeometry 3.4
%
% See also: SGweight, SGvolume, SGisInterior, SGofVMdelaunay,
% SGofVMmarchcube, VMplot
%
% [VM,vs,SGN]=VMofSG([SG,n,adjxy,shsl])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% n: Voxel size vector; default is [64 64 64]
% adjxy: adjust x and y size; default is false
% shsl: delay per slice if progress should be shown
% === OUTPUT RESULTS ======
% VM: Voxel Model
% vs: Voxel size
% SGN: Optional Solid by marching cube
%
% See also: SGweight, SGvolume, SGisInterior, SGofVMdelaunay,
% SGofVMmarchcube, VMplot
%
%
% Copyright 2017-2019 Tim C. Lueth

VMplot (IM,p,SG)- plots a 3D volumetric matrix in 2x2 view

VMplot (IM,p,SG)% VMplot (IM,p,SG) - plots a 3D volumetric matrix in 2x2 view
% (by Tim Lueth, NAV-Lib, 2017-FEB-23 as class: VISUALIZATION)
%
% Based on VMplot_2012. Does support sliders for scrolling, and 3D
% visualization;
%
% Global VMplotPos specifies the cross hair position
% (Status of: 2017-04-02)
%
% Introduced first in SolidGeometry 3.4
%
% See also: VMintensityscale, VMscatter, VMimage, VMimrot90, VMmontage,
% VMpseudo3D, VMreaddicom, VMreaddicomdir, VMuidicom, VMgetSubplot,
% VMginput
%
% VMplot([IM,p,SG])
% === INPUT PARAMETERS ===
% IM: 3D Matrix
% p: optional point of interest; default is center
% SG: optional solid of the Volume;
%
% EXAMPLE:
% [V,vs]=VMreaddicomdir('/Volumes/LUETH-WIN/WIN AIM Matlab Libraries/VLFL-Lib/AIM_DICOMFILES');
% [V,vs]=VMresize(V,vs,vs);
% SG=SGofVMdelaunay(V>1400,vs);
% VMplot(V,'',SG)
%
% See also: VMintensityscale, VMscatter, VMimage, VMimrot90, VMmontage,
% VMpseudo3D, VMreaddicom, VMreaddicomdir, VMuidicom, VMgetSubplot,
% VMginput
%
%
% Copyright 2017-2019 Tim C. Lueth

pixelofaxis- returns the axis position of the current axis in the figure

pixelofaxis% pixelofaxis - returns the axis position of the current axis in the figure
% (by Tim Lueth, VLFL-Lib, 2017-FEB-23 as class: USER INTERFACE)
%
% This fnctn is useful for placing uicontrol objects relative to subplots
% such as in VMplot (Status of: 2018-08-20)
%
% Introduced first in SolidGeometry 3.4
%
% See also: uipanel, uicontrol, pixelpositionofP, vertexpicker, select3d,
% getpixelposition
%
% sp=pixelofaxis
% === OUTPUT RESULTS ======
% sp: [left bottom size-x size-y]
%
% EXAMPLE:
% subplot(2,2,4);
% sp=pixelofaxis
% uicontrol('Style', 'popup','String', {'R-Joint','P-Joint','G-Joint'},'Position', sp)
%
% See also: uipanel, uicontrol, pixelpositionofP, vertexpicker, select3d,
% getpixelposition
%
%
% Copyright 2017-2018 Tim C. Lueth

SGsurfaceplot(SG,SIL,si)- plots the separated surfaces of SG in different colors

SGsurfaceplot(SG,SIL,si)% SGsurfaceplot(SG,SIL,si) - plots the separated surfaces of SG in different colors
% (by Tim Lueth, VLFL-Lib, 2017-FEB-22 as class: SURFACES)
%
% =======================================================================
% OBSOLETE (2019-12-09) - USE 'SGplotsurfaces' INSTEAD
% =======================================================================
%
% Try to avoid this fnctn and better use SGseparate and SGplotsurfaces.
% This fnctn is a mix of both. (Status of: 2018-08-21)
%
% Introduced first in SolidGeometry 3.4
%
% See also: [ SGplotsurfaces ] ; SGfigure, SGplot, SGseparate,
% SGsurfaces, SGsurfacehistogram, SGwriteSeparatedSTL, SGpuzzlecut3D,
% SGsurfacessort, SGplotcell, SGplotsurfaces
%
% [SG,SIL]=SGsurfaceplot(SG,[SIL,si])
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% SIL: Surface index list decending sorted by number of facets;
% si: solid index for plot
% === OUTPUT RESULTS ======
% SG: Solid Geometry
% SIL: Surface Index List; created if missing
%
% See also: [ SGplotsurfaces ] ; SGfigure, SGplot, SGseparate,
% SGsurfaces, SGsurfacehistogram, SGwriteSeparatedSTL, SGpuzzlecut3D,
% SGsurfacessort, SGplotcell, SGplotsurfaces
%
%
% Copyright 2017-2019 Tim C. Lueth

camset (p,d,ez)- sets the camera target to inspect a specific target point

camset (p,d,ez)% camset (p,d,ez) - sets the camera target to inspect a specific target point
% (by Tim Lueth, VLFL-Lib, 2017-FEB-21 as class: USER INTERFACE)
%
% if no position is specified, the user will be requested to select a
% point by a cross hair (Status of: 2018-10-14)
%
% Introduced first in SolidGeometry 3.4
%
% See also: zoompatch, camplot, tcamera
%
% camset([p,d,ez])
% === INPUT PARAMETERS ===
% p: point; default is '';
% d: diameter of axis; default is 1/10 of the current view
% ez: direction to camera position;
%
% EXAMPLE:
% camset ('',100); camplot;
%
% See also: zoompatch, camplot, tcamera
%
%
% Copyright 2017-2020 Tim C. Lueth

camplot- plots a line of the current camera position

camplot% camplot - plots a line of the current camera position
% (by Tim Lueth, VLFL-Lib, 2017-FEB-21 as class: USER INTERFACE)
%
% See also: zoommpatch, camset, tcamera
%
% [p0,p1,v,a]=camplot
% === OUTPUT RESULTS ======
% p0: CameraPosition
% p1: CameraTarget
% v: CameraViewAngle
% a: axis
%

exp_2017_02_21- EXPERIMENT SCRIPT to load and precalcuate a skull bone surface model

exp_2017_02_21% exp_2017_02_21 - EXPERIMENT SCRIPT to load and precalcuate a skull bone surface model
% (by Tim Lueth, VLFL-Lib, 2017-FEB-21 as class: EXPERIMENTS)
%
% exp_2017_02_21
%

selectCameraPosition (p)- selects and sets the camera position

selectCameraPosition (p)% selectCameraPosition (p) - selects and sets the camera position
% (by Tim Lueth, VLFL-Lib, 2017-FEB-21 as class: USER INTERFACE)
%
% selectCameraPosition([p])
% === INPUT PARAMETERS ===
% p: point to set; default is empty
%

SGofVMdelaunay(V,vs,s)- returns a surface model for a delaunay reconstructed volume model

SGofVMdelaunay(V,vs,s)% SGofVMdelaunay(V,vs,s) - returns a surface model for a delaunay reconstructed volume model
% (by Tim Lueth, VLFL-Lib, 2017-FEB-17 as class: VOXELS)
%
% This fnctn takes about 20 second for a 256 x 256 x 100 voxel model.
% (Status of: 2017-02-18)
%
% See also: VLFLofVMdelaunay, VLFLofVMmarchcube, TR3ofVM, SGofVMmarchcube
%
% [SG,TR4]=SGofVMdelaunay(V,[vs,s])
% === INPUT PARAMETERS ===
% V: Voxel Model (~=0 is reconstruction)
% vs: voxel size, optional
% s: step size
% === OUTPUT RESULTS ======
% SG: Solid Geoemtry
% TR4: Delaunay tetrahedron model
%
% EXAMPLE:
% [V,vs]=VMreaddicomdir('AIM_DICOMFILES');
% [a,as]=VMresize(V,[0.5 0.5 0.5],vs);
% SG=SGofVMdelaunay(a>1400,as);
% SGcut(SG,40);
% c=CPLofSGslice3(SG,20);
% PLFLofCPLdelaunay(c);
% PLFLofCPLpoly(c)
%

SGofVMmarchcube(V,vs,cl)- returns a surface model by the marching cubes

SGofVMmarchcube(V,vs,cl)% SGofVMmarchcube(V,vs,cl) - returns a surface model by the marching cubes
% (by Tim Lueth, VLFL-Lib, 2017-FEB-17 as class: VOXELS)
%
% This fnctn uses the MarchingCubes fnctn from Matlab Central written by
% Peter Hammer in 2011 based on the Octave fnctn written by Martin Helm
% (www.mhelm.de/octave/m/marching_cube.m) in 2009. It contains also code
% from Oliver Woodford for removing duplicated vertices. (Status of:
% 2018-08-24)
%
% Introduced first in SolidGeometry 3.4
%
% See also: VLFLofVMdelaunay, VLFLofVMmarchcube, TR3ofVM, SGofVMdelaunay
%
% SG=SGofVMmarchcube(V,[vs,cl])
% === INPUT PARAMETERS ===
% V: Logical Volume Model
% vs: voxel size, optional
% cl: closes open facets by adding empty planes; default is true
% === OUTPUT RESULTS ======
% SG: Vertex list
%
% EXAMPLE: [V,vs]=VMreaddicomdir('AIM_DICOMFILES'); [a,as]=VMresize(V,[0.5 0.5 0.5],vs);
% SG=SGofVMmarchcube(a>1400,as);
% SGcut(SG,40);
% c=CPLofSGslice3(SG,20);
% PLFLofCPLdelaunay(c);
% PLFLofCPLpoly(c)
% % Understanding the Existance or creation of non manifold edges
% V=zeros(3,3,3); for i=1:numel(V); if isodd(i); V(i)=1; end; end; SGofVMmarchcube(V,[],false)
% V=zeros(3,3,3); for i=1:numel(V); if isodd(i); V(i)=1; end; end; SGofVMmarchcube(V,[],true)
%
%
% See also: VLFLofVMdelaunay, VLFLofVMmarchcube, TR3ofVM, SGofVMdelaunay
%
%
% Copyright 2017-2018 Tim C. Lueth

VMresize(VM,dm,vs)- resizes a voxel image model

VMresize(VM,dm,vs)% VMresize(VM,dm,vs) - resizes a voxel image model
% (by Tim Lueth, VLFL-Lib, 2017-FEB-17 as class: VOXELS)
%
% [V,vs]=[V,vs,vs]); returns voxels of same size 1 mm x 1mm x 1mm
% [V,vs]=[V,vs); returns voxels of same size 1 mm x 1mm x 1mm
% (Status of: 2017-02-17)
%
% See also: VMreaddicomdir, VMmontage, VMplot, VMintensityscale
%
% [FVM,vs]=VMresize(VM,[dm,vs])
% === INPUT PARAMETERS ===
% VM: voxel mode; [X x Y x Z]
% dm: dimension either scale [0.5 0.5 0.5] or vs
% vs: optional voxel size for rescaling; default is dm
% === OUTPUT RESULTS ======
% FVM: New Voxel Model with new dimensions
% vs: Voxel size after resizing
%
% EXAMPLE:
% [V,vs]=VMreaddicomdir('AIM_DICOMFILES');
% VMresize(V,vs,vs); % voxel size = 1 mm
% VMresize(V,vs/2,vs); % voxel size = 2 mm
%

SGgethandle(SG)- returns a handle if the object is already drawn in gca

SGgethandle(SG)% SGgethandle(SG) - returns a handle if the object is already drawn in gca
% (by Tim Lueth, VLFL-Lib, 2017-FEB-14 as class: USER INTERFACE)
%
% Does not support all kinds of SG yet.
% Is more a VLFLgethandle fnctn (Status of: 2017-02-14)
%
% See also: SGplot
%
% h=SGgethandle(SG)
% === INPUT PARAMETERS ===
% SG: Solid Geometry
% === OUTPUT RESULTS ======
% h: handle
%

selectV3d(SG)- plots a SG in a figure and shows selected normal vectors of a selected corner

selectV3d(SG)% selectV3d(SG) - plots a SG in a figure and shows selected normal vectors of a selected corner
% (by Tim Lueth, VLFL-Lib, 2017-FEB-14 as class: USER INTERFACE)
%
% See also: select3d, vertexpicker
%
% selectV3d([SG])
% === INPUT PARAMETERS ===
% SG: Solid Geometry to plot
%

FLselect(FL,vi)- returns all neighbor facets of ONE SINGLE vi

FLselect(FL,vi)% FLselect(FL,vi) - returns all neighbor facets of ONE SINGLE vi
% (by Tim Lueth, VLFL-Lib, 2017-FEB-14 as class: AUXILIARY PROCEDURES)
%
% Some fnctns such as MLofSG process a complete solid. Nevertheless,
% finally, only facets that are linked to a vertex are required. FLselect
% returns form a FL the index of all facts that contain vi, the reduced
% facet list, and a facet list that is sorted in a way that the FL starts
% always with vi
% (Status of: 2021-03-13)
%
% Introduced first in SolidGeometry 3.4
%
% See also: ELselect, FLofVLFLvi, FLofVLFLfi
%
% [FLv,fi,FLs]=FLselect(FL,vi)
% === INPUT PARAMETERS ===
% FL: Facet list
% vi: index of vertex
% === OUTPUT RESULTS ======
% FLv: reduced facet list
% fi: facet index of FL
% FLs: FL with sortet rows
%
% EXAMPLE:
% [VL,FL]=VLFLcone(30,'',6)
% [FLv,fi,FLs]=FLselect(FL,3)
%
% See also: ELselect, FLofVLFLvi, FLofVLFLfi
%
%
% Copyright 2017-2021 Tim C. Lueth

VLbreakEdges(VL,R)- returns a vertex list (VL) with broken edges

VLbreakEdges(VL,R)% VLbreakEdges(VL,R) - returns a vertex list (VL) with broken edges
% (by Tim Lueth, VLFL-Lib, 2017-FEB-13 as class: ANALYZING PROCEDURES)
%
% Replaces edges by a simple shortcut. The desired radius can be reduced
% automatically if necessary. It is possible to maximize the radius
% automatically.
% In case that R is negative; VLradialEdges is used instead (Status of:
% 2019-06-30)
%
% Introduced first in SolidGeometry 3.4
%
% See also: PLradialEdges, SGcontourtube, RLofEulerInterpolation,
% VLinsertEulerSteps, VLradialEdges, TofPez, PLtangentcirc,
% VLtangentcirc, SGbreakCorners, SGradialCorners
%
% NVL=VLbreakEdges(VL,[R])
% === INPUT PARAMETERS ===
% VL: Vertex list nx3
% R: Radius; default is 1
% === OUTPUT RESULTS ======
% NVL: New vertex list
%
% EXAMPLE:
% VL=rounddiv(rand(6,3)*100,5)
% VLbreakEdges(VL,2)
% VLbreakEdges([0 0 0;0 0 100; 100 0 100;100 100 100]); view(0,0)
% VLbreakEdges([0 0 0;0 0 100; 100 0 0],10); view(0,0)
%
% See also: PLradialEdges, SGcontourtube, RLofEulerInterpolation,
% VLinsertEulerSteps, VLradialEdges, TofPez, PLtangentcirc,
% VLtangentcirc, SGbreakCorners, SGradialCorners
%
%
% Copyright 2017-2019 Tim C. Lueth

SGcone(H,R,nf,Hc)- returns a solid geometry of a cone

SGcone(H,R,nf,Hc)% SGcone(H,R,nf,Hc) - returns a solid geometry of a cone
% (by Tim Lueth, VLFL-Lib, 2017-FEB-13 as class: MODELING PROCEDURES)
%
% uses VLFLcone; (Status of: 2020-08-01)
%
% Introduced first in SolidGeometry 3.4
%
% See also: SGconetruncated, VLFLcone, SGsphere, SGbox, SGlinkage, SGtext
%
% [SG,FL,FLb]=SGcone(H,[R,nf,Hc])
% === INPUT PARAMETERS ===
% H: Height
% R: Radius; default is H/2
% nf: Number of facets, default is 16
% Hc: height of the Truncated cone
% === OUTPUT RESULTS ======
% SG: Vertex list
% FL: Facet list of the cone
% FLb: Facet list of the bottom
%
% EXAMPLE:
% SGcone(40,6)
% SGcone(40,6,'',10)
%
% See also: SGconetruncated, VLFLcone, SGsphere, SGbox, SGlinkage, SGtext
%
%
% Copyright 2017-2020 Tim C. Lueth

exp_2017_02_13 (A,vi,R)- Experiment for analyzing normal vectors of facets and corners and edges

exp_2017_02_13 (A,vi,R)% exp_2017_02_13 (A,vi,R) - Experiment for analyzing normal vectors of facets and corners and edges
% (by Tim Lueth, VLFL-Lib, 2017-FEB-13 as class: EXPERIMENTS)
%
% Around mid Feb, im getting tired to reimplement CAD fnctns that I just
% need to convince students/researcher that are used to use CATIA instead
% of improving design processes (Status of: 2017-02-14)
%
% exp_2017_02_13([A,vi,R])
% === INPUT PARAMETERS ===
% A: Solid Geoemtry
% vi: vertex of interest (corner); 0 == select graphically
% R: Optional Radius
%

FLofDelaunay(VL,vni,EL,force2D)- returns the convex hull of a vertex list

FLofDelaunay(VL,vni,EL,force2D)% FLofDelaunay(VL,vni,EL,force2D) - returns the convex hull of a vertex list
% (by Tim Lueth, VLFL-Lib, 2017-FEB-12 as class: SURFACES)
%
% Improved over time from SG-Lib 3.4 to 5.0, works with 2D and 3D and
% plane surfaces in 3D.
% By intention, matlab's delaunayTriangulation does not return a
% tesselation for 3D coordinates if all vertices are in one plane since
% in 3D the fnctns returns a tetrahedron tesselation. In this case, a
% transformation matrix is calculated from the vertex list, the vertex
% list is transformed into a 2Dpoint list, and a 2D tesselation is
% returned. SOMETIMES, delaunayTriangulation, returns also a
% 3D-tesselation for planar structures. THis has to be detected in future
% (Status of: 2020-09-13)
%
% Introduced first in SolidGeometry 3.4
%
% See also: FLofVLPLofVLplaneprojection
%
% [FL,NVL]=FLofDelaunay(VL,[vni,EL,force2D])
% === INPUT PARAMETERS ===
% VL: Vertex list (nx2) or (nx3)
% vni: optional index of VL
% EL: optional EL as constraints
% force2D: if true; a 2D tesselation is forced; default is false
% === OUTPUT RESULTS ======
% FL: Facet list to close VL(vni,:)
% NVL:
%
% EXAMPLE:
% FLofDelaunay(VLtransR(VLaddz(PLstar(10,30),30),rot(pi/3,pi/3,pi/3)))
% FLofDelaunay(rand(100,3)*100-50)
% VL=VLtransR(VLaddz(PLstar(10,30),30),rot(pi/3,pi/3,pi/3));
% FLofDelaunay(VL); textVL(VL); % Default triangulation
% FLofDelaunay(VL,'',[12 26]); textVL(VL); % EDGE 12-26 exist
%
% See also: FLofVLPLofVLplaneprojection
%
%
% Copyright 2017-2020 Tim C. Lueth

SGradialCorners(A,R,vi)- should breaks corners and edges of solids

SGradialCorners(A,R,vi)% SGradialCorners(A,R,vi) - should breaks corners and edges of solids
% (by Tim Lueth, VLFL-Lib, 2017-FEB-12 as class: SURFACES)
%
% ATTENTION Parameter order changef in 4.0: from A,vi,R ==> A,R,vi
%
% If vi==0, the user should select interactively a vertex
% First all patches/plane surfaces connected to an corner are calculated.
% For the further calculation only the vertices are used that define the
% outer limits of the face. This fnctn uses VLradialEdges to replace the
% original edges at a corned by a corved convex element.
% * When R is negative, the corners are broken instead of curved (Status
% of: 2017-07-19)
%
% Introduced first in SolidGeometry 3.4
%
% See also: SGbreakCorners, VLradialEdges
%
% A=SGradialCorners([A,R,vi])
% === INPUT PARAMETERS ===
% A: Solid Geometry
% R: radius; default is 1mm; corner break for negative R values!
% vi: list of corned index (n) or corner vertex list (nx3); default is ''
% === OUTPUT RESULTS ======
% A: Solid Geometry with rounded corners
%
% See also: SGbreakCorners, VLradialEdges
%

findVL(NVL,VL,ai,thr)- returns the indices of a list in another list

findVL(NVL,VL,ai,thr)% findVL(NVL,VL,ai,thr) - returns the indices of a list in another list
% (by Tim Lueth, VLFL-Lib, 2017-FEB-12 as class: AUXILIARY PROCEDURES)
%
% =======================================================================
% OBSOLETE (2020-08-22) - USE 'VLcorrelate' INSTEAD
% =======================================================================
%
% This fnctn finds the indices of some vertices in a longer list. For a
% complete remapping use fnctn "maprows".
% bi=findVL(VL,ai); bi=ai(bi)
% VLcorrelate is at least twice as fast
% maprows is extremely and unbeatable fast (Status of: 2020-08-22)
%
% Introduced first in SolidGeometry 3.4
%
% See also: [ VLcorrelate ] ; maprows, reversesortindex, VLFLreorder,
% VLcorrelate
%
% bi=findVL(NVL,VL,[ai,thr])
% === INPUT PARAMETERS ===
% NVL: Long vertex list to search in; must be unique!
% VL: Second vertex list to find in NVL
% ai: optional index list to search for
% thr: threshold for find; default is 1e-12
% === OUTPUT RESULTS ======
% bi: index in NVL
%
% EXAMPLE:
% VL=rounddiv(rand(20,3)*100,5)-50
% findVL(VL,ELunsort(VL))
% findVL([VL; 0 0 0],[ELunsort(VL); 3333 3333 3333])
%
% See also: [ VLcorrelate ] ; maprows, reversesortindex, VLFLreorder,
% VLcorrelate
%
%
% Copyright 2017-2020 Tim C. Lueth

exp_2017_02_12(A,vi,R)- Experiment to show the breaking of vertices

exp_2017_02_12(A,vi,R)% exp_2017_02_12(A,vi,R) - Experiment to show the breaking of vertices
% (by Tim Lueth, VLFL-Lib, 2017-FEB-12 as class: EXPERIMENTS)
%
% First all patches/plane surfaces connected to an corner are calculated.
% For the further calculation only the vertices are used that define the
% outer limits of the surface.
% This fnctn uses VLradialEdges to replace the original edges at a corned
% by a corved convex element. (Status of: 2017-02-12)
%
% See also: SGbreakvertices, SGradialCorners, exp_2017_02_01
%
% A=exp_2017_02_12([A,vi,R])
% === INPUT PARAMETERS ===
% A: Solid Geoemtry
% vi: list of corned index (n) or corner vertex list (nx3); default is 4
% R: radius; default is 1mm
% === OUTPUT RESULTS ======
% A: Solid Geoemtry with rounded corners
%

Tof2vec(p1,p2,q1,q2)- returns transformation matrix based on the 2 point movements

Tof2vec(p1,p2,q1,q2)% Tof2vec(p1,p2,q1,q2) - returns transformation matrix based on the 2 point movements
% (by Tim Lueth, VLFL-Lib, 2017-FEB-08 as class: ANALYTICAL GEOMETRY)
%
% This fnctn helps to transform points from one coordinate system into
% another based on two known point movements. P1 is the center of the 1st
% and P2 is the center of the second system.
% W_T_P1 and W_T_P2 ==> P2_T_P1 ==> P2_T_P1 * P1_P (Status of:
% 2017-02-09)
%
% See also: TofR, TofVL, TPL, TofDPhiH, T3ofT2, T3P, T2P, TofP, TofPez,
% TofPEul
%
% [T12,T21]=Tof2vec(p1,p2,q1,q2)
% === INPUT PARAMETERS ===
% p1: 1st point before movement
% p2: 1st point after movement
% q1: 2nd point before movement
% q2: 2nd point before movement
% === OUTPUT RESULTS ======
% T12: 2_T_1 Transformation from T1 into T2
% T21: 1_T_2 Transformation from T2 into T1
%
% EXAMPLE:
% Tof2vec([0 10],[-10 10],[0 15],[-20 10])
%

CPLfaceplot(PL,c,w,a)- plots the faces of a CPL

CPLfaceplot(PL,c,w,a)% CPLfaceplot(PL,c,w,a) - plots the faces of a CPL
% (by Tim Lueth, VLFL-Lib, 2017-FEB-08 as class: CLOSED POLYGON LISTS)
%
% In contrast to CPLplotasPS, this fnctn is not using the polyshape
% concept but the delaunay concept (Status of: 2018-12-26)
%
% Introduced first in SolidGeometry 3.4
%
% See also: CPLplotasPS, CPLplot, CPLplotregions, CPLplotcolors,
% CPLplotinout
%
% h=CPLfaceplot(PL,[c,w,a])
% === INPUT PARAMETERS ===
% PL: Point List or CPL
% c: color
% w: countour width
% a: alpha; default is 0.5
% === OUTPUT RESULTS ======
% h: handle
%
% EXAMPLE:
% SGfigure;
% CPLfaceplot([PLcircle(20);NaN NaN; [0 0; 10 0; 5 5]],'b',0.1)
%
% See also: CPLplotasPS, CPLplot, CPLplotregions, CPLplotcolors,
% CPLplotinout
%
%
% Copyright 2017-2018 Tim C. Lueth

textP(p,str,delx,dely,Fnts)- draws a texlabel text at the position

textP(p,str,delx,dely,Fnts)% textP(p,str,delx,dely,Fnts) - draws a texlabel text at the position
% (by Tim Lueth, VLFL-Lib, 2017-FEB-07 as class: ANALYTICAL GEOMETRY)
%
% Introduced first in SolidGeometry 3.4
%
% See also: textT, textVL, textCVL, textVLFL, VLFLfaceNormalplot
%
% h=textP(p,str,[delx,dely,Fnts])
% === INPUT PARAMETERS ===
% p: point
% str: texlabel
% delx: displacement x; default is 0.02 (2%)
% dely: displacement y; default is 0.02 (2%)
% Fnts: Fontsize; default is 16
% === OUTPUT RESULTS ======
% h: handle to text
%
% See also: textT, textVL, textCVL, textVLFL, VLFLfaceNormalplot
%
%
% Copyright 2017 Tim C. Lueth

exp_2017_02_07-

exp_2017_02_07% exp_2017_02_07 -
% (by Tim Lueth, VLFL-Lib, 2017-FEB-07 as class: ANALYTICAL GEOMETRY)
%
% exp_2017_02_07
%

aplot(pc,la,lb,c,w,r,alpha)- draws an angle relative to a center and two vectors

aplot(pc,la,lb,c,w,r,alpha)% aplot(pc,la,lb,c,w,r,alpha) - draws an angle relative to a center and two vectors
% (by Tim Lueth, VLFL-Lib, 2017-FEB-07 as class: ANALYTICAL GEOMETRY)
%
% See also: aplot, pplot, lplot, tfplot, tlplot, slplot, plotTP, plotL,
% plotT, T2Plot, textP, textT, textVL
%
% [h,pt,a]=aplot(pc,la,[lb,c,w,r,alpha])
% === INPUT PARAMETERS ===
% pc: center of angle
% la: 1st vector
% lb: 2nd vector or angle or rotation matrix
% c: color; default is 'r'
% w: width of lines; default is 1;
% r: radius; default is
% alpha: transparency
% === OUTPUT RESULTS ======
% h: handle to all elements of the angle drawing
% pt: point for text desciption
% a: angle that was used if lb was a vector
%
% EXAMPLE:
% [h,pt]=aplot ([0 0],[10 0],3.5*pi/2)
% textP(pt,'alpha');
%

T2ofT3(T3)- returns 3x3 matrices from 4x4 matrices

T2ofT3(T3)% T2ofT3(T3) - returns 3x3 matrices from 4x4 matrices
% (by Tim Lueth, VLFL-Lib, 2017-FEB-07 as class: KINEMATICS AND FRAMES)
%
% Introduced first in SolidGeometry 3.4
%
% T2=T2ofT3(T3)
% === INPUT PARAMETERS ===
% T3:
% === OUTPUT RESULTS ======
% T2:
%
%
% Copyright 2017-2019 Tim C. Lueth

pixelpositionofP(p)- returns the pixelposition of a point coordinate

pixelpositionofP(p)% pixelpositionofP(p) - returns the pixelposition of a point coordinate
% (by Tim Lueth, VLFL-Lib, 2017-FEB-06 as class: USER INTERFACE)
%
% If uipanels or uicontrols should be placed at point coordinates, the
% position of a point coordinate relative to the figure is requested.
% It does not work correctly yet for axis equal;
% Panels are moved correctly, but not fixed pixel positions (Status of:
% 2017-03-19)
%
% See also: uipanel, uicontrol, vertexpicker, select3d, getpixelposition,
% pixelofaxis
%
% [pf,ppf,ppa]=pixelpositionofP(p)
% === INPUT PARAMETERS ===
% p: point coordinate [x y]
% === OUTPUT RESULTS ======
% pf: pixel coordinate in figure (uicontrol)
% ppf: pixel coordinate in percentage of figure (uipanel)
% ppa: pixel coordinate in percentage of axis
%
% EXAMPLE: set a uipanel at 0.8 0.1
% figure; axis on; grid on; axis equal
% pixelpositionofP([0.8 0.1])
%
%

SGmodelLink4(L,L1,L2,K,H)- Creates Solid for a Link im Style "Link4"

SGmodelLink4(L,L1,L2,K,H)% SGmodelLink4(L,L1,L2,K,H) - Creates Solid for a Link im Style "Link4"
% (by Tim Lueth, VLFL-Lib, 2017-FEB-05 as class: MODELING PROCEDURES)
%
% Notation style
% 0= same level
% +n = n* Height H above z plane
% -n = n* height H under z plane
% Knob Position
% 'BU' = Base frame upper side
% 'BL' = Base frame lower sider
% 'BU' = Follower Frame upper side
% 'BL' = Follower Frame lower sider (Status of: 2017-02-05)
%
% See also: SGmodelLink, SGmodelJoint, SGmodelNode, SGmodelLink3,
% SGmodelKeyhole, SGmodelLink1, SGmodelLink2, SGmodelLink3
%
% [SG,SGA,SGB]=SGmodelLink4([L,L1,L2,K,H])
% === INPUT PARAMETERS ===
% L: Length
% L1: Level of Frame B; default is 0
% L2: Level of Frame F; default is 1
% K: Knob position; default is ''
% H: Height of link; default is 9
% === OUTPUT RESULTS ======
% SG: Solid Geoemtry including Frames
% SGA: Left joint of the link
% SGB: Right joint of the link
%
% EXAMPLE:
% A=SGmodelLink4('',0,2);SGaddrelSG(A,A,'alignT',{'B','F'});
% A=SGmodelLink4('',0,1);SGaddrelSG(A,A,'alignT',{'B','F'});
% A=SGmodelLink4('',0,-1,'BL,FU');SGaddrelSG(A,A,'alignT',{'B','F'});
%
%

SGmodelSliderhole(RA,RO,lw,LA,LO,HO,slot,WI)- Creates a SG including a key and a keyhole

SGmodelSliderhole(RA,RO,lw,LA,LO,HO,slot,WI)% SGmodelSliderhole(RA,RO,lw,LA,LO,HO,slot,WI) - Creates a SG including a key and a keyhole
% (by Tim Lueth, VLFL-Lib, 2017-FEB-05 as class: MODELING PROCEDURES)
%
% SG modeling fnctn to create revolute joint that can be printed
% assembled or separated and can be lined on an axis (Status of:
% 2017-02-05)
%
% See also: SGmodelLink, SGmodelJoint, SGmodelNode, SGmodelLink3,
% SGmodelKeyhole, SGmodelLink1, SGmodelLink2
%
% [SGK,SGH,SGP,SGT,SGB]=SGmodelSliderhole([RA,RO,lw,LA,LO,HO,slot,WI])
% === INPUT PARAMETERS ===
% RA: Axle Radius
% RO: Outer Radius
% lw: Length of sliding distance
% LA: [L1 L2 L3] describing key length
% LO: [L1 L2 L3] describing key hole length
% HO: Width of a flange in distance RO; default is 2*RO
% slot: default is 0.3 mm (SLS & SLA)
% WI: Inner Wall Thickness
% === OUTPUT RESULTS ======
% SGK: Solid Geoemtry of Key
% SGH: Solid Geoemtry of Keyhole
% SGP: Solid Geometry of flange plate
% SGT: Optional Knob on the upper side; separated from SGK
% SGB: Optional Knob on the lower side; separated from SGK
%
% EXAMPLE: Print job was successful on Form2 SLA-Printer on 2017-02-05
% SGmodelSliderhole(3,6,'',9)
% [A,B,C,D]=SGmodelSliderhole(3,6,'',9);
% SGanalyzeGroupParts({A,B,C,D})
%
%

PLcircleoval(R,n,L,Ri)- returns a circle-based-oval point-list

PLcircleoval(R,n,L,Ri)% PLcircleoval(R,n,L,Ri) - returns a circle-based-oval point-list
% (by Tim Lueth, VLFL-Lib, 2017-FEB-05 as class: ANALYTICAL GEOMETRY)
%
% Introduced first in SolidGeometry 3.4
%
% See also: PLcircle, PLcircseg, PLevolvente, PLgearDIN, PLhelix,
% PLkidney, PLrand, PLspiral, PLsquare, PLstar
%
% PL=PLcircleoval([R,n,L,Ri])
% === INPUT PARAMETERS ===
% R: Radius
% n: optional number of points for half circle
% L: Length; default is 100; or [A0 B0]
% Ri: optional inner Radius for links; default is 0
% === OUTPUT RESULTS ======
% PL: Point List
%
% EXAMPLE:
% SGfigure; CPLplot(PLcircleoval(10,'',60,5),'r-',2)
% cla; CPLplot(PLcircleoval([10 6],'',[5 10;60 30]),'r-'); shg
%
% See also: PLcircle, PLcircseg, PLevolvente, PLgearDIN, PLhelix,
% PLkidney, PLrand, PLspiral, PLsquare, PLstar
%
%
% Copyright 2017-2022 Tim C. Lueth

PLofCPL(CPL)- converts a nested CPL into a nested PL

PLofCPL(CPL)% PLofCPL(CPL) - converts a nested CPL into a nested PL
% (by Tim Lueth, VLFL-Lib, 2017-FEB-01 as class: CLOSED POLYGON LISTS)
%
% This fnctn is useful if CPLS are extruded to solids. CPLs are contours
% that are separted by NaN NaN. Nevertheless; sometimes the first point
% is doubled at the end, somethimes not. This fnctn returns CPLs that are
% separated by NaN NaN but the point lists are open
% Works with PL and VL (Status of: 2019-06-19)
%
% Introduced first in SolidGeometry 3.4
%
% See also: CPLofPL, CPLofPLcontour
%
% NPL=PLofCPL(CPL)
% === INPUT PARAMETERS ===
% CPL: Closed polygon list with unclear closing condition
% === OUTPUT RESULTS ======
% NPL: Closed polygon list with open polygons
%
% EXAMPLE: Try
% PLofCPL([PLcircle(5);NaN NaN;PLcircle(3)]) % There are no changes
% PLofCPL(CPLsample(7)) % remove the closing lines
% PLofCPL(VLaddz(CPLsample(7))) % Now try with VL
%
% See also: CPLofPL, CPLofPLcontour
%
%
% Copyright 2017-2019 Tim C. Lueth

centerPL(PL)- returns the mean of the convex hull of the point list

centerPL(PL)% centerPL(PL) - returns the mean of the convex hull of the point list
% (by Tim Lueth, VLFL-Lib, 2017-FEB-01 as class: ANALYTICAL GEOMETRY)
%
% See also: center3P, center4P, centerVL
%
% pc=centerPL(PL)
% === INPUT PARAMETERS ===
% PL: Point list (n x 2)
% === OUTPUT RESULTS ======
% pc: point list center
%
% EXAMPLE: try:
% centerPL(rand(10,2))
%

exp_2017_02_01- Experiment to show the breaking of vertices

exp_2017_02_01% exp_2017_02_01 - Experiment to show the breaking of vertices
% (by Tim Lueth, VLFL-Lib, 2017-FEB-01 as class: EXPERIMENTS)
%
% This fnctn uses VLradialEdges to replace the original edges at a corned
% by a corved convex element.
% There is still a problem if more than one point is linked to the corner
% for the same plane surface (Status of: 2017-02-03)
%
% See also: SGbreakvertices, SGradialCorners
%
% exp_2017_02_01
%

woNaN(PL)- returns a row list without all rows that have a NaN in first row

woNaN(PL)% woNaN(PL) - returns a row list without all rows that have a NaN in first row
% (by Tim Lueth, VLFL-Lib, 2017-FEB-01 as class: AUXILIARY PROCEDURES)
%
% For the construction of planar or spacial contours the concept of NaN
% separated polygons was introduced in the mapping toolbox. Nevertheless
% when changing to triangulation representation (delaunaytriangulation or
% triangulation) those NaN are a problem. Either use VLFLselect in case
% that faces exist already or use woNaN to remove the NaN (Status of:
% 2017-02-02)
%
% See also: PLofCPL, VLFLselect, VLELselect
%
% PL=woNaN(PL)
% === INPUT PARAMETERS ===
% PL: vector row list containing NaN
% === OUTPUT RESULTS ======
% PL: vector row list without NaN
%
% EXAMPLE: Shows the effect for closed polygon lines
% PL=PLofCPL([PLcircle(5);NaN NaN;PLcircle(3)])
% CPLplot(PL)
% CPLplot(woNaN(PL))
%

VLtangentcirc(v1,v2,R,M)- creates a vertex list for a tangential circle segment

VLtangentcirc(v1,v2,R,M)% VLtangentcirc(v1,v2,R,M) - creates a vertex list for a tangential circle segment
% (by Tim Lueth, VLFL-Lib, 2017-FEB-01 as class: ANALYTICAL GEOMETRY)
%
% A warning of thrown if the fnctn is called without R as 3rd output
% argument
% This fnctn is used in VLradialedges
% (Status of: 2018-08-05)
%
% Introduced first in SolidGeometry 3.4
%
% See also: VLradialEdges, PLtangentcirc, PLradialEdges, VLradialEdges2T
%
% [VL,Vc,Rmin]=VLtangentcirc([v1,v2,R,M])
% === INPUT PARAMETERS ===
% v1: vector 1 from the origin
% v2: vector 2 from the origin
% R: desired Radius; automatically reduced; default is 1
% M: maximize radius if possible; default is false
% === OUTPUT RESULTS ======
% VL: Vertex list describing a circle segment
% Vc: Circle center of circle segment
% Rmin: Radius that was really possible
%
% EXAMPLE: Try different parameters
% VLtangentcirc
% VLtangentcirc([5 0 0],[5 5 5],0.5)
% VLtangentcirc([5 0 0],[5 5 5],0.5,true)
%
% See also: VLradialEdges, PLtangentcirc, PLradialEdges, VLradialEdges2T
%
%
% Copyright 2017-2018 Tim C. Lueth

PLtangentcirc(p1,p2,p3,R,M)- returns the a circ segment between p1 and p3 with radius R

PLtangentcirc(p1,p2,p3,R,M)% PLtangentcirc(p1,p2,p3,R,M) - returns the a circ segment between p1 and p3 with radius R
% (by Tim Lueth, VLFL-Lib, 2017-JAN-31 as class: ANALYTICAL GEOMETRY)
%
% A warning of thrown if the fnctn is called without R as 3rd output
% argument (Status of: 2018-08-05)
%
% Introduced first in SolidGeometry 3.4
%
% See also: VLradialEdges, VLtangentcirc, PLradialEdges, VLradialEdges2T
%
% [PLS,pc,R]=PLtangentcirc([p1,p2,p3,R,M])
% === INPUT PARAMETERS ===
% p1: 1st point; alternatively PL
% p2: 2nd point; alternatively desired radius
% p3: 3rd point;; alternatively maximize radius;
% R: Desired Radius
% M: maximize radius; default is false
% === OUTPUT RESULTS ======
% PLS: Point List to replace 2nd point of the list
% pc: Center Points of the Radius
% R: Radius used in PLtangentcirc
%
% EXAMPLE: try different examples
% PLtangentcirc (CPLsample(1),5);
% PLtangentcirc (PLsample(5)); % warning
% [~,~,r]=PLtangentcirc (PLsample(5)) % No warning
%
% See also: VLradialEdges, VLtangentcirc, PLradialEdges, VLradialEdges2T
%
%
% Copyright 2017-2018 Tim C. Lueth

VLsample(Nr,T)- returns a sample vertex list for testing algorithms

VLsample(Nr,T)% VLsample(Nr,T) - returns a sample vertex list for testing algorithms
% (by Tim Lueth, VLFL-Lib, 2017-JAN-31 as class: MODELING PROCEDURES)
%
% Introduced first in SolidGeometry 3.4
%
% See also: CPLoftext, CPLsample, SGsample, PLsample, VLFLsample,
% CSGsample, SGerrorsample, SGfischertechniksample, SGcmdsample,
% testfunctTL, permutevector, VLsampletriangles, CVLzsample
%
% [VL,PL]=VLsample([Nr,T])
% === INPUT PARAMETERS ===
% Nr: Nr of sample solid; default is none
% T: Parameter for VLtrans (Value, Vector, Matrix)
% === OUTPUT RESULTS ======
% VL: Solid geometry
% PL: Point list
%
% EXAMPLE:
% VLsample(14)
%
% See also: CPLoftext, CPLsample, SGsample, PLsample, VLFLsample,
% CSGsample, SGerrorsample, SGfischertechniksample, SGcmdsample,
% testfunctTL, permutevector, VLsampletriangles, CVLzsample
%
%
% Copyright 2017-2021 Tim C. Lueth
RapidWeaver Icon

Last Change Oct 2023 for SG-Lib 5.3