Kit route crossings: count crossings at a shared sample and along a shared stretch

未关闭
#235 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
54/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
tooling

调研方向

Start with packages/renderers/kit/src/routes/crossings.ts and segment-crossing.ts, then read crossingsBetween and the existing together behavior. Add the terraform-deployment and perpendicular-grid cases to packages/renderers/kit/test/routes.test.mjs and run the route tests. Done means both shared-sample and shared-stretch crossings are counted once, shared trunks from a common port remain uncounted, and the drafting, converging, and ports tests stay green.

由索引模型根据 Issue 内容生成。

描述

The kit's crossing test (polylinesCross / routeCrossings, packages/renderers/kit/src/routes/crossings.ts and segment-crossing.ts) counts a proper crossing, and since #234 a route passing through another at one of its own samples. It still misses:

  1. Two routes meeting at a sample of each. For example, perpendicular lines sampled every 3 units both have a sample at the crossing point, so neither the proper test nor the through-a-sample test sees it (Copilot review on #234).
  2. Two routes crossing along a stretch they share. One route joins another's run from one side and leaves it to the other side, which reads as a crossing with a hidden overlap. crossingsBetween treats collinear stretches as a trunk and never counts them.

These need doing together. Counting (1) alone (the neighbouring samples interleaved strictly around the shared point) changes terraform-deployment's routing so that lambda.api and lambda.payments into aws_subnet.private[0] take one track and part on opposite sides, which is (2).

Suggested approach: for a shared sample or shared collinear stretch, compare the side each route enters from (the last sample before) with the side it leaves to (the first sample after), relative to the other route. Count a crossing when they differ, once per shared stretch, and keep shared trunks from a common port uncounted, as together does now.

Check: add terraform-deployment and the perpendicular-grid case to packages/renderers/kit/test/routes.test.mjs; the drafting, converging and ports tests should stay green.

主要语言
TypeScript
星标
4
派生
1
平均合并
5 小时 31 分钟
30 天内合并 PR
229

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

githubnext/projections 的其他 Issue

查看 githubnext/projections 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。