Last change of this documentation page: 2025-09-26 of SolidGeometry 5.6
SGwriteSTEP(SG,FNAME)- This fnct exports Solid Geometries as STEP File to disk

SGwriteSTEP(SG,FNAME)% SGwriteSTEP(SG,FNAME) - This fnct exports Solid Geometries as STEP File to disk
% (by Tim Lueth & Robin Schregle, SG-Lib, 2025-SEP-26 as class: IMPORT/EXPORT)
%
% USE CAREFULLY: SGwriteSTEP was not being tested extensively
%
% ISO-10303-21 AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF
% (Status of: 2025-09-26)
%
% Introduced first in SolidGeometry 5.6
%
% See also: STEPmanifoldsolidofSG, SGwriteSTL
%
% fname=SGwriteSTEP(SG,[FNAME])
% === INPUT PARAMETERS ===
% SG: Solid Geometry file name
% FNAME: File name
% === OUTPUT RESULTS ======
% fname: STEP file name
%
% See also: STEPmanifoldsolidofSG, SGwriteSTL
%
%
% Copyright 2025 Tim C. Lueth

SGtoolboxdir- return the path during development or after toolbox installation

SGtoolboxdir% SGtoolboxdir - return the path during development or after toolbox installation
% (by Tim Lueth, SG-Lib, 2025-SEP-24 as class: FILE HANDLING)
%
% SGlibpath and SGtoolboxdir are the same fnctn (Status of: 2025-09-24)
%
% Introduced first in SolidGeometry 5.6
%
% See also: SGlibpath
%
% tbdir=SGtoolboxdir
% === OUTPUT RESULTS ======
% tbdir: toolboxdir
%
% EXAMPLE:
% SGtoolboxdir
%
% See also: SGlibpath
%
%
% Copyright 2025 Tim C. Lueth

SGreadSTEPstructure(fname)- reads in a simple STEP file structure generated by SG-Lib - not in general

SGreadSTEPstructure(fname)% SGreadSTEPstructure(fname) - reads in a simple STEP file structure generated by SG-Lib - not in general
% (by Tim Lueth, SG-Lib, 2025-SEP-24 as class: CODING/DEVELOP)
%
% =======================================================================
% DEVELOPER PROCEDURE (2025-09-26) - NOT INTENDED TO BE RELEASED
% =======================================================================
%
% Recommendation by Rold, Cömert, and Schregle to create a step exporter This
% fnctn was used to import a SETP file exported from SolidWorks (Robin Schregle)
% and display it hierarchically. With the help of manual reading and
% interpretation of this structure, the fnctns "SG2STEP" /
% "STEPmanifoldSolidBrepofSG" were then written. (Status of: 2025-09-25)
%
% Introduced first in SolidGeometry 5.6
%
% See also: SG2STEP
%
% ftxt=SGreadSTEPstructure([fname])
% === INPUT PARAMETERS ===
% fname: full file name of a step file ceated by any CAD system
% === OUTPUT RESULTS ======
% ftxt: text of a step file
%
% EXAMPLE:
% clc; SGreadSTEPstructure('/Users/timlueth/Desktop/STEPcube_10x10x10mm_BODY_ONLY.step'); ttxt=ans
%
% See also: SG2STEP
%
%
% Copyright 2025 Tim C. Lueth

STEPmanifoldSolidBrepofSG(SG,alpha,mm)- returns the text lines for a ISO-10303-21 AP242 Manifold Geometry Boundary Representation

STEPmanifoldSolidBrepofSG(SG,alpha,mm)% STEPmanifoldSolidBrepofSG(SG,alpha,mm) - returns the text lines for a ISO-10303-21 AP242 Manifold Geometry Boundary Representation
% (by Tim Lueth, SG-Lib, 2025-SEP-23 as class: IMPORT/EXPORT)
%
% =======================================================================
% DEVELOPER PROCEDURE (2025-09-26) - NOT INTENDED TO BE RELEASED
% =======================================================================
%
% This fnctn (originally named SG2STEP) is the core of SGwriteSTEP
% It was tested in September 2025 using Solidworks (Status of: 2025-09-26)
%
% Introduced first in SolidGeometry 5.6
%
% See also: SGreadSTEPstructure, SG2STEP
%
% [ttorg,mm]=STEPmanifoldSolidBrepofSG(SG,[alpha,mm])
% === INPUT PARAMETERS ===
% SG: Solid Geoemtry to create a Manifold Geometry Bopundary representation
% alpha: Limit angle for separating feature surfaces; default is 0.01
% mm: number of used step lines already for other BREPS; default is 0
% === OUTPUT RESULTS ======
% ttorg: STEP text lines for the Manifold Geometry Bopundary representation
% mm: last number of created step line
%
% EXAMPLE:
% STEPmanifoldSolidBrepofSG(SGbar);
% STEPmanifoldSolidBrepofSG(SGsample(53));
% STEPmanifoldSolidBrepofSG(SGsample(54));
% STEPmanifoldSolidBrepofSG(SGsample(27));
%
% See also: SGreadSTEPstructure, SG2STEP
%
%
% Copyright 2025 Tim C. Lueth

SGcreateToolboxHTMLfilesfromhelptoc(tboxdir)- creates the SGLIB_HELP_Structures/html documentation from the existing helptoc file in SGLIB_HELP_Structures

