by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Geometric Queries
Introduced first in SolidGeometry 2.7, Creation date: 2015-09-22, Last change: 2025-09-14
[CP,k,k1,kb,ka]=PLcrossCPLline(CPL,pa,pb,[touch,full])
CPL: | Closed Polygon List | |
pa: | line start point | |
pb: | line end point | |
touch: | check on touch instead of cross; default is false | |
full: | return a full crossing point list; default is false |
CP: | Crossing Point | |
k: | index in PL | |
k1: | subsequent index in PL | |
kb: | distance from pa | |
ka: | distance from pb |
PLcrossCPLline(PLcircle(10,8),[0 0 ],[15 15])
PLcrossCPLline(PLcircle(10,8),[-15 -15 ],[15 15])
PLcrossCPLline(PLcircle(10,8),[-15 -15 ],[15 15],'',true)
PL=PLsplitpointsofCPL(CPLsample(45)); [a,b,c]=PLcrossCPLline(CPLsample(45),PL,PL,true) % first point
PL=PLsplitpointsofCPL(CPLsample(45)); [a,b,c]=PLcrossCPLline(CPLsample(45),PL,PL,true,true) % all points