Draft CubicBezCurve/es: Difference between revisions

From FreeCAD Documentation
(Created page with "El comando 24px Borrador CubicBezCurva crea una [https://es.wikipedia.org/wiki/Curva_de_B%C3%A9zier Curva de Bézi...")
(Updating to match new version of source page)
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>
<languages/>


<div class="mw-translate-fuzzy">
{{Docnav/es
{{Docnav/es
|[[Draft_BSpline/es|BSpline]]
|[[Draft_BSpline/es|BSpline]]
|[[Draft_BezCurve/es|BezCurva]]
|[[Draft_BezCurve/es|BezCurva]]
|[[Draft_Module/es|Borrador]]
|[[Draft_Workbench/es|Borrador]]
|IconL=Draft_BSpline.svg
|IconL=Draft_BSpline.svg
|IconR=Draft_BezCurve.svg
|IconR=Draft_BezCurve.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
}}
}}
</div>


<div class="mw-translate-fuzzy">
{{GuiCommand/es
{{GuiCommand/es
|Name=Draft CubicBezCurve
|Name=Draft CubicBezCurve
|Name/es=Borrador CubicBezCurva
|Name/es=Borrador CubicBezCurva
|MenuLocation=Dibujo → Herramientas Bézier → Cubic Curva Bézier
|MenuLocation=Dibujo → Herramientas Bézier → Cubic Curva Bézier
|Workbenches=[[Draft_Module/es|Borrador]], [[Arch_Module/es|Arquitectura]]
|Workbenches=[[Draft_Workbench/es|Borrador]], [[Arch_Workbench/es|Arquitectura]]
|Version=0.19
|Version=0.19
|SeeAlso=[[Draft_BezCurve/es|Borrador BezCurva]], [[Draft_BSpline/es|Borrador BSpline]]
|SeeAlso=[[Draft_BezCurve/es|Borrador BezCurva]], [[Draft_BSpline/es|Borrador BSpline]]
}}
}}
</div>


<span id="Description"></span>
==Descripción==
==Descripción==


