KCL: Fix cryptic error when using duplicate edges in fillet call (#5755)

Fixes https://github.com/KittyCAD/modeling-app/issues/4307

Now if you try to fillet the same edge twice in a single fillet command,
the error message is clearer, and the source range will highlight
the specific edges in the array which are duplicated.

Same goes for chamfer.

Note: although the Rust KCL interpreter sends back an array of SourceRange
for each KCL error, the frontend only puts the first one into CodeMirror
diagnostics. We should fix that: https://github.com/KittyCAD/modeling-app/issues/5754
This commit is contained in:
Adam Chalmers
2025-03-12 11:24:27 -05:00
committed by GitHub
parent f8e53c6577
commit 865bf8ae7a
7 changed files with 125 additions and 49 deletions

View File

@ -1,8 +1,15 @@
const part001 = startSketchOn('XY')
|> startProfileAt([0,0], %)
|> line(end = [0, 10], tag = $thing)
|> line(end = [10, 0])
|> line(end = [0, -10], tag = $thing2)
|> close()
|> extrude(length = 10)
|> fillet(radius = 0.5, tags = [thing, thing])
startProfileAt([0, 0], startSketchOn("XY"))
|> xLine(length = 10, tag = $line000)
|> yLine(length = 10, tag = $line001)
|> xLine(endAbsolute = profileStartX(%), tag = $line002)
|> close(tag = $line003)
|> extrude(length = 10)
|> fillet(
radius = 1,
tags = [
line003,
getNextAdjacentEdge(line000),
getPreviousAdjacentEdge(line001)
],
)