SGcreateToolboxHTMLfilesfromhelptoc(tboxdir)% SGcreateToolboxHTMLfilesfromhelptoc(tboxdir) - creates the SGLIB_HELP_Structures/html documentation from the existing helptoc file in SGLIB_HELP_Structures
% (by Tim Lueth, SG-Lib, 2025-SEP-21 as class: CODING/DEVELOP)
%
% =======================================================================
% DEVELOPER PROCEDURE (2025-09-21) - NOT INTENDED TO BE RELEASED
% =======================================================================
%
% parses the "helptoc.xml" file in "SGLIB_HELP_Structures/html" and creates a
% list of required html file that have to be copied by using.
% Copies into pcodedirTL
% 1) "SGLIB_HELP_Structures/info.xml" ==> Pointer to doc html folder
% 2) "SGLIB_HELP_Structures/helptoc.xml" ==> html search fileand toc file
% 3) "SGLIB_HELP_Structures/index.html" ==> html start point
% 4) "SGLIB_HELP_Structures/html/SGLIBPICS " ==> Folder with all pics
% 5) creates all missing tutorial html files using "mfile2mlxfile4markup"
% 6) copies all html files listed by helptoc2htmllist
% (Status of: 2025-09-21)
%
% Introduced first in SolidGeometry 5.6
%
% See also: helptoc2htmllist, mfile2mlxfile4markup,
% SGcreateToolboxHtmlfilesfromToolbox_test
%
% SGcreateToolboxHTMLfilesfromhelptoc([tboxdir])
% === INPUT PARAMETERS ===
% tboxdir:
%
% See also: helptoc2htmllist, mfile2mlxfile4markup,
% SGcreateToolboxHtmlfilesfromToolbox_test
%
%
% Copyright 2025 Tim C. Lueth

helptoc2htmllist(helptocfile)- reads the helptoc.xml file and creates a list of required html files

helptoc2htmllist(helptocfile)% helptoc2htmllist(helptocfile) - reads the helptoc.xml file and creates a list of required html files
% (by Tim Lueth, SG-Lib, 2025-SEP-21 as class: CODING/DEVELOP)
%
% =======================================================================
% DEVELOPER PROCEDURE (2025-09-21) - NOT INTENDED TO BE RELEASED
% =======================================================================
%
% parses the "helptoc.xml" file in "SGLIB_HELP_Structures/html" and creates a
% list of required html file that have to be copied
% used in SGcreateToolboxHTMLfilesfromhelptoc (Status of: 2025-09-21)
%
% Introduced first in SolidGeometry 5.6
%
% See also: SGcreateToolboxHTMLfilesfromhelptoc
%
% llc=helptoc2htmllist([helptocfile])
% === INPUT PARAMETERS ===
% helptocfile:
% === OUTPUT RESULTS ======
% llc:
%
% EXAMPLE:
% helptoc2htmllist
%
% See also: SGcreateToolboxHTMLfilesfromhelptoc
%
%
% Copyright 2025 Tim C. Lueth

pcodedirTLtouch- touches all files (not folders) in "pcodedirTL" to avoid warning with p and m files during toolbox execution

pcodedirTLtouch% pcodedirTLtouch - touches all files (not folders) in "pcodedirTL" to avoid warning with p and m files during toolbox execution
% (by Tim Lueth, SG-Lib, 2025-SEP-21 as class: CODING/DEVELOP)
%
% =======================================================================
% DEVELOPER PROCEDURE (2025-09-21) - NOT INTENDED TO BE RELEASED
% =======================================================================
%
% Introduced first in SolidGeometry 5.6
%
% See also: ftouch, ftouchcreationdate
%
% ant=pcodedirTLtouch
% === OUTPUT RESULTS ======
% ant: answer of system command
%
% EXAMPLE:
% pcodedirTLtouch % touches the pcodedirTL folder
%
% See also: ftouch, ftouchcreationdate
%
%
% Copyright 2025 Tim C. Lueth

SGcreateToolboxHtmlfilesfromToolbox_test- Simply moves the results of VLFL_Toolbox_test to pcodedir

SGcreateToolboxHtmlfilesfromToolbox_test% SGcreateToolboxHtmlfilesfromToolbox_test - Simply moves the results of VLFL_Toolbox_test to pcodedir
% (by Tim Lueth, SG-Lib, 2025-SEP-20 as class: CODING/DEVELOP)
%
% =======================================================================
% DEVELOPER PROCEDURE (2025-09-21) - NOT INTENDED TO BE RELEASED
% =======================================================================
%
% During VLFL_Toolbox_test, the workdir is changed to separate the html files
% from the workdir's html files.
% The html folder that is filled by publishing all examples or demos of name
% "VLFL_EXP00" is located at
% [desktopdir 'Toolbox_test' pcodedirTL html]. Those files have to be copied into
% pcodedirTL / html so that they are later found as examples after packing the
% Toolbox
%
% 1) VLFL_Toolbox_make
% 2) Create html files in folder "SGLIB_HELP_Structures" using FM Database
% 3)
% repair json file - copy json file (part of VLFL_Toolbox_make)
% SGcreateToolboxMfilesfromPfiles(pcodedirTL); (part of VLFL_Toolbox_make)
%
%
%
%
% VLFL_Toolbox_test(1:80,'noinp')
% VLFL_Toolbox_test(1:80,'isinp')
%
% (Status of: 2025-09-21)
%
% Introduced first in SolidGeometry 5.6
%
% See also: SGcreateToolboxfromFolder, SGcreateToolboxHTMLfilesfromhelptoc
%
% SGcreateToolboxHtmlfilesfromToolbox_test
%
% See also: SGcreateToolboxfromFolder, SGcreateToolboxHTMLfilesfromhelptoc
%
%
% Copyright 2025 Tim C. Lueth

SGcreateToolboxMfilesfromPfiles(tboxdir)- searches the pcodeTLdir for p-file and adds the help text as m-file, if no m-file exist

SGcreateToolboxMfilesfromPfiles(tboxdir)% SGcreateToolboxMfilesfromPfiles(tboxdir) - searches the pcodeTLdir for p-file and adds the help text as m-file, if no m-file exist
% (by Tim Lueth, SG-Lib, 2025-SEP-19 as class: CODING/DEVELOP)
%
% =======================================================================
% DEVELOPER PROCEDURE (2025-09-21) - NOT INTENDED TO BE RELEASED
% =======================================================================
%
% it uses pcodeTLaddmfilehelp
% and removes anyway 'VLFLlicense.m*', 'VLFLlicenseTL.*', 'VLFL_Toolbox_make.*'])
% for some reason in pcode and pcodeTL some m files are missing. (Status of:
% 2025-09-20)
%
% Introduced first in SolidGeometry 5.6
%
% See also: pcodeTLaddmfilehelp
%
% SGcreateToolboxMfilesfromPfiles([tboxdir])
% === INPUT PARAMETERS ===
% tboxdir: default is pcodedirTL
%
% See also: pcodeTLaddmfilehelp
%
%
% Copyright 2025 Tim C. Lueth

