Pular para o conteúdo
BadBit Documentação
Entrar Baixar o beta

Operações do BadBit CAD

cad.draw.ellipse

Desenha uma elipse ou um arco de elipse (ELLIPSE) por centro e eixos.

  • Programa: BadBit CAD
  • Tipo de ação: Altera o desenho
  • Altera o desenho
  • Desde a versão 2027.0.0-beta.8

Como a opção Centro do ELLIPSE: center, axis_end (a ponta de um eixo) e other_radius (a distância do centro até o outro eixo); o maior vira o eixo maior. Com arc_start_angle e arc_end_angle (graus, anti-horário, medidos a partir do eixo maior) faz o arco de elipse (a opção Arco). Devolve o identificador. 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

NomeTipoObrigatórioDescrição
arc_end_anglenumber | nullNãoÂngulo final do arco de elipse, em graus, a partir do eixo maior.
arc_start_anglenumber | nullNãoÂngulo inicial do arco de elipse, em graus, a partir do eixo maior.
axis_endarray<number>SimA ponta [x, y] de um eixo da elipse.
centerarray<number>SimPonto do centro [x, y].
layerstring | nullNãoNome da camada.
other_radiusnumberSimDistância do centro até o outro eixo.

Erros

CódigoJSON-RPCO que significa
invalid_params-32602Os parâmetros não seguem o esquema ou uma regra da operação.
not_found-32001O objeto, a operação, o arquivo ou o nome não existe.
conflict-32004O estado atual não permite isso agora.
failed-32005A operação falhou.

Exemplo

MCP

JSON
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "arguments": {
        "axis_end": [
          20,
          0
        ],
        "center": [
          0,
          0
        ],
        "other_radius": 10
      },
      "operation": "cad.draw.ellipse"
    },
    "name": "badbit_call_operation"
  }
}

Python

Python
import badbit

result = badbit.cad.draw.ellipse(axis_end=[20, 0], center=[0, 0], other_radius=10)

LISP

LISP
(badbit-call "cad.draw.ellipse" '(("axis_end" . (20 0)) ("center" . (0 0)) ("other_radius" . 10)))

JSON-RPC

JSON
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "badbit/call",
  "params": {
    "arguments": {
      "axis_end": [
        20,
        0
      ],
      "center": [
        0,
        0
      ],
      "other_radius": 10
    },
    "operation": "cad.draw.ellipse"
  }
}

Comandos que fazem o mesmo

ELLIPSE

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": {
    "arc_end_angle": {
      "default": null,
      "description": "End angle of the elliptical arc, in degrees, from the major axis.",
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    },
    "arc_start_angle": {
      "default": null,
      "description": "Start angle of the elliptical arc, in degrees, from the major axis.",
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    },
    "axis_end": {
      "description": "The end point [x, y] of one axis of the ellipse.",
      "items": {
        "format": "double",
        "type": "number"
      },
      "maxItems": 2,
      "minItems": 2,
      "type": "array"
    },
    "center": {
      "description": "Center point [x, y].",
      "items": {
        "format": "double",
        "type": "number"
      },
      "maxItems": 2,
      "minItems": 2,
      "type": "array"
    },
    "layer": {
      "default": null,
      "description": "Layer name.",
      "type": [
        "string",
        "null"
      ]
    },
    "other_radius": {
      "description": "Distance from the center to the other axis.",
      "format": "double",
      "type": "number"
    }
  },
  "required": [
    "center",
    "axis_end",
    "other_radius"
  ],
  "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"
}
Buscar na documentação