Operações do BadBit CAD
cad.draw.ray
Desenha semirretas (RAY) a partir de um ponto.
- Programa: BadBit CAD
- Tipo de ação: Altera o desenho
- Altera o desenho
- Desde a versão 2027.0.0-beta.8
Cria uma semirreta (infinita para um lado) de start passando por cada ponto de through, como o RAY. Devolve os identificadores na ordem. No papel (um layout à vista, fora das janelas de vista), as coordenadas e as medidas são em mm; os ângulos e os fatores de escala não mudam.
Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
layer | string | null | Não | Nome da camada. |
start | array<number> | Sim | Ponto inicial [x, y] de uma linha. |
through | array<array<number>> | Sim | Os pontos [[x, y], …] por onde cada linha passa. |
Erros
| Código | JSON-RPC | O que significa |
|---|---|---|
invalid_params | -32602 | Os parâmetros não seguem o esquema ou uma regra da operação. |
not_found | -32001 | O objeto, a operação, o arquivo ou o nome não existe. |
conflict | -32004 | O estado atual não permite isso agora. |
failed | -32005 | A operação falhou. |
Exemplo
MCP
JSON
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"arguments": {
"start": [
0,
0
],
"through": [
[
10,
10
]
]
},
"operation": "cad.draw.ray"
},
"name": "badbit_call_operation"
}
}Python
Python
import badbit
result = badbit.cad.draw.ray(start=[0, 0], through=[[10, 10]])LISP
LISP
(badbit-call "cad.draw.ray" '(("start" . (0 0)) ("through" . ((10 10)))))JSON-RPC
JSON
{
"id": 1,
"jsonrpc": "2.0",
"method": "badbit/call",
"params": {
"arguments": {
"start": [
0,
0
],
"through": [
[
10,
10
]
]
},
"operation": "cad.draw.ray"
}
}Comandos que fazem o mesmo
Esquema completo
JSON Schema 2020-12, com as descrições em inglês.
Parâmetros (entrada)
JSON
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"layer": {
"default": null,
"description": "Layer name.",
"type": [
"string",
"null"
]
},
"start": {
"description": "Start point [x, y] of a line.",
"items": {
"format": "double",
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"type": "array"
},
"through": {
"description": "The points [[x, y], …] each line passes through.",
"items": {
"items": {
"format": "double",
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"type": "array"
},
"maxItems": 10000,
"minItems": 1,
"type": "array"
}
},
"required": [
"start",
"through"
],
"type": "object"
}Resultado (saída)
JSON
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"ids": {
"description": "Object identifiers (32 hexadecimal digits each).",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"ids"
],
"type": "object"
}