pcodeTLaddmfilehelp (fname)- creates a short m-file just with the help text from the original m-file if a p-file exist

pcodeTLaddmfilehelp (fname)% pcodeTLaddmfilehelp (fname) - creates a short m-file just with the help text from the original m-file if a p-file exist
% (by Tim Lueth, SG-Lib, 2025-SEP-19 as class: CODING/DEVELOP)
%
% =======================================================================
% DEVELOPER PROCEDURE (2025-09-20) - NOT INTENDED TO BE RELEASED
% =======================================================================
%
% For some reasons, some p-files in the pcodeTL folder do not have a
% corresponding m-file with the help text. This fnctn does the job for ONE SINGLE
% fnctn name. It is used by fnctn "SGcreateToolboxMfilesfromPfiles" and is part
% of "SGcreateToolboxfunctdependenciesfromFolder" (Status of: 2025-09-20)
%
% Introduced first in SolidGeometry 5.6
%
% See also: pcodeTL, SGcreateToolboxfunctdependenciesfromFolder,
% SGcreateToolboxfromFolder
%
% pcodeTLaddmfilehelp(fname)
% === INPUT PARAMETERS ===
% fname: str with SGlib command
%
% See also: pcodeTL, SGcreateToolboxfunctdependenciesfromFolder,
% SGcreateToolboxfromFolder
%
%
% Copyright 2025 Tim C. Lueth

SGcreateToolboxfunctdependenciesfromFolder(tboxdir)- Creates a dependecy analysis of a later toolbox folder and writes a text of missing files in current pcodedirTL

SGcreateToolboxfunctdependenciesfromFolder(tboxdir)% SGcreateToolboxfunctdependenciesfromFolder(tboxdir) - Creates a dependecy analysis of a later toolbox folder and writes a text of missing files in current pcodedirTL
% (by Tim Lueth, SG-Lib, 2025-SEP-19 as class: CODING/DEVELOP)
%
% =======================================================================
% DEVELOPER PROCEDURE (2025-09-21) - NOT INTENDED TO BE RELEASED
% =======================================================================
%
% Takes about 3h on M3 Pro. for 2000 fnctns (Status of: 2025-09-19)
%
% Introduced first in SolidGeometry 5.6
%
% See also: SGcreateToolboxfromFolder
%
% SGcreateToolboxfunctdependenciesfromFolder([tboxdir])
% === INPUT PARAMETERS ===
% tboxdir:
%
% EXAMPLE:
% SGcreateToolboxfunctdependenciesfromFolder(desktopdir('2025-09-17_TL_PCODE'))
%
% See also: SGcreateToolboxfromFolder
%
%
% Copyright 2025 Tim C. Lueth

SGcreateToolboxfromFolder(tboxdir)- packs a SG-Lib toolbox after VLFL_Toolbox_Make has been used

SGcreateToolboxfromFolder(tboxdir)% SGcreateToolboxfromFolder(tboxdir) - packs a SG-Lib toolbox after VLFL_Toolbox_Make has been used
% (by Tim Lueth, SG-Lib, 2025-SEP-19 as class: CODING/DEVELOP)
%
% =======================================================================
% DEVELOPER PROCEDURE (2025-09-19) - NOT INTENDED TO BE RELEASED
% =======================================================================
%
% Since packaging of a Toolbox gets more an more difficult and extremely slow by
% the Mathworks Interface, the following fnctn ist use:
%
% Step 09: The toolbox options are created using
% "matlab.addons.toolbox.ToolboxOptions"
% Step 10: The toolbox is packed by using "matlab.addons.toolbox.packageToolbox"
% (Status of: 2025-09-19)
%
% Introduced first in SolidGeometry 5.6
%
% See also: SGcreateToolboxMfilesfromPfiles
%
% SGcreateToolboxfromFolder([tboxdir])
% === INPUT PARAMETERS ===
% tboxdir: default is pcodedirTL
%
% EXAMPLE:
% SGcreateToolboxfromFolder(desktopdir('2025-09-17_TL_PCODE')))
% SGcreateToolboxfromFolder(pcodedirTL)
%
% See also: SGcreateToolboxMfilesfromPfiles
%
%
% Copyright 2025 Tim C. Lueth

cellstradjustlen(OCC)- adjust in each col of acell array or table the length of char string

cellstradjustlen(OCC)% cellstradjustlen(OCC) - adjust in each col of acell array or table the length of char string
% (by Tim Lueth, SG-Lib, 2025-SEP-16 as class: CODING/DEVELOP)
%
% USE CAREFULLY: cellstradjustlen was not being tested extensively
%
% works with cell cols und tabel cols
% required for cell2mat, since some positive matlab concepts have changed over
% time. (Status of: 2025-09-18)
%
% Introduced first in SolidGeometry 5.6
%
% See also: cell2mat, uniquecell
%
% CC=cellstradjustlen(OCC)
% === INPUT PARAMETERS ===
% OCC: Original cell array or table
% === OUTPUT RESULTS ======
% CC: cell array or table in which all strings of a column have the same length
%
% EXAMPLE:
% cell2mat({'A';'A B'; 'A B C'; 'A D'}) % fails adjust strlen in column
% cellstradjustlen({'A';'A B'; 'A B C'; 'A D'}) % adjust strlen in column
% cell2mat(cellstradjustlen({'A';'A B'; 'A B C'; 'A D'})) % does work now
%
% See also: cell2mat, uniquecell
%
%
% Copyright 2025 Tim C. Lueth

