Draft BSpline/es: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 1: Line 1:
<languages/>
<languages/>

{{Docnav
{{Docnav
|[[Draft_Polygon|Polygon]]
|[[Draft_Dimension|Dimension]]
|[[Draft_CubicBezCurve|CubicBezCurve]]
|[[Draft_Point|Point]]
|[[Draft_Module|Draft]]
|[[Draft_Module|Draft]]
|IconL=Draft_Dimension.svg
|IconL=Draft_Polygon.svg
|IconR=Draft_Point.svg
|IconR=Draft_CubicBezCurve.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
}}
}}
Line 21: Line 22:
</div>
</div>


The Draft BSpline command specifies the {{Emphasis|exact points}} through which the curve will pass. The [[Draft BezCurve|Draft BezCurve]] and the [[Draft_CubicBezCurve|Draft CubicBezCurve]] commands, on the other hand, use {{Emphasis|control points}} to define the position and curvature of the spline.
The BSpline tool behaves like the {{Button|[[File:Draft_Wire.svg|16px]] [[Draft_Wire|Wire]]}} tool, except that each of its segments is curved instead of being a straight line. Use {{Button|[[File:Draft_WireToBSpline.svg|16px]] [[Draft_WireToBSpline|Wire to B-spline]]}} to convert one to the other.

The BSpline tool specifies the exact points through which the curve will go; on the other hand the {{Button|[[File:Draft_BezCurve.svg|16px]] [[Draft_BezCurve|Bezier curve]]}} tool uses {{Emphasis|control points}} to define the direction of the curve. To create exact circular or elliptical curves, use {{Button|[[File:Draft_Arc.svg|16px]] [[Draft_Arc|Arc]]}} and {{Button|[[File:Draft_Ellipse.svg|16px]] [[Draft_Ellipse|Ellipse]]}}.


[[Image:Draft_bspline_example.jpg|400px]]
[[Image:Draft_bspline_example.jpg|400px]]
Line 30: Line 29:
</div>
</div>


==Usage==
==Usage==

See also: [[Draft_Tray|Draft Tray]], [[Draft_Snap|Draft Snap]] and [[Draft_Constrain|Draft Constrain]].


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 41: Line 42:
</div>
</div>


==Options==
The spline can be edited by double clicking on the element in the tree view, or by pressing the {{Button|[[Image:Draft_Edit.svg|16px]] [[Draft Edit|Draft Edit]]}} button. Then you can move the points to a new position, or click {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} or {{Button|[[Image:Draft_DelPoint.svg|16px]] [[Draft_DelPoint|remove point]]}} and then click on the wire to add or remove points.

The single character keyboard shortcuts available in the task panel can be changed. See [[Draft_Preferences|Draft Preferences]]. The shortcuts mentioned here are the default shortcuts.


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 59: Line 62:
* Presiona {{KEY|ESC}} o el botón {{KEY|'''Cancelar'''}} para abortar el comando BSpline actual.
* Presiona {{KEY|ESC}} o el botón {{KEY|'''Cancelar'''}} para abortar el comando BSpline actual.
</div>
</div>

==Notes==

* A Draft BSpline can be edited with the [[Draft_Edit|Draft Edit]] command.
* A Draft BSpline can be converted to a [[Draft_Wire|Draft Wire]] with the [[Draft_WireToBSpline|Draft WireToBSpline]] command.


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 67: Line 75:
</div>
</div>


See also: [[property_editor|Property editor]].
A BSpline object shares most properties from a [[Draft Wire|Draft Wire]], however, most properties only make sense for a Wire.

A Draft BSpline object is derived from a [[Part_Part2DObject|Part Part2DObject]] and inherits all its properties. It also has the following additional properties:


=== Data ===
=== Data ===

