Skip to main content
Glama

Project Curve

project_curve

Use this when you need to wrap a 2D closed curve onto a 3D face. Insert a <shape>.projectCurve({ source, face, scaleMode? }) chained call into a kernelCAD script. The source is the structured { kind: "sketchCommands", commands: [...] } wire format the runtime API accepts. Wraps the curve onto the face along the face normal; pair with .extrude(d) / .cut(...) for raised or engraved logos on curved bodies. Open-wire projection (asEdge: true) is not implemented and is rejected at edit time. Side-effect-free; returns modified code plus diagnostics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe .kcad.ts source code.
faceYesTarget face — canonical name or label.
asEdgeNoOpen-wire (edge) projection. NOT IMPLEMENTED — rejected at edit time. Use a closed-curve projection (omit asEdge).
bindAsNoOptional local variable name; emits `const <bindAs> = <target>.projectCurve(...);`.
targetYesVariable name of the Shape to chain onto.
commandsYesClosed 2D path to wrap onto the face, as plain-number commands. Must start with a `moveTo` and end with a `close` (e.g. [{kind:"moveTo",x:0,y:0},{kind:"lineTo",x:2,y:0},{kind:"lineTo",x:2,y:2},{kind:"close"}]).
scaleModeNoDrawing.sketchOnFace scaling mode. Default original.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedOutput schema / properties
      Removed value: -{
      -  "binding_name": {
      -    "description": "JS const name bound to the new construct (when one was created).",
      -    "type": "string"
      -  },
      -  "diagnostics": {
      -    "description": "Diagnostics from re-evaluating the modified source.",
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "error": {
      -    "description": "Failure message (present when ok is false).",
      -    "type": "string"
      -  },
      -  "new_code": {
      -    "description": "Modified .kcad.ts source (present on success). Caller persists it.",
      -    "type": "string"
      -  },
      -  "ok": {
      -    "description": "Whether the edit applied and re-evaluated cleanly.",
      -    "type": "boolean"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "ok"
      -]
  2. Changed4 schema fields changed
    • changedInput schema / properties / asEdge / description
      Previous value: -"Project as an open edge instead of a closed face-bound sketch. Currently deferred."New value: +"Open-wire (edge) projection. NOT IMPLEMENTED — rejected at edit time. Use a closed-curve projection (omit asEdge)."
    • addedInput schema / properties / commands
      Added value: +{
      +  "description": "Closed 2D path to wrap onto the face, as plain-number commands. Must start with a `moveTo` and end with a `close` (e.g. [{kind:\"moveTo\",x:0,y:0},{kind:\"lineTo\",x:2,y:0},{kind:\"lineTo\",x:2,y:2},{kind:\"close\"}]).",
      +  "items": {
      +    "properties": {
      +      "kind": {
      +        "enum": [
      +          "moveTo",
      +          "lineTo",
      +          "close"
      +        ],
      +        "type": "string"
      +      },
      +      "x": {
      +        "type": "number"
      +      },
      +      "y": {
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "kind"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • removedInput schema / properties / curveExpression
      Removed value: -{
      -  "description": "JS expression returning a closed sketch (e.g. `path().moveTo(0,0).lineTo(2,0).lineTo(2,2).close().build()`). Inserted verbatim as the `curve:` field.",
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "code",
      -  "target",
      -  "curveExpression",
      -  "face"
      -]New value: +[
      +  "code",
      +  "target",
      +  "commands",
      +  "face"
      +]
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "binding_name": {
      +      "description": "JS const name bound to the new construct (when one was created).",
      +      "type": "string"
      +    },
      +    "diagnostics": {
      +      "description": "Diagnostics from re-evaluating the modified source.",
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "error": {
      +      "description": "Failure message (present when ok is false).",
      +      "type": "string"
      +    },
      +    "new_code": {
      +      "description": "Modified .kcad.ts source (present on success). Caller persists it.",
      +      "type": "string"
      +    },
      +    "ok": {
      +      "description": "Whether the edit applied and re-evaluated cleanly.",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  4. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.