CPLremovecollinearpoints(CPL)- removes 2D/3D collinear point with different results for opened and closed CPL/CVL

CPLremovecollinearpoints(CPL)% CPLremovecollinearpoints(CPL) - removes 2D/3D collinear point with different results for opened and closed CPL/CVL
% (by Tim Lueth, SG-Lib, 2025-SEP-14 as class: CPL/CLOSED POLYGON LISTS)
%
% USE CAREFULLY: CPLremovecollinearpoints was not being tested extensively
%
% For closed and opend CPL/CVL in 2D/3D. Start and end points can be removed for
% closed CPL/CVL if there is no kink when it is a closed contour.If it is an open
% contour, be aware that start an endpoint will remain, even they are collinear
% points (Status of: 2025-09-14)
%
% Introduced first in SolidGeometry 5.6
%
% See also: CPLinsertcollinearpoints, CVLremstraightAmin, CVLaddauxpoints
%
% CPLremovecollinearpoints(CPL)
% === INPUT PARAMETERS ===
% CPL: 2D/3D open or closed CPL; Behavior differers
%
% EXAMPLE:
% CPLremovecollinearpoints(circshift(CPLaddauxpoints(PLsquare(10),1), 0)) % open CPL remain Start/End
% CPLremovecollinearpoints(circshift(CPLaddauxpoints(PLsquare(10),1),-1)) % open CPL remain Start/End
% CPLremovecollinearpoints(circshift(CPLaddauxpoints(PLsquare(10),1),+1)) % open CPL remain Start/End
%
% CPLremovecollinearpoints(closedCPL((circshift(CPLaddauxpoints(PLsquare(10),1), 0)))) % closed CPL
% CPLremovecollinearpoints(closedCPL((circshift(CPLaddauxpoints(PLsquare(10),1), 0)))) % closed CPL
% CPLremovecollinearpoints(closedCPL((circshift(CPLaddauxpoints(PLsquare(10),1), 0)))) % closed CPL
%
%
% See also: CPLinsertcollinearpoints, CVLremstraightAmin, CVLaddauxpoints
%
%
% Copyright 2025 Tim C. Lueth

PLELofCPLunchng(CPL)- creates a 2D/3D PLEL exactly as give in the CPL/CVL - THIS CREATES PROBLEMS WITH CLOSED CPLS

PLELofCPLunchng(CPL)% PLELofCPLunchng(CPL) - creates a 2D/3D PLEL exactly as give in the CPL/CVL - THIS CREATES PROBLEMS WITH CLOSED CPLS
% (by Tim Lueth, SG-Lib, 2025-SEP-14 as class: PLEL/POINT LIST/EDGE LIST)
%
% =======================================================================
% DEVELOPER PROCEDURE (2025-09-14) - NOT INTENDED TO BE RELEASED
% =======================================================================
%
% ONLY FOR TESTING - CREATES PROBLEMS WITH DOUBLED PLOINTS AND EDGES OF LENGTH 0
% FOR CLOSED CPLS
% speed optimized fnctn
% more or less for testing: Better use "PLELofCPLplain(CPL,'open')" or
% "PLELofCPLplain(CPL,'closed')"
% While PLELofCPLplain returns always opened or closed CPLs, this fnctn is mainly
% for testing mathworks products (DELAUNAYTRI, DELAUNAY, triangulation, polybool,
% polyshape, delaunaytriangulation etc.)
% but als ELreconnect and ELofELmesh (Status of: 2025-09-14)
%
% Introduced first in SolidGeometry 5.6
%
% See also: PLELofCPLplain
%
% [NPL,NEL]=PLELofCPLunchng(CPL)
% === INPUT PARAMETERS ===
% CPL: nan separated contours in 2D or 3D
% === OUTPUT RESULTS ======
% NPL: Complete point list as it was given as CPL (including all doubles etc.)
% NEL: Complete edge list as it was given as CPL open if open, closed if closed
%
% EXAMPLE:
% PLELofCPLunchng([PLcircle(1);nan nan;closedCPL(PLcircle(1)+[5 0])]) % 2D
% PLELofCPLunchng(VLaddz([PLcircle(1);nan nan;closedCPL(PLcircle(1)+[5 0])])); % 3D
%
% See also: PLELofCPLplain
%
%
% Copyright 2025 Tim C. Lueth

openedCVL(CVL,lim)- closes all contours in CPL(2D) and CVL(3D) after removal of all consecutive identical points.

openedCVL(CVL,lim)% openedCVL(CVL,lim) - closes all contours in CPL(2D) and CVL(3D) after removal of all consecutive identical points.
% (by Tim Lueth, SG-Lib, 2025-SEP-14 as class: CPL/CLOSED POLYGON LISTS)
%
% USE CAREFULLY: openedCVL was not being tested extensively
%
% just calls "openedCPL" which ist the same fnctnlity.
% new speed optimized fnctn of 2025 to replace PLofCPL in future
% It removes all consecutive identical points.
% concept same as VLremsuccident
% ii=vecnormr(CPLi-circshift(CPLi,-1))>lim; OCPLi=CPLi(ii,:);
% (Status of: 2025-09-14)
%
% Introduced first in SolidGeometry 5.6
%
% See also: PLofCPL, CPLofPL, openedCPL, closedCPL, closedCVL
%
% NCVL=openedCVL(CVL,[lim])
% === INPUT PARAMETERS ===
% CVL: Contour 2D or 3D with NaN embedded contours
% lim: default is 1e-12 for removal of succeding points
% === OUTPUT RESULTS ======
% NCVL: New contours 2D/3D with all open contours without any consecutive
% identical point
%
% EXAMPLE:
% openedCVL(CPLsample(47)) % 2D case
% openedCVL(VLaddz(CPLsample(47))) % 3D case
% openedCVL(VLaddz(closedCVL(CPLsample(47)))) % 3D case with all closed before
%
%
% See also: PLofCPL, CPLofPL, openedCPL, closedCPL, closedCVL
%
%
% Copyright 2025 Tim C. Lueth

