Design kit command

shapeBuilder.regions

Shape builder regions

Answers the regions the shape builder sees among the selected or given layers, with their paths, sources and covering paints.

Kit
Design 0.1.0 (.kdesign)
Changes the document
no
Acts on
ids (a list of ids), which a run step’s on fills

Parameters

Parameters of shapeBuilder.regions
NameTypeRequiredDescription
ids(integer | string)[]no

Call through design_run

text
design_run {
  "path": "<file>.kdesign",
  "steps": [{ "command": "shapeBuilder.regions" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: ids. design_run answers the step’s result in completed[i].result.

Result

Result of shapeBuilder.regions
NameTypeRequiredDescription
regionsany[]no
sourcesany[]no
Result JSON Schema
json
{
  "additionalProperties": true,
  "properties": {
    "regions": {
      "type": "array"
    },
    "sources": {
      "type": "array"
    }
  },
  "type": "object"
}

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "ids": {
      "items": {
        "description": "an id",
        "oneOf": [
          {
            "type": "integer"
          },
          {
            "type": "string"
          }
        ]
      },
      "type": "array",
      "x-khp-types": [
        "Node"
      ]
    }
  },
  "returns": "{sources (bottom to top), regions: [{index, path (SVG, page), sources (top-most first), parts: [{id, stroke}] (the fills and outlined strokes covering it, top-most first), bounds [x, y, w, h], point [x, y] inside}]} — visible strokes take part as their outlined areas, so stroked lines and open paths split regions",
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (design_commands through @kition/[email protected], built from KitionAI/kition-design@abc7e16). As data: commands.jsonl.