运行线生成关联车站限制增加
This commit is contained in:
parent
632371b64c
commit
2f5a932c58
@ -6,6 +6,7 @@ import {
|
||||
getNormalVector,
|
||||
movePointAlongNormal,
|
||||
getIntersectionPoint,
|
||||
distance,
|
||||
} from 'src/jl-graphic';
|
||||
import { RunLineName } from './RunLineName';
|
||||
import { PathLine } from '../pathLine/PathLine';
|
||||
@ -249,17 +250,28 @@ export class RunLine extends JlGraphic {
|
||||
this.datas.points.forEach((p, index) => {
|
||||
if (index) {
|
||||
stations.forEach((station) => {
|
||||
const distance = calculateDistanceFromPointToLine(
|
||||
const sp = station.position;
|
||||
const prep = this.datas.points[index - 1];
|
||||
const distanceF = calculateDistanceFromPointToLine(
|
||||
p,
|
||||
this.datas.points[index - 1],
|
||||
station.position
|
||||
);
|
||||
if (distance < 4) {
|
||||
const distance1 = distance(sp.x, sp.y, prep.x, prep.y);
|
||||
const distance2 = distance(sp.x, sp.y, p.x, p.y);
|
||||
const distance3 = distance(p.x, p.y, prep.x, prep.y);
|
||||
if (
|
||||
distanceF < 4 &&
|
||||
distance1 < distance3 + distanceF &&
|
||||
distance2 < distance3 + distanceF &&
|
||||
!containSta.includes(station.id)
|
||||
) {
|
||||
containSta.push(station.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
console.log(containSta);
|
||||
this.datas.containSta = containSta;
|
||||
}
|
||||
generatePathLineKilometerPoints(): void {
|
||||
|
Loading…
Reference in New Issue
Block a user