closedCVL(CVL,lim)- closes all contours in CPL(2D) and CVL(3D) after removal of all consecutive identical point before

closedCVL(CVL,lim)% closedCVL(CVL,lim) - closes all contours in CPL(2D) and CVL(3D) after removal of all consecutive identical point before
% (by Tim Lueth, SG-Lib, 2025-SEP-14 as class: CPL/CLOSED POLYGON LISTS)
%
% USE CAREFULLY: closedCVL was not being tested extensively
%
% just calls "closedCPL" which ist the same fnctnlity.
% new speed optimized fnctn of 2025 to replace CPLofPL in future
% It removes all consecutive identical points and adds the first as last again
% concept same as VLremsuccident
% ii=vecnormr(CPLi-circshift(CPLi,-1))>lim; OCPLi=CPLi(ii,:);
% (Status of: 2025-09-14)
%
% Introduced first in SolidGeometry 5.6
%
% See also: PLofCPL, CPLofPL, openedCPL, closedCPL, openedCVL
%
% NCVL=closedCVL(CVL,[lim])
% === INPUT PARAMETERS ===
% CVL: Contour 2D or 3D with NaN embedded contours
% lim: default is 1e-12 for removal of succeding points
% === OUTPUT RESULTS ======
% NCVL: New contours 2D/3D with all closed contours openedCPL, closedCPL, without
% any consecutive identical point
%
% EXAMPLE:
% closedCVL(openedCVL(CPLsample(47))) % 2D case
% closedCVL(VLaddz(CPLsample(47))) % 3D case
% closedCVL(VLaddz(openedCVL(CPLsample(47)))) % 3D case with opening before
%
%
% See also: PLofCPL, CPLofPL, openedCPL, closedCPL, openedCVL
%
%
% Copyright 2025 Tim C. Lueth

closedCPL(CPL,lim)- closes all contours in CPL(2D) and CVL(3D) without any other change beside removal of all consecutive identical point before

closedCPL(CPL,lim)% closedCPL(CPL,lim) - closes all contours in CPL(2D) and CVL(3D) without any other change beside removal of all consecutive identical point before
% (by Tim Lueth, SG-Lib, 2025-SEP-14 as class: CPL/CLOSED POLYGON LISTS)
%
% USE CAREFULLY: closedCPL was not being tested extensively
%
% new speed optimized fnctn of 2025 to replace CPLofPL in future
% It removes all consecutive identical points and adds the first as last again
% concept same as VLremsuccident
% ii=vecnormr(CPLi-circshift(CPLi,-1))>lim; OCPLi=CPLi(ii,:);
% (Status of: 2025-09-14)
%
% Introduced first in SolidGeometry 5.6
%
% See also: PLofCPL, CPLofPL, openedCPL, openedCVL, closedCVL
%
% NCPL=closedCPL(CPL,[lim])
% === INPUT PARAMETERS ===
% CPL: Contour 2D or 3D with NaN embedded contours
% lim: default is 1e-12 for removal of succeding points
% === OUTPUT RESULTS ======
% NCPL: New contours 2D/3D with all closed contours without any consecutive
% identical point
%
% EXAMPLE:
% closedCPL(PLofCPL(CPLsample(47))) % 2D case
% closedCPL(VLaddz(CPLsample(47))) % 3D case
% closedCPL(VLaddz(openedCPL(CPLsample(47)))) % 3D case with opening before
%
%
% See also: PLofCPL, CPLofPL, openedCPL, openedCVL, closedCVL
%
%
% Copyright 2025 Tim C. Lueth

openedCPL(CPL,lim)- opens all contours in CPL(2D) and CVL(3D) without any other change beside removal of all consecutive identical points.

openedCPL(CPL,lim)% openedCPL(CPL,lim) - opens all contours in CPL(2D) and CVL(3D) without any other change beside removal of all consecutive identical points.
% (by Tim Lueth, SG-Lib, 2025-SEP-14 as class: CPL/CLOSED POLYGON LISTS)
%
% USE CAREFULLY: openedCPL was not being tested extensively
%
% new speed optimized fnctn of 2025 to replace PLofCPL in future
% It removes all consecutive identical points.
% concept same as VLremsuccident
% ii=vecnormr(CPLi-circshift(CPLi,-1))>lim; OCPLi=CPLi(ii,:);
% (Status of: 2025-09-14)
%
% Introduced first in SolidGeometry 5.6
%
% See also: PLofCPL, CPLofPL, closedCPL, openedCVL, closedCVL
%
% NCPL=openedCPL(CPL,[lim])
% === INPUT PARAMETERS ===
% CPL: Contour 2D or 3D with NaN embedded contours
% lim: default is 1e-12 for removal of succeding points
% === OUTPUT RESULTS ======
% NCPL: New contours 2D/3D with all open contours without any consecutive
% identical point
%
% EXAMPLE:
% openedCPL(CPLsample(47)) % 2D case
% openedCPL(VLaddz(CPLsample(47))) % 3D case
% openedCPL(VLaddz(CPLofPL(CPLsample(47)))) % 3D case with all closed before
%
%
% See also: PLofCPL, CPLofPL, closedCPL, openedCVL, closedCVL
%
%
% Copyright 2025 Tim C. Lueth

CPLplotasPSplain(CPL)- Plots each individual embedded CPL as a separate contour.