<div class="mw-translate-fuzzy">
El comando [[Image:Draft_CubicBezCurve.svg|24px]] [[Draft_CubicBezCurve/es|Borrador CubicBezCurva]] crea una [https://es.wikipedia.org/wiki/Curva_de_B%C3%A9zier Curva de Bézier] de tercer grado (se requieren cuatro puntos).
El comando [[Image:Draft_CubicBezCurve.svg|24px]] [[Draft_CubicBezCurve/es|Borrador CubicBezCurva]] crea una [https://es.wikipedia.org/wiki/Curva_de_B%C3%A9zier Curva de Bézier] de tercer grado (se requieren cuatro puntos).
</div>


The Bézier Curve is one of the most commonly used curves in computer graphics. This command allows you to create a continuous spline made up of several 3rd-degree Bézier segments, in a way that is similar to the Bézier tool in [https://inkscape.org/ Inkscape]. A general Bézier curve of any degree can be created with the [[Draft_BezCurve|Draft BezCurve]] command.
La Curva de Bézier es una de las curvas más utilizadas en infografía. Este comando permite crear una spline continua formada por varios segmentos de Bézier de tercer grado, de forma similar a la herramienta Bézier de [https://inkscape.org/ Inkscape]. Una curva Bézier general de cualquier grado puede ser creada con el comando [[Draft_BezCurve/es|Borrador BezCurva]].


<div class="mw-translate-fuzzy">
The [[Draft BezCurve|Draft BezCurve]] and the Draft CubicBezCurve commands use {{Emphasis|control points}} to define the position and curvature of the spline. The [[Draft BSpline|Draft BSpline]] command, on the other hand, specifies the {{Emphasis|exact points}} through which the curve will pass.
Los comandos [[Draft BezCurve/es|Borrador de BezCurva]] y Borrador de CubicBezCurve utilizan {{Emphasis|puntos de control}} para definir la posición y la curvatura de la spline. El comando [[Draft BSpline/es|Borrador BSpline]], en cambio, especifica los {{Emphasis|puntos exactos}} por los que pasará la curva.
</div>


[[File:Draft_CubicBezCurve_example.png|500px]]
[[File:Draft_CubicBezCurve_example.png|500px]]
{{Caption|Spline formada por tres segmentos cúbicos de Bézier. El primer segmento está definido por cuatro puntos. Los segmentos posteriores reutilizan dos puntos del segmento anterior y, por tanto, sólo requieren dos puntos adicionales.}}
{{Caption|Spline consisting of three cubic Bézier segments. The first segment is defined by four points. Subsequent segments reuse two points from the previous segment and therefore require only two additional points.}}


==Usage==
<span id="Usage"></span>
==Utilización==


See also: [[Draft_Tray|Draft Tray]], [[Draft_Snap|Draft Snap]] and [[Draft_Constrain|Draft Constrain]].
Ver también: [[Draft_Tray/es|Bandeja de borrador]], [[Draft_Snap/es|Borrador Snap]] y [[Draft_Constrain/es|Borrador Constreñido]].


# There are several ways to invoke the command:
# There are several ways to invoke the command:
#* Press the {{Button|[[Image:Draft_CubicBezCurve.svg|16px]] [[Draft_CubicBezCurve|Draft CubicBezCurve]]}} button.
#* Press the {{Button|[[Image:Draft_CubicBezCurve.svg|16px]] [[Draft_CubicBezCurve|Cubic Bézier curve]]}} button.
#* Select the {{MenuCommand|Drafting → Bézier tools → [[Image:Draft_CubicBezCurve.svg|16px]] Cubic Bézier curve}} option from the menu.
#* Select the {{MenuCommand|Drafting → Bézier tools → [[Image:Draft_CubicBezCurve.svg|16px]] Cubic Bézier curve}} option from the menu.
# The {{MenuCommand|Cubic Bézier curve}} task panel opens. See [[#Options|Options]] for more information.
# The {{MenuCommand|Cubic Bézier curve}} task panel opens. See [[#Options|Options]] for more information.
# It is not possible the enter points via the task panel.
# It is not possible the enter points via the task panel.
# For the following [[Mouse_Model|Mouse Navigation Models]] a keyboard key must to be held down:
# For the following [[Mouse_navigation|Mouse Navigation Models]] a keyboard key must to be held down:
#* If you are using [[Mouse_Model#OpenInventor_Navigation|OpenInventor Navigation]] the {{KEY|Ctrl}} key must be held down throughout the command.
#* If you are using [[Mouse_navigation#OpenInventor_Navigation|OpenInventor Navigation]] the {{KEY|Ctrl}} key must be held down throughout the command.
#* If you are using [[Mouse_Model#Mouse_Model#Gesture_Navigation|Gesture Navigation]] the {{KEY|Alt}} key must be held down for each click-hold-release sequence, but is also possible to keep this key held down throughout the command.
#* If you are using [[Mouse_navigation#Gesture_Navigation|Gesture Navigation]] the {{KEY|Alt}} key must be held down for each click-hold-release sequence, but is also possible to keep this key held down throughout the command.
# Pick the first point in the [[3D_view|3D view]] and hold the mouse button (1), this is the first endpoint.
# Pick the first point in the [[3D_view|3D view]] and hold the mouse button (1), this is the first endpoint.
# Drag the pointer to another point in the [[3D_view|3D view]] and release the mouse button (2), this is the first control point.
# Drag the pointer to another point in the [[3D_view|3D view]] and release the mouse button (2), this is the first control point.
Line 49: Line 59:
# Optionally repeat the process of clicking and holding (5), and dragging and releasing (6) to add more segments.
# Optionally repeat the process of clicking and holding (5), and dragging and releasing (6) to add more segments.
# Each subsequent segment will use the second endpoint and second control point of the previous segment as its first endpoint and first control point respectively.
# Each subsequent segment will use the second endpoint and second control point of the previous segment as its first endpoint and first control point respectively.
# Press {{KEY|Esc}} or the {{button|Close}} button to finish the command.
# Press {{KEY|Esc}} or the {{Button|Close}} button to finish the command.

==Notas==

* A Draft CubicBezCurve can be edited with the [[Draft_Edit|Draft Edit]] command.


<span id="Options"></span>
==Opciones==
==Opciones==


See [[Draft_BezCurve#Options|Draft BezCurve]].
See [[Draft_BezCurve#Options|Draft BezCurve]].


<span id="Notes"></span>
==Notas==

* A Draft CubicBezCurve can be edited with the [[Draft_Edit|Draft Edit]] command.

<span id="Properties"></span>
==Propiedades==
==Propiedades==


See [[Draft_BezCurve#Properties|Draft BezCurve]].
See [[Draft_BezCurve#Properties|Draft BezCurve]].


<span id="Scripting"></span>
==Archivos de guión==
==Archivos de guión==


See also: [https://www.freecadweb.org/api Autogenerated API documentation] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].


See [[Draft BezCurve|Draft BezCurve]] for general information. A cubic Bézier is created by passing the option <code>degree=3</code> to {{incode|makeBezCurve()}}.
See [[Draft_BezCurve|Draft BezCurve]] for general information. A cubic Bézier is created by passing the option <code>degree=3</code> to {{incode|makeBezCurve()}}.


For each cubic Bézier segment four points must be used, of which the two extreme points indicate where the spline passes through, and the two intermediate points are control points.
For each cubic Bézier segment four points must be used, of which the two extreme points indicate where the spline passes through, and the two intermediate points are control points.
Line 80: Line 94:
[[File:Draft_CubicBezCurve_API_example.png|600px]]
[[File:Draft_CubicBezCurve_API_example.png|600px]]


{{Caption|Examples of Bézier curves produced by using 2, 3, 4, 5, 6, 7, and 8 points. The solid lines indicate cubic Bézier segments; the other lines are quadratic or linear.}}
{{Caption|Ejemplos de curvas de Bézier producidas utilizando 2, 3, 4, 5, 6, 7 y 8 puntos. Las líneas sólidas indican segmentos cúbicos de Bézier; las otras líneas son cuadráticas o lineales.}}


Ejemplo:
Ejemplo:
Line 87: Line 101:
import FreeCAD as App
import FreeCAD as App
import Draft
import Draft

doc = App.newDocument()


p1 = App.Vector(-3500, 0, 0)
p1 = App.Vector(-3500, 0, 0)
Line 116: Line 132:
c8.Label = "B3_c5"
c8.Label = "B3_c5"


App.ActiveDocument.recompute()
doc.recompute()


B1 = Draft.make_bezcurve([p1, p2], degree=3)
B1 = Draft.make_bezcurve([p1, p2], degree=3)
Line 146: Line 162:
B7.ViewObject.DrawStyle = "Dashed"
B7.ViewObject.DrawStyle = "Dashed"


App.ActiveDocument.recompute()
doc.recompute()
}}
}}




<div class="mw-translate-fuzzy">
{{Docnav/es
{{Docnav/es
|[[Draft_BSpline/es|BSpline]]
|[[Draft_BSpline/es|BSpline]]
|[[Draft_BezCurve/es|BezCurva]]
|[[Draft_BezCurve/es|BezCurva]]
|[[Draft_Module/es|Borrador]]
|[[Draft_Workbench/es|Borrador]]
|IconL=Draft_BSpline.svg
|IconL=Draft_BSpline.svg
|IconR=Draft_BezCurve.svg
|IconR=Draft_BezCurve.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
}}
}}
</div>


{{Draft Tools navi{{#translation:}}}}
{{Draft Tools navi{{#translation:}}}}

Latest revision as of 19:30, 7 December 2023

Borrador CubicBezCurva

Ubicación en el Menú
Dibujo → Herramientas Bézier → Cubic Curva Bézier
Entornos de trabajo
Borrador, Arquitectura
Atajo de teclado por defecto
Ninguno
Introducido en versión
0.19
Ver también
Borrador BezCurva, Borrador BSpline

Descripción

El comando Borrador CubicBezCurva crea una Curva de Bézier de tercer grado (se requieren cuatro puntos).

La Curva de Bézier es una de las curvas más utilizadas en infografía. Este comando permite crear una spline continua formada por varios segmentos de Bézier de tercer grado, de forma similar a la herramienta Bézier de Inkscape. Una curva Bézier general de cualquier grado puede ser creada con el comando Borrador BezCurva.

Los comandos Borrador de BezCurva y Borrador de CubicBezCurve utilizan puntos de control para definir la posición y la curvatura de la spline. El comando Borrador BSpline, en cambio, especifica los puntos exactos por los que pasará la curva.

Spline formada por tres segmentos cúbicos de Bézier. El primer segmento está definido por cuatro puntos. Los segmentos posteriores reutilizan dos puntos del segmento anterior y, por tanto, sólo requieren dos puntos adicionales.

Utilización

Ver también: Bandeja de borrador, Borrador Snap y Borrador Constreñido.

  1. There are several ways to invoke the command:
    • Press the Cubic Bézier curve button.
    • Select the Drafting → Bézier tools → Cubic Bézier curve option from the menu.
  2. The Cubic Bézier curve task panel opens. See Options for more information.
  3. It is not possible the enter points via the task panel.
  4. For the following Mouse Navigation Models a keyboard key must to be held down:
    • If you are using OpenInventor Navigation the Ctrl key must be held down throughout the command.
    • If you are using Gesture Navigation the Alt key must be held down for each click-hold-release sequence, but is also possible to keep this key held down throughout the command.
  5. Pick the first point in the 3D view and hold the mouse button (1), this is the first endpoint.
  6. Drag the pointer to another point in the 3D view and release the mouse button (2), this is the first control point.
  7. Move the pointer to another point in the 3D view, pick this point and hold the mouse button (3), this is the second endpoint.
  8. Move the pointer to another point in the 3D view to adjust the final curvature of the segment and release the mouse button (4), this is the second control point.
  9. You now have one Bézier curve of the 3rd degree.
  10. Optionally repeat the process of clicking and holding (5), and dragging and releasing (6) to add more segments.
  11. Each subsequent segment will use the second endpoint and second control point of the previous segment as its first endpoint and first control point respectively.
  12. Press Esc or the Close button to finish the command.

Opciones

See Draft BezCurve.

Notas

  • A Draft CubicBezCurve can be edited with the Draft Edit command.

Propiedades

See Draft BezCurve.

Archivos de guión

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

See Draft BezCurve for general information. A cubic Bézier is created by passing the option degree=3 to makeBezCurve().

For each cubic Bézier segment four points must be used, of which the two extreme points indicate where the spline passes through, and the two intermediate points are control points.

  • If only 3 points are given, it creates a quadratic Bézier instead, with only one control point.
  • If only 2 points are given, it creates a linear Bézier, that is, a straight line.
  • If 5 points are given, the first 4 create a cubic Bézier segment; the 4th and the 5th points are used to create a straight line.
  • If 6 points are given, the first 4 create a cubic Bézier segment; the 4th and the other two points are used to create a quadratic Bézier segment.
  • If 7 points are given, the first 4 create a cubic Bézier segment; the 4th and the other three points are used to create a second cubic Bézier segment.
  • In general, the last point in a group of four is shared with the following three points maximum to create another Bézier segment.
  • To have smooth curves, with no straight segments, the number of points should be 3n + 1 or 3n, where n is the number of segments, for n >= 1.

Ejemplos de curvas de Bézier producidas utilizando 2, 3, 4, 5, 6, 7 y 8 puntos. Las líneas sólidas indican segmentos cúbicos de Bézier; las otras líneas son cuadráticas o lineales.

Ejemplo:

import FreeCAD as App
import Draft

doc = App.newDocument()

p1 = App.Vector(-3500, 0, 0)
p2 = App.Vector(-3000, 2000, 0)
p3 = App.Vector(-1100, 2000, 0)
p4 = App.Vector(0, 0, 0)

p5 = App.Vector(1500, -2000, 0)
p6 = App.Vector(3000, -1500, 0)
p7 = App.Vector(5000, 0, 0)
p8 = App.Vector(6000, 1500, 0)
rot = App.Rotation()

c1 = Draft.make_circle(100, placement=App.Placement(p1, rot), face=False)
c1.Label = "B1_E1"
c2 = Draft.make_circle(50, placement=App.Placement(p2, rot), face=True)
c2.Label = "B1_c1"
c3 = Draft.make_circle(50, placement=App.Placement(p3, rot), face=True)
c3.Label = "B1_c2"
c4 = Draft.make_circle(100, placement=App.Placement(p4, rot), face=False)
c4.Label = "B1_E2"
c5 = Draft.make_circle(50, placement=App.Placement(p5, rot), face=True)
c5.Label = "B2_c3"
c6 = Draft.make_circle(50, placement=App.Placement(p6, rot), face=True)
c6.Label = "B2_c4"
c7 = Draft.make_circle(100, placement=App.Placement(p7, rot), face=False)
c7.Label = "B2_E3"
c8 = Draft.make_circle(50, placement=App.Placement(p8, rot), face=True)
c8.Label = "B3_c5"

doc.recompute()

B1 = Draft.make_bezcurve([p1, p2], degree=3)
B1.Label = "B_lin"
B1.ViewObject.DrawStyle = "Dashed"

B2 = Draft.make_bezcurve([p1, p2, p3], degree=3)
B2.Label = "B_quad"
B2.ViewObject.DrawStyle = "Dotted"

B3 = Draft.make_bezcurve([p1, p2, p3, p4], degree=3)
B3.Label = "B_cub"
B3.ViewObject.LineWidth = 4

B4 = Draft.make_bezcurve([p1, p2, p3, p4, p5], degree=3)
B4.Label = "B_cub+lin"
B4.ViewObject.DrawStyle = "Dashed"

B5 = Draft.make_bezcurve([p1, p2, p3, p4, p5, p6], degree=3)
B5.Label = "B_cub+quad"
B5.ViewObject.DrawStyle = "Dotted"

B6 = Draft.make_bezcurve([p1, p2, p3, p4, p5, p6, p7], degree=3)
B6.Label = "B_cub+cub"
B6.ViewObject.LineWidth = 2

B7 = Draft.make_bezcurve([p1, p2, p3, p4, p5, p6, p7, p8], degree=3)
B7.Label = "B_cub+cub+lin"
B7.ViewObject.DrawStyle = "Dashed"

doc.recompute()