PLshortestpathinCPLcost

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

returns a path inside of a CPL using A* Zelinzky, Lozano-Perez, Dikstra

Description

EXTENDE VERSION OF PLshortestpathinCPL will be renamed
This function is helpful not only for path planning in 2D but also to define CPLs for Solids inside of a limiting contour between start and endpoints (Base points, Attachment points)
read also the dissertation of Tim Lueth ;-)

See Also: CPLofPLgrowline , PLshortestpathinCPL , CPLskeleton , CPLskeletonsearch , matrixskeleton , matrixdistanceofCPL

Example Illustration

 missing image of PLshortestpathinCPLcost(CPL,A,B,shr,n,smo,CPLG)

Syntax

[PLB,PL,k,shr]=PLshortestpathinCPLcost(CPL,A,B,[shr,n,smo,CPLG])

Input Parameter

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

Output Parameter

PLB: Bezier smoothed path
PL: Grid bases path
k: grid numbers
shr: dynamic shrinkage value

Examples


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




Copyright 2022-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Last html export of this page out of FM database by TL: 2025-09-21