CPLplotasPSplain(CPL)% CPLplotasPSplain(CPL) - Plots each individual embedded CPL as a separate contour.
% (by Tim Lueth, SG-Lib, 2025-SEP-13 as class: VISUALIZATION)
%
% USE CAREFULLY: CPLplotasPSplain was not being tested extensively
%
% Due to the constant expansion of polyshape, it is necessary to have fnctns that
% can still clearly represent the underlying CPL before a simplify (split point
% separation), orientation change, or removal of collinear points occurs by
% default. (Status of: 2025-09-13)
%
% Introduced first in SolidGeometry 5.6
%
% See also: CPLplotasPS, CPSplot, CPLplothatched
%
% h=CPLplotasPSplain(CPL)
% === INPUT PARAMETERS ===
% CPL: CPL with nan separated CPLi
% === OUTPUT RESULTS ======
% h: handle
%
% EXAMPLE:
% CPL=[PLcircle(10);nan nan;PLcircle(10)+4];
% SGfigure; CPLplotasPSplain(CPL);
% SGfigure; CPLplotasPSplain(CPLsample(47));
%
% See also: CPLplotasPS, CPSplot, CPLplothatched
%
%
% Copyright 2025 Tim C. Lueth

PLELofCPLplain(CPL,"open","closed")- returns a PL and EL and a modified CPL based on the explicit qish of "open" or "closed"

