function getSkewedPolygonVertexes(c, cr1, cr2){
[c,cr1,cr2].forEach(p=>{p.xPos=p.x;p.yPos=p.y});
const max = 200||this.boundMax;
let vertexes = [c,cr1];
const normalize = (x,y) =>{
if(x==-max) return (+y+max) / (max*2) / 4;
if(y==+max) return (+x+max) / (max*2) / 4 + 0.25;
if(x==+max) return (-y+max) / (max*2) / 4 + 0.50;
if(y==-max) return (-x+max) / (max*2) / 4 + 0.75;
}
const cr1Norm = normalize(cr1.xPos,cr1.yPos);
const cr2Norm = normalize(cr2.xPos,cr2.yPos);
const edgePointExtents = {
'bottom':[{xPos:-max,yPos:-max},{xPos:-max,yPos:+max},{xPos:+max,yPos:+max},{xPos:+max,yPos:-max}],
'left':[{xPos:-max,yPos:+max},{xPos:+max,yPos:+max},{xPos:+max,yPos:-max},{xPos:-max,yPos:-max}],
'top':[{xPos:+max,yPos:+max},{xPos:+max,yPos:-max},{xPos:-max,yPos:-max},{xPos:-max,yPos:+max}],
'right':[{xPos:+max,yPos:-max},{xPos:-max,yPos:-max},{xPos:-max,yPos:+max},{xPos:+max,yPos:+max}]
}
const edge = getCrossingPointEdge(cr1)
const extentPoints = edgePointExtents[edge]
const extentPointNorm = extentPoints.map(p=>normalize(p.xPos,p.yPos));
extentPointNorm.forEach((normP,i)=>{
if(cr1Norm<=normP && normP<=cr2Norm){
vertexes.push(extentPoints[i])
}
if(cr1Norm>cr2Norm){
if(!(cr2Norm<=normP && normP<=cr1Norm)){
vertexes.push(extentPoints[i])
}
}
});
vertexes.push(cr2);
vertexes.forEach(p=>{p.x=p.xPos;p.y=p.yPos});
return vertexes;
return {
vertexes,
extentPointNorm,
cr1Norm,
cr2Norm
};
}