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
| Nombre | Tipo | Obligatorio | Descripción |
|---|---|---|---|
arc_end_angle | number | null | No | Ángulo final del arco de elipse, en grados, desde el eje mayor. |
arc_start_angle | number | null | No | Ángulo inicial del arco de elipse, en grados, desde el eje mayor. |
axis_end | array<number> | Sí | El extremo [x, y] de un eje de la elipse. |
center | array<number> | Sí | Punto del centro [x, y]. |
layer | string | null | No | Nombre de la capa. |
other_radius | number | Sí | Distancia del centro al otro eje. |
Errores
| Código | JSON-RPC | Qué significa |
|---|---|---|
invalid_params | -32602 | Los parámetros no siguen el esquema o una regla de la operación. |
not_found | -32001 | El objeto, la operación, el archivo o el nombre no existe. |
conflict | -32004 | El estado actual no lo permite ahora. |
failed | -32005 | La operación falló. |
Ejemplo
MCP
{
"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
import badbit
result = badbit.cad.draw.ellipse(axis_end=[20, 0], center=[0, 0], other_radius=10)LISP
(badbit-call "cad.draw.ellipse" '(("axis_end" . (20 0)) ("center" . (0 0)) ("other_radius" . 10)))JSON-RPC
{
"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
Esquema completo
JSON Schema 2020-12, con las descripciones en inglés.
Parámetros (entrada)
{
"$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)
{
"$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"
}