PLELofCPLplain(CPL,% PLELofCPLplain(CPL,"open","closed") - returns a PL and EL and a modified CPL based on the explicit qish of "open" or "closed"
% (by Tim Lueth, SG-Lib, 2025-SEP-13 as class: PLEL/POINT LIST/EDGE LIST)
%
% USE CAREFULLY: PLELofCPLplain was not being tested extensively
%
% Works with 2D and 3D contours. "plain" means here that there is no splitpoint
% separation or descomposition done!
% This fnctn of 2025 is required, since the original fnctn of 2014 was modified
% 2018 using the polyshape concept, which was modified by mathwork, so that since
% 2024, the original concept had to be used again. Since there is in general a
% problem how to handle closed and open contours, which sometimes is used
% explicitly and sometimes implicitly, this fnctn returns on default closed
% contours
% Remember, if you use CPLrepair in 2D, this can change the orientation of the
% CPLs. (Status of: 2025-09-13)
%
% Introduced first in SolidGeometry 5.6
%
% See also: PLELofCPL, PLELofCPLsplitpoints
%
% [NPL,NEL,NCPL]=PLELofCPLplain([CPL,"open","closed"])
% === INPUT PARAMETERS ===
% CPL: Closed Polygon list including nan separated contours
% "open": if used, the results describe an open contour
% "closed": if use, the results describe an closed contour
% === OUTPUT RESULTS ======
% NPL: New Point List
% NEL: New Edge List
% NCPL: New CPL, open or closed as required;
%
% EXAMPLE:
% PLELofCPLplain(CVLsample(18));
% PLELofCPLplain(CVLsample(18),'open');
% PLELofCPLplain(CPLsample(47));
% PLELofCPLplain(CPLrepair(CPLsample(47))); % separate contours first in 2D
%
% See also: PLELofCPL, PLELofCPLsplitpoints
%
%
% Copyright 2025 Tim C. Lueth

PLELradialEdgesofCPL(CPL,R,"open","closed")- Creates 2D/3D radial edges in closed contours and open paths

PLELradialEdgesofCPL(CPL,R,% PLELradialEdgesofCPL(CPL,R,"open","closed") - Creates 2D/3D radial edges in closed contours and open paths
% (by Tim Lueth, SG-Lib, 2025-SEP-13 as class: PLEL/POINT LIST/EDGE LIST)
%
% USE CAREFULLY: PLELradialEdgesofCPL was not being tested extensively
%
% This fnctn from 2025 always interprets the input parameter as a closed path.
% There is no check for path overlaps in 2D or 3D. This fnctn also works with VL
% (3D); this fnctn does not remove collinear points. This fnctn does not correct
% overlaps and intersections of contours. It does not change the orientation. The
% starting point will possibly moved in case of closed contours, if there is a
% kink at the start point.
% For paths instead of contours, "open" must be used explicitly.
%
% Some other effects of matlab made it necessary to reimplement the fnctn in 2025
% PLELofCPL (2014) was reimplemented by Tim Lueth (2018) using the polyshape
% class, but matlab changed the behavior of polyshape several times (collinear
% points, etc.), which made it impossible to track the influences of the changes.
% Even empty CPLs became a problem in 2024.
% This fnctn is NOT using PLELofCPL anymore.
% This fnctn uses ELofn to create the edge lists
% This fnctn uses "VLremsuccident" to open CPLs
% This fnctn uses VLtangentcirc to create the arcs.
% It uses selectNaN to separate nan separated contours.
% The concept of "open" will be used in future (Status of: 2025-09-13)
%
% Introduced first in SolidGeometry 5.6
%
% See also: VLremsuccident, VLtangentcirc
%
% [NPL,NEL,NCPL]=PLELradialEdgesofCPL(CPL,[R,"open","closed"])
% === INPUT PARAMETERS ===
% CPL: open or closed point list in 2D or 3D
% R: maximum radius >0 ; default is 1
% "open": if used, the result will be an open path not a contour
% "closed": if used, the result will a closed contour; this is default.
% === OUTPUT RESULTS ======
% NPL: New Point list; with modified start point
% NEL: New edge list;
% NCPL: NEW CPL list; open or closed as defined
%
% EXAMPLE:
% PLELradialEdgesofCPL(VLaddz(CPLofPL(PLsquare)))
% PLELradialEdgesofCPL(VLaddz(CPLofPL(PLsquare)),'open')
% [a,b,c]=PLELradialEdgesofCPL(VLaddz(CPLsample(3))); SGfigure; VLplot(c,'b*-'); c
% [a,b,c]=PLELradialEdgesofCPL(VLaddz(CPLsample(3)),'open'); SGfigure; VLplot(c,'b*-'); c
%
% See also: VLremsuccident, VLtangentcirc
%
%
% Copyright 2025 Tim C. Lueth

CVLinsertcollinearpoints(CVL,d)- inserts collinear auxiliary points that a minimum point distance is guaranteed

CVLinsertcollinearpoints(CVL,d)% CVLinsertcollinearpoints(CVL,d) - inserts collinear auxiliary points that a minimum point distance is guaranteed
% (by Tim Lueth, SG-Lib, 2025-SEP-12 as class: PL/POINT LISTS)
%
% USE CAREFULLY: CVLinsertcollinearpoints was not being tested extensively
%
% slightly different to RLaddauxpoints and CPLaddauxpoints
% does not create collinear auxiliary points if an edge is missing!
% Only if start and end point are the same, the last edge is also processed.
% Same as:
% PLinsertcollinearpoints == CPLinsertcollinearpoints ==
% CVLinsertcollinearpoints (Status of: 2025-09-12)
%
% Introduced first in SolidGeometry 5.6
%
% See also: RLaddauxpoints, CPLaddauxpoints, VLremsuccident,
% PLinsertcollinearpoints, CPLinsertcollinearpoints
%
% CVLN=CVLinsertcollinearpoints(CVL,[d])
% === INPUT PARAMETERS ===
% CVL: Point list without nan, open or closed
% d: maximum point distance to guarantee
% === OUTPUT RESULTS ======
% CVLN: Point list with collinear auxiliary points, open or closed as PL
%
% EXAMPLE:
% CVLinsertcollinearpoints(CVLsample(3),1) % open edge, identical point removed
% CVLinsertcollinearpoints(CVLsample(8),1) % closed contour, identical point removed
% CVLinsertcollinearpoints(CVLsample(16),1) % Does work also in 3D
% CVLinsertcollinearpoints(CVLsample(18),1) % Does work also with nan separated contours
%
% See also: RLaddauxpoints, CPLaddauxpoints, VLremsuccident,
% PLinsertcollinearpoints, CPLinsertcollinearpoints
%
%
% Copyright 2025 Tim C. Lueth

CPLinsertcollinearpoints(CPL,d)- inserts collinear auxiliary points that a minimum point distance is guaranteed

CPLinsertcollinearpoints(CPL,d)% CPLinsertcollinearpoints(CPL,d) - inserts collinear auxiliary points that a minimum point distance is guaranteed
% (by Tim Lueth, SG-Lib, 2025-SEP-12 as class: PL/POINT LISTS)
%
% USE CAREFULLY: CPLinsertcollinearpoints was not being tested extensively
%
% slightly different to RLaddauxpoints and CPLaddauxpoints
% does not create collinear auxiliary points if an edge is missing!
% Only if start and end point are the same, the last edge is also processed.
% Same as:
% PLinsertcollinearpoints == CPLinsertcollinearpoints ==
% CVLinsertcollinearpoints (Status of: 2025-09-12)
%
% Introduced first in SolidGeometry 5.6
%
% See also: RLaddauxpoints, CPLaddauxpoints, VLremsuccident,
% PLinsertcollinearpoints, CVLinsertcollinearpoints
%
% CPLN=CPLinsertcollinearpoints(CPL,[d])
% === INPUT PARAMETERS ===
% CPL: Point list without nan, open or closed
% d: maximum point distance to guarantee
% === OUTPUT RESULTS ======
% CPLN: Point list with collinear auxiliary points, open or closed as PL
%
% EXAMPLE:
% CPLinsertcollinearpoints(PLsample(3),1) % open edge, identical point removed
% CPLinsertcollinearpoints(PLsample(8),1) % closed contour, identical point removed
% CPLinsertcollinearpoints(VLsample(16),1) % Does work also in 3D
% CPLinsertcollinearpoints(VLsample(18),1) % Does work also with nan separated contours
%
% See also: RLaddauxpoints, CPLaddauxpoints, VLremsuccident,
% PLinsertcollinearpoints, CVLinsertcollinearpoints
%
%
% Copyright 2025 Tim C. Lueth

PLinsertcollinearpoints(PL,d)- inserts collinear auxiliary points that a minimum point distance is guaranteed

PLinsertcollinearpoints(PL,d)% PLinsertcollinearpoints(PL,d) - inserts collinear auxiliary points that a minimum point distance is guaranteed
% (by Tim Lueth, SG-Lib, 2025-SEP-12 as class: PL/POINT LISTS)
%
% USE CAREFULLY: PLinsertcollinearpoints was not being tested extensively
%
% slightly different to RLaddauxpoints and CPLaddauxpoints
% does not create collinear auxiliary points if an edge is missing!
% Only if start and end point are the same, the last edge is also processed.
% Same as:
% PLinsertcollinearpoints == CPLinsertcollinearpoints ==
% CVLinsertcollinearpoints (Status of: 2025-09-12)
%
% Introduced first in SolidGeometry 5.6
%
% See also: RLaddauxpoints, CPLaddauxpoints, VLremsuccident,
% CPLinsertcollinearpoints, CVLinsertcollinearpoints
%
% PLN=PLinsertcollinearpoints(PL,[d])
% === INPUT PARAMETERS ===
% PL: Point list without nan, open or closed
% d: maximum point distance to guarantee
% === OUTPUT RESULTS ======
% PLN: Point list with collinear auxiliary points, open or closed as PL
%
% EXAMPLE:
% PLinsertcollinearpoints(PLsample(3),1) % open edge, identical point removed
% PLinsertcollinearpoints(PLsample(8),1) % closed contour, identical point removed
% PLinsertcollinearpoints(VLsample(16),1) % Does work also in 3D
% PLinsertcollinearpoints(VLsample(18),1) % Does work also with nan separated contours
%
% See also: RLaddauxpoints, CPLaddauxpoints, VLremsuccident,
% CPLinsertcollinearpoints, CVLinsertcollinearpoints
%
%
% Copyright 2025 Tim C. Lueth

SGconverthtmldoc2UTF8- converts all files of an html file into UTF-8

SGconverthtmldoc2UTF8% SGconverthtmldoc2UTF8 - converts all files of an html file into UTF-8
% (by Tim Lueth, SG-Lib, 2025-SEP-12 as class: FILE HANDLING)
%
% =======================================================================
% DEVELOPER PROCEDURE (2025-09-12) - NOT INTENDED TO BE RELEASED
% =======================================================================
%
% Some browser such as Microsoft edge are unable to process UTF-16 html files, ot
% at least not a mix of, or at least in combination on windows. Therefor this
% fnctn converts als html files of "SGLIB_HELP_Structures/html" to UTF-8 (Status
% of: 2025-09-12)
%
% Introduced first in SolidGeometry 5.6
%
% See also: isUTF16file
%
% SGconverthtmldoc2UTF8
%
% See also: isUTF16file
%
%
% Copyright 2025 Tim C. Lueth

isUTF16file(fname,"UTF")- detects UTF16 files and converts them into UTF-8

isUTF16file(fname,% isUTF16file(fname,"UTF") - detects UTF16 files and converts them into UTF-8
% (by TIm Lueth & Robin Schregle, SG-Lib, 2025-SEP-12 as class: FILE HANDLING)
%
% =======================================================================
% DEVELOPER PROCEDURE (2025-09-12) - NOT INTENDED TO BE RELEASED
% =======================================================================
%
% When matlab reads UTF-16 files as 'uint8', all characters are actually read,
% and it can be recognized manually that when BOM (FFFE) is at the start, the
% character string at the beginning [255 254] refers to UTF-16. Then the ASCII
% characters can be determined with xx=xx(3:2:end). However, if the type 'char'
% is used during reading, then with UTF-16 files only every second character is
% read "automatically," but the first character is a 255, which is meaningless
% because it is part of the BOM code. For this reason, readtextfile and
% writetextfile use the ASCII type unsigned byte or uint8. (Status of: 2025-09-12)
%
% Introduced first in SolidGeometry 5.6
%
% See also: readtextfile, writetextfile
%
% is16=isUTF16file([fname,"UTF"])
% === INPUT PARAMETERS ===
% fname: full file name
% "UTF": if used, the wile will be written as UTF-8
% === OUTPUT RESULTS ======
% is16: true if utb-16 otherwise false
%
% See also: readtextfile, writetextfile
%
%
% Copyright 2025 Tim C. Lueth

Tflipz(T)- rotates / flips the ez axis of a HT matrix around by by 90 degree

Tflipz(T)% Tflipz(T) - rotates / flips the ez axis of a HT matrix around by by 90 degree
% (by Tim Lueth, SG-Lib, 2025-SEP-11 as class: KINEMATICS AND FRAMES)
%
% in contrast to TflipR, which changes into left hand system, this fnctn rotate
% around the y axis to flip the z vector, same as Trotate(eye(4),'y',pi),
% Tflipz(eye(4)) but more accurate (Status of: 2025-09-11)
%
% Introduced first in SolidGeometry 5.6
%
% See also: Tflipz, TflipR
%
% TN=Tflipz(T)
% === INPUT PARAMETERS ===
% T: Standard HT matrix
% === OUTPUT RESULTS ======
% TN: rotate around y by 180 deg
%
% EXAMPLE:
% Trotate(eye(4),'y',pi), Tflipz(eye(4))
%
% See also: Tflipz, TflipR
%
%
% Copyright 2025 Tim C. Lueth

SGofgcfsubplots(ind)- takes the current gcf, collects all patches in the subplots and creates a cell list of solids/patches

SGofgcfsubplots(ind)% SGofgcfsubplots(ind) - takes the current gcf, collects all patches in the subplots and creates a cell list of solids/patches
% (by Tim Lueth, SG-Lib, 2025-SEP-08 as class: VISUALIZATION)
%
% USE CAREFULLY: SGofgcfsubplots was not being tested extensively
%
% if nargout==0; the solids are plotted using SGplotcell (Status of: 2025-09-08)
%
% Introduced first in SolidGeometry 5.6
%
% See also: SGofgca, VLFLofgca, VLofgca, PSofgca, SGplotmultiple, SGofgca2subplots
%
% SG=SGofgcfsubplots([ind])
% === INPUT PARAMETERS ===
% ind: indices of the axis that should be considered
% === OUTPUT RESULTS ======
% SG: cell array of solids in all subplots
%
% EXAMPLE:
% loadweb JACO_robot.mat; SGsurfaces(JC1);
% SGofgca2subplots
% SGofgcfsubplots
%
%
% See also: SGofgca, VLFLofgca, VLofgca, PSofgca, SGplotmultiple, SGofgca2subplots
%
%
% Copyright 2025 Tim C. Lueth

SGlaundryrackholder- Special design for attaching a canvas picture to a wall-mounted folding clothes horse

SGlaundryrackholder% SGlaundryrackholder - Special design for attaching a canvas picture to a wall-mounted folding clothes horse
% (by Tim Lueth, SG-Lib, 2025-SEP-03 as class: COMPLETED CAD DESIGNS)
%
% =======================================================================
% DEVELOPER PROCEDURE (2025-09-08) - NOT INTENDED TO BE RELEASED
% =======================================================================
%
% Designed for Tiny Tusculum. The picture of Iseltwald Castle hangs in
% TinyTusculum so that it completely covers the wall-mounted foldable clothes
% horse. The picture has been specially framed to size, but must be attached to
% the wall using a clamp construction, and this attachment must support the
% center bar of the framed picture. The clamp must be movable on the wall bracket
% in order to align and tilt the picture. (Status of: 2025-09-03)
%
% Introduced first in SolidGeometry 5.6
%
% See also: SGBAUHAUSbox
%
% SGlaundryrackholder
%
% EXAMPLE:
% SGlaundryrackholder
%
% See also: SGBAUHAUSbox
%
%
% Copyright 2025 Tim C. Lueth
Most recent SG-Lib (5.5.5 - 2025)

Last Change Oct 6th 2025 for SG-Lib 5.5.5 (2025) 236 MB