Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CRYPTIC]: Argument at index 1 was supposed to be type kcl_lib::execution::geometry::SketchSurface but found string (text) #5801

Open
jgomez720 opened this issue Mar 13, 2025 · 0 comments
Assignees
Labels
cryptic-error Source code produces a confusing error

Comments

@jgomez720
Copy link
Collaborator

Paste minimal KCL source that produces a cryptic error

// Define a function to draw the ZOO "Z"
export fn zLogo(surface, origin, scale) {
  zSketch = surface
    |> startProfileAt([
         0 + origin[0],
         0.15 * scale + origin[1]
       ], %)
    |> yLine(-0.15 * scale, %)
    |> xLine(0.15 * scale, %)
    |> angledLineToX({
         angle = 47.15,
         to = 0.3 * scale + origin[0]
       }, %, $seg1)
    |> yLineTo(0 + origin[1], %, $seg3)
    |> xLine(0.63 * scale, %)
    |> yLine(0.225 * scale, %)
    |> xLine(-0.57 * scale, %)
    |> angledLineToX({
         angle = 47.15,
         to = 0.93 * scale + origin[0]
       }, %)
    |> yLine(0.15 * scale, %)
    |> xLine(-0.15 * scale, %)
    |> angledLine({
         angle = 47.15,
         length = -segLen(seg1)
       }, %, $seg2)
    |> yLine(segLen(seg3), %)
    |> xLineTo(0 + origin[0], %)
    |> yLine(-0.225 * scale, %)
    |> angledLineThatIntersects({
         angle = 0,
         intersectTag = seg2,
         offset = 0
       }, %)
    |> close(%)
  return zSketch
}

// Define a function to draw the ZOO "O"
export fn oLogo(surface, origin, scale) {
  oSketch001 = surface
    |> startProfileAt([
         .788 * scale + origin[0],
         .921 * scale + origin[1]
       ], %)
    |> arc({
         angleStart = 47.15 + 6,
         angleEnd = 47.15 - 6 + 180,
         radius = .525 * scale
       }, %)
    |> angledLine({ angle = 47.15, length = .24 * scale }, %)
    |> arc({
         angleStart = 47.15 - 11 + 180,
         angleEnd = 47.15 + 11,
         radius = .288 * scale
       }, %)
    |> close(%)
  return oSketch001
}

export fn oLogo2(surface, origin, scale) {
  oSketch002 = surface
    |> startProfileAt([
         .16 * scale + origin[0],
         .079 * scale + origin[1]
       ], %)
    |> arc({
         angleStart = 47.15 + 6 - 180,
         angleEnd = 47.15 - 6,
         radius = .525 * scale
       }, %)
    |> angledLine({ angle = 47.15, length = -.24 * scale }, %)
    |> arc({
         angleStart = 47.15 - 11,
         angleEnd = 47.15 + 11 - 180,
         radius = .288 * scale
       }, %)
    |> close(%)
  return oSketch002
}

zLogo('XY', [0, 0], 1)

Expected Behavior

I expect it to error, but I wouldn't know what they problem is given this error message.

Additional Context

The error is because my function call is zLogo('XY', [0, 0], 1) and not zLogo(startSketchOn("XY"), [0, 0], 1)

Image
@jgomez720 jgomez720 added the cryptic-error Source code produces a confusing error label Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cryptic-error Source code produces a confusing error
Projects
None yet
Development

No branches or pull requests

2 participants