* {{PropertyData|Closed}}: specifies if the spline is closed or not. If the spline is initially open, this value is {{FALSE}}; setting it to {{TRUE}} will draw a curve segment to close the spline. If the spline is initially closed, this value is {{TRUE}}; setting it to {{FALSE}} will remove the last curve segment, and make the spline open.
* {{PropertyData|Make Face}}: specifies if the spline makes a face or not. If it is {{TRUE}} a face is created, otherwise only the perimeter is considered part of the object. This property only works if {{PropertyData|Closed}} is {{TRUE}}.
* {{PropertyData|Area|Area}}: (read-only) specifies the area of the face of the spline. The value will be {{value|0.0}} if {{PropertyData|Make Face}} if {{FALSE}} or the face cannot be created.
* {{PropertyData|Closed|Bool}}: specifies if the spline is closed or not. If the spline is initially open this value is {{FALSE}}, setting it to {{TRUE}} will draw a curve segment to close the spline. If the spline is initially closed this value is {{TRUE}}, setting it to {{FALSE}} will remove the last curve segment and make the spline open.
:{{Emphasis|Note:}} do not set {{PropertyData|Make Face}} to {{TRUE}} if the spline intersects itself, as it won't create a proper face.
* {{PropertyData|Make Face|Bool}}: specifies if the spline makes a face or not. If it is {{TRUE}} a face is created, otherwise only the perimeter is considered part of the object. This property only works if {{PropertyData|Closed}} is {{TRUE}} and if the spline does not self-intersect.
* {{PropertyData|Parameterization}}: affects the shape of the BSpline.
* {{PropertyData|Parameterization|Float}}: affects the shape of the spline.
* {{PropertyData|Points|VectorList}}: specifies the points of the spline in its local coordinate system.


=== View ===
=== View ===

* {{PropertyView|Arrow Size}}: specifies the size of the symbol displayed at the end of the spline.
* {{PropertyView|Arrow Type}}: specifies the type of symbol displayed at the end of the spline, which can be "Dot", "Circle", "Arrow", or "Tick".
* {{PropertyView|Arrow Size|Length}}: specifies the size of the symbol displayed at the end of the spline.
* {{PropertyView|End Arrow}}: specifies whether to show a symbol at the last point of the spline, so it can be used as an annotation line.
* {{PropertyView|Arrow Type|Enumeration}}: specifies the type of symbol displayed at the end of the spline, which can be {{value|Dot}}, {{value|Circle}}, {{value|Arrow}}, {{value|Tick}} or {{value|Tick-2}}.
* {{PropertyView|Pattern}}: specifies a [[Draft Pattern|Draft Pattern]] with which to fill the face of a closed spline. This property only works if {{PropertyData|Make Face}} is {{TRUE}}, and if {{PropertyView|Display Mode}} is "Flat Lines".
* {{PropertyView|End Arrow|Bool}}: specifies whether to show a symbol at the end of the spline, so it can be used as an annotation line.
* {{PropertyView|Pattern Size}}: specifies the size of the [[Draft Pattern|Draft Pattern]].
* {{PropertyView|Pattern|Enumeration}}: specifies the [[Draft_Pattern|Draft Pattern]] with which to fill the face of the closed spline. This property only works if {{PropertyData|Make Face}} is {{TRUE}} and if {{PropertyView|Display Mode}} is {{value|Flat Lines}}.
* {{PropertyView|Pattern Size|Float}}: specifies the size of the [[Draft_Pattern|Draft Pattern]].

==Scripting==


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 88: Line 103:
</div>
</div>


To create a Draft BSpline use the {{incode|make_bspline}} method ({{Version|0.19}}) of the Draft module. This method replaces the deprecated {{incode|makeBSpline}} method.
The BSpline tool can be used in [[macros|macros]] and from the [[Python|Python]] console by using the following function:


{{Code|code=
{{Code|code=
BSpline = make_bspline(pointslist, closed=False, placement=None, face=None, support=None)
bspline = make_bspline(pointslist, closed=False, placement=None, face=None, support=None)
BSpline = make_bspline(Part.Wire, closed=False, placement=None, face=None, support=None)
bspline = make_bspline(Part.Wire, closed=False, placement=None, face=None, support=None)
}}
}}


