Vector kit command
flattener.preview
Flattener Preview
Answers which areas flattening would rasterize, outline or expand, as the Flattener Preview panel highlights them.
- Kit
- Vector 0.1.0 (.kvector)
- Changes the document
- no
- Acts on
ids(a list of ids), which a run step’sonfills
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
highlight | "none" | "rasterizedRegions" | "transparentObjects" | "allAffected" | "expandedPatterns" | "outlinedStrokes" | "outlinedText" | "allRasterized" | no | areas the raster/vector balance rasterizes whole; pattern art taking part; default none |
id | integer | no | object ID |
ids | integer[] | no | object IDs |
options | object | no | read by the command beside its listed parameters |
overprints | "preserve" | "simulate" | "discard" | no | simulate and discard flatten without preserveOverprints |
preset | string | no |
Call through vector_run
text
vector_run {
"path": "<file>.kvector",
"steps": [{ "command": "flattener.preview" }]
}The required parameters, with placeholders for their types: not a tested example. Optional: highlight, id, ids, options, overprints, preset. vector_run answers the step’s result in completed[i].result.
Result
| Name | Type | Required | Description |
|---|---|---|---|
counts | object | no | |
highlight | string | no | |
options | object | no | |
regions | any[] | no |
Result JSON Schema
json
{
"additionalProperties": true,
"properties": {
"counts": {
"additionalProperties": true,
"properties": {
"allAffected": {
"type": "number"
},
"allRasterized": {
"type": "number"
},
"expandedPatterns": {
"type": "number"
},
"outlinedStrokes": {
"type": "number"
},
"outlinedText": {
"type": "number"
},
"rasterizedRegions": {
"type": "number"
},
"transparentObjects": {
"type": "number"
},
"vectorRegions": {
"type": "number"
}
},
"type": "object"
},
"highlight": {
"type": "string"
},
"options": {
"additionalProperties": true,
"properties": {
"antiAlias": {
"type": "boolean"
},
"balance": {
"type": "number"
},
"clipComplexRegions": {
"type": "boolean"
},
"gradientPpi": {
"type": "number"
},
"lineArtPpi": {
"type": "number"
},
"preserveAlpha": {
"type": "boolean"
},
"preserveOverprints": {
"type": "boolean"
},
"strokesToOutlines": {
"type": "boolean"
},
"textToOutlines": {
"type": "boolean"
}
},
"type": "object"
},
"regions": {
"type": "array"
}
},
"type": "object"
}Parameter schema
json
{
"additionalProperties": false,
"properties": {
"highlight": {
"description": "areas the raster/vector balance rasterizes whole; pattern art taking part; default none",
"enum": [
"none",
"rasterizedRegions",
"transparentObjects",
"allAffected",
"expandedPatterns",
"outlinedStrokes",
"outlinedText",
"allRasterized"
],
"type": "string"
},
"id": {
"description": "object ID",
"type": "integer",
"x-khp-types": [
"Node"
]
},
"ids": {
"description": "object IDs",
"items": {
"type": "integer"
},
"type": "array",
"x-khp-types": [
"Node"
]
},
"options": {
"additionalProperties": true,
"description": "read by the command beside its listed parameters",
"type": "object"
},
"overprints": {
"description": "simulate and discard flatten without preserveOverprints",
"enum": [
"preserve",
"simulate",
"discard"
],
"type": "string"
},
"preset": {
"type": "string"
}
},
"returns": "{highlight, regions: [{bounds: {x, y, width, height}, id?}] (the highlighted objects, or areas), counts: {transparentObjects, allAffected, expandedPatterns, outlinedStrokes, outlinedText, rasterizedRegions, allRasterized, vectorRegions}, options}",
"type": "object"
}Generated from the command list of @kition/[email protected] and the kit itself (vector_commands through @kition/[email protected], built from KitionAI/kition-vector@7cf908f). As data: commands.jsonl.