Saltar al contenido
BadBit Documentación
Iniciar sesión Descargar la beta

Operaciones de BadBit CAD

cad.draw.ellipse

Dibuja una elipse o un arco de elipse (ELLIPSE) por centro y ejes.

  • Programa: BadBit CAD
  • Tipo de acción: Cambia el dibujo
  • Modifica el dibujo
  • Desde la versión 2027.0.0-beta.8

Como la opción Centro de ELLIPSE: center, axis_end (el extremo de un eje) y other_radius (la distancia del centro al otro eje); el mayor pasa a ser el eje mayor. Con arc_start_angle y arc_end_angle (grados, antihorario, medidos desde el eje mayor) hace el arco de elipse (la opción Arco). Devuelve el identificador. En el papel (una presentación a la vista, fuera de las ventanas gráficas), las coordenadas y las medidas son en mm; los ángulos y los factores de escala no cambian.

Parámetros

NombreTipoObligatorioDescripción
arc_end_anglenumber | nullNoÁngulo final del arco de elipse, en grados, desde el eje mayor.
arc_start_anglenumber | nullNoÁngulo inicial del arco de elipse, en grados, desde el eje mayor.
axis_endarray<number>SíEl extremo [x, y] de un eje de la elipse.
centerarray<number>SíPunto del centro [x, y].
layerstring | nullNoNombre de la capa.
other_radiusnumberSíDistancia del centro al otro eje.

Errores

CódigoJSON-RPCQué significa
invalid_params-32602Los parámetros no siguen el esquema o una regla de la operación.
not_found-32001El objeto, la operación, el archivo o el nombre no existe.
conflict-32004El estado actual no lo permite ahora.
failed-32005La operación falló.

Ejemplo

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 hacen lo mismo

ELLIPSE

Esquema completo

JSON Schema 2020-12, con las descripciones en 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 (salida)
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 en la documentación