Line 102: Line 117:
* Devuelve el objeto recién creado.
* Devuelve el objeto recién creado.
</div>
</div>



<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 121: Line 135:
spline2 = Draft.make_bspline([p1, 2*p3, 1.3*p2], closed=False)
spline2 = Draft.make_bspline([p1, 2*p3, 1.3*p2], closed=False)
spline3 = Draft.make_bspline([1.3*p3, p1, -1.7*p2], closed=False)
spline3 = Draft.make_bspline([1.3*p3, p1, -1.7*p2], closed=False)

doc.recompute()
doc.recompute()
}}
}}


<u>Note:</u> <br>
The command {{incode|Draft.make_bspline}} has been created for the newer version 0.19, and is not backward compatible. <br>
The command {{incode|Draft.makeBSpline}} works on both version 0.18 and 0.19.


{{Docnav
{{Docnav
|[[Draft_Polygon|Polygon]]
|[[Draft_Dimension|Dimension]]
|[[Draft_CubicBezCurve|CubicBezCurve]]
|[[Draft_Point|Point]]
|[[Draft_Module|Draft]]
|[[Draft_Module|Draft]]
|IconL=Draft_Dimension.svg
|IconL=Draft_Polygon.svg
|IconR=Draft_Point.svg
|IconR=Draft_CubicBezCurve.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
}}
}}
Line 139: Line 151:
{{Draft Tools navi{{#translation:}}}}
{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Revision as of 11:20, 4 May 2021

Draft BSpline

Ubicación en el Menú
Croquis → BSpline
Entornos de trabajo
Croquis, Arquitectura
Atajo de teclado por defecto
B S
Introducido en versión
-
Ver también
Contorno

Description

Descripción

La herramienta BSpline crea una curva B-Spline a partir de varios puntos en el plano de trabajo actual. Toma el espesor de línea y color previamente establecidos en la pestaña de tareas. La herramienta BSpline se comporta exactamente como la herramienta Contorno.

The Draft BSpline command specifies the exact points through which the curve will pass. The Draft BezCurve and the Draft CubicBezCurve commands, on the other hand, use control points to define the position and curvature of the spline.

Usage

See also: Draft Tray, Draft Snap and Draft Constrain.

Utilización

  1. Presiona el botón BSpline, o presiona las teclas B y S
  2. Designa un primer punto en la vista 3D, o escribe unas coordenadas
  3. Designa un punto adicional en la vista 3D, o escribe unas coordenadas
  4. Presiona F o C, o haz doble clic en el último punto, o clic en el primer punto para terminar o cerrar la BSpline. Si la spline está cerrada, será también una cara, incluso aunque se muestre en estructura alámbrica.

Options

The single character keyboard shortcuts available in the task panel can be changed. See Draft Preferences. The shortcuts mentioned here are the default shortcuts.

Opciones

  • Presiona F o el botón Terminar para terminar la spline, dejándola abierta
  • Presiona C o el botón Cerrar o designa el primer punto para finalizar la spline, pero haciendo que se cierre añadiendo un último segmento entre el último punto y el primero.
  • Presiona X, Y o Z después de un punto para restringir el punto siguiente sobre el eje dado.
  • Para introducir coordenadas manualmente, simplemente introduce los números y presiona ENTER entre cada componente X, Y y Z.
  • Presiona R o selecciona la casilla para activar/desactivar el botón Relativas. Si el modo relativas está activado, las coordenadas del siguiente punto son relativas al anterior. Si no, son absolutas, desde el origen de coordenadas (0,0,0).
  • Presiona T o selecciona la casilla para activar/desactivar el botón Continuar. Si el modo continuar está activado, la herramienta BSpline se reiniciará después de terminar, permitiendo que dibujes otra sin necesidad de volver a pulsar el botón de BSpline.
  • Presiona CTRL mientras dibujas para forzar el ajuste de tu punto a la ubicación de ajuste más cercana, independientemente de la distancia.
  • Presiona SHIFT mientras dibujas para restringir tu siguiente punto horizontal o verticalmente en relación al último.
  • Presiona W o el botón Limpiar para eliminar segmentos existentes e iniciar la spline desde el último punto.
  • Presiona CTRL+Z o el botón Deshacer para deshacer el último punto.
  • Presiona I o el botón Rellenado para que la spline se muestre como una cara después de cerrarse. Esto simplemente establece las propiedades de visualización del contorno como "líneas planas" o "alámbrica", de modo que se puedan cambiar de forma sencilla después.
  • Presiona ESC o el botón Cancelar para abortar el comando BSpline actual.

Notes

Propiedades

  • DatosClosed: Especifica si la spline está cerrada o no
  • VistaEnd Arrow: Muestra un símbolo de flecha en el último punto de la spline, de modo que se puede utilizar como una anotación con línea directriz

See also: Property editor.

A Draft BSpline object is derived from a Part Part2DObject and inherits all its properties. It also has the following additional properties:

Data

  • DatosArea (Area): (read-only) specifies the area of the face of the spline. The value will be 0.0 if DatosMake Face if false or the face cannot be created.
  • DatosClosed (Bool): specifies if the spline is closed or not. If the spline is initially open this value is false, setting it to true will draw a curve segment to close the spline. If the spline is initially closed this value is true, setting it to false will remove the last curve segment and make the spline open.
  • DatosMake Face (Bool): specifies if the spline makes a face or not. If it is true a face is created, otherwise only the perimeter is considered part of the object. This property only works if DatosClosed is true and if the spline does not self-intersect.
  • DatosParameterization (Float): affects the shape of the spline.
  • DatosPoints (VectorList): specifies the points of the spline in its local coordinate system.

View

  • VistaArrow Size (Length): specifies the size of the symbol displayed at the end of the spline.
  • VistaArrow Type (Enumeration): specifies the type of symbol displayed at the end of the spline, which can be Dot, Circle, Arrow, Tick or Tick-2.
  • VistaEnd Arrow (Bool): specifies whether to show a symbol at the end of the spline, so it can be used as an annotation line.
  • VistaPattern (Enumeration): specifies the Draft Pattern with which to fill the face of the closed spline. This property only works if DatosMake Face is true and if VistaDisplay Mode is Flat Lines.
  • VistaPattern Size (Float): specifies the size of the Draft Pattern.

Scripting

Archivos de guión

La herramienta BSpline puede utilizarse en macros y desde la consola de Python utilizando la siguiente función:

To create a Draft BSpline use the make_bspline method (introduced in version 0.19) of the Draft module. This method replaces the deprecated makeBSpline method.

bspline = make_bspline(pointslist, closed=False, placement=None, face=None, support=None)
bspline = make_bspline(Part.Wire, closed=False, placement=None, face=None, support=None)
  • Crea un objeto B-Spline a partir de la lista de vectores dada.
  • Si closed es True o si el primer y último punto son idénticos, el contorno es cerrado.
  • Si face es true (y la BSpline está cerrada), la BSpline se mostrará rellena.
  • En lugar de una lista de puntos, también puedes pasar un contorno de pieza.
  • Devuelve el objeto recién creado.

Ejemplo:

import FreeCAD as App
import Draft

doc = App.newDocument()

p1 = App.Vector(0, 0, 0)
p2 = App.Vector(1000, 1000, 0)
p3 = App.Vector(2000, 0, 0)

spline1 = Draft.make_bspline([p1, p2, p3], closed=False)
spline2 = Draft.make_bspline([p1, 2*p3, 1.3*p2], closed=False)
spline3 = Draft.make_bspline([1.3*p3, p1, -1.7*p2], closed=False)

doc.recompute()