by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - PL/Point Lists
Introduced first in SolidGeometry 5.1, Creation date: 2022-01-26, Last change: 2025-09-15
[PLB,PL,k,shr]=PLshortestpathinCPLcost(CPL,A,B,[shr,n,smo,CPLG])
CPL: | Outer contour with holes as forbidden areas | |
A: | Starting Point A inside the CPL | |
B: | End Point B inside the CPL | |
shr: | shrinkage value; default is sofBB/n | |
n: | number of grid points; default is 100 | |
smo: | 'A*', 'Bezier', 'fft' for smoothening | |
CPLG: | With this function preferred paths can be defined |
PLB: | Bezier smoothed path | |
PL: | Grid bases path | |
k: | grid numbers | |
shr: | dynamic shrinkage value |
CPLunion(PLsquare(10,70)+[-30 0],PLsquare(70,10)+[0 -40]);CPLG=ans;
PLshortestpathinCPLcost(PLcircle([50 20]),[-30,-30],[30,-30],1,50,'A*',CPLG);
PLshortestpathinCPLcost(PLcircle([50 20]),[-30,-30],[30,+30],1,50,'A*',CPLG);
PLshortestpathinCPLcost(PLcircle([50 20]),[-20,-30],[30,-30],1,50,'A*',CPLG);
PLshortestpathinCPLcost(PLcircle([50 20]),[-20,+30],[30,-30],1,50,'a*',CPLG); % obstacle and pathway
PLshortestpathinCPLcost(PLcircle([50 20]),[-20,+30],[30,-30],1,50,'a*'); % without pathway