Draft: Curva di Bézier

From FreeCAD Documentation
Revision as of 17:20, 25 April 2019 by Renatorivo (talk | contribs)

Curva di Bezier

Posizione nel menu
Draft → Curva di Bézier
Ambiente
Draft, Arch
Avvio veloce
B Z
Introdotto nella versione
0.14
Vedere anche
Polilinea, B-spline

Descrizione

Lo strumento Curva di Bezier crea una Curva di Bezier, o un suo tratto, da più punti. Assume lo spessore e il colore precedentemente impostati nella Barra dei comandi del Vassoio di Draft.

Lo strumento Curva di Bezier utilizza i punti di controllo per definire la direzione della curva; invece lo strumento B-spline specifica i punti esatti attraverso i quali deve passare la curva. Per creare curve circolari o ellittiche esatte, usare Arco e Ellisse.

Curva di Bézier definita da più punti di controllo

Utilizzo

  1. Press the Draft BezCurve button, or press B then Z keys.
  2. Click a first point on the 3D view, or type a coordinate and press the add point button.
  3. Click additional points on the 3D view, or type a coordinate and press the add point button.
  4. Press Esc or the Close button, or double-click the last point to complete the edition.

L'oggetto viene creato come una unica curva di Bezier di grado uguale al numero di punti - 1. Dopo la creazione può essere commutato in tratti di curva di Bezier di determinato grado modificando le proprietà. Le curve di Bezier possono essere modificate utilizzando Modifica.

The curve can be edited by double clicking on the element in the tree view, or by pressing the Draft Edit button. Then you can move the points to a new position, or click add point or remove point and then click on the curve to add or remove points. You can also change the constraint type of each point.

Vincolare i nodi

I punti finali del segmento in un tratto della curva di Bezier possono essere vincolati in modo tale che i punti di controllo adiacenti siano tangenti o simmetrici ai segmenti nel punto finale. Questo viene fatto dopo la creazione dell'oggetto utilizzando Modifica.

  • Sharp - rimuove i vincoli
  • Tangent - forza i punti di controllo adiacenti ad essere tangenti
  • Symmetric - forza i punti di controllo adiacenti ad essere tangenti ed equidistanti

The segment endpoints can be constrained such that adjacent control points are tangent or symmetric to the segments at the endpoint. First, start editing the curve, then pick one of the tools and then pick a point. Click again on the tool to deactivate it, so you can move the point.

  • sharp remove constraints on the points so the curve can have sharp corners.
  • tangent force adjacent control points to be tangent.
  • symmetric force adjacent control points to be tangent and equidistant.

Limitazioni

  • Questo strumento non è disponibile prima della versione 0.14 di FreeCAD
  • Le Proprietà Punti non compaiono ancora nell'elenco delle proprietà.
  • OpenCascade non supporta le curve di Bezier con grado > 25. Nella pratica, questo non dovrebbe essere un problema.
  1. Premere il pulsante Curva di Bezier , oppure premere i tasti B e Z.
  2. Fare clic sul primo punto sulla vista 3D, o digitare le sue coordinate
  3. Cliccare in un altro punto nella vista 3D, o digitare le sue coordinate
  4. Premere F o C, o fare doppio clic sull'ultimo punto, oppure fare clic sul primo punto per completare e chiudere la curva.

Opzioni

  • Premere F o il pulsante Finisci per interrompere la spline lasciandola aperta
  • Premere C o il pulsante Chiudi o fare clic sul primo punto per terminare la spline, ma rendendola chiusa con l'aggiunta di un ultimo segmento tra l'ultimo punto e il primo.
  • Premere X, Y o Z dopo un punto per vincolare il punto successivo sull'asse dato.
  • Per inserire manualmente le coordinate, è sufficiente inserire i valori, quindi premere ENTER per ciascun componente X, Y e Z.
  • Premere R o cliccare nella casella per selezionare o deselezionare il pulsante Relativo. Se la modalità relativa è attivo, le coordinate del punto successivo sono relative all'ultimo. In caso contrario, esse sono assolute, prese dal punto di origine (0,0,0).
  • Premere Template:KEY/it oppure fare clic sulla casella di controllo per selezionare o deselezionare la modalità Template:KEY/it. In modalità Continua, al termine dell'operazione, lo strumento Curva di Bezier si riavvia automaticamente e permette di disegnare una nuova curva senza dover ripetere il comando.
  • Premere Template:KEY/it mentre si disegna per ancorare il proprio punto al punto agganciabile più vicino, indipendentemente dalla distanza.
  • Premere Template:KEY/it mentre si disegna per vincolare orizzontalmente o verticalmente il secondo punto rispetto al primo.
  • Premere Template:KEY/it o il pulsante Template:KEY/it per rimuovere i segmenti esistenti e avviare la spline dall'ultimo punto.
  • Premere Template:KEY/it+Template:KEY/it o premere il pulsante Template:KEY/it per annullare l'ultimo punto inserito. Questa opzione permette di annullare a ritroso tutti i punti.
  • Premere Template:KEY/it o premere il pulsante Template:KEY/it per uscire dal comando Curva di Bezier.

Proprietà

Data

  • DatiDegree: specifies the degree of the Bezier curve or the individual segments.
  • DatiClosed: specifies if the curve is closed or not. If the curve is initially open, this value is false; setting it to true will draw a segment to close the curve. If the curve is initially closed, this value is true; setting it to false will remove the last segment, and make the curve open.
  • DatiMake Face: specifies if the curve 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 DatiClosed is true.
Note: do not set DatiMake Face to true if the curve intersects itself, as it won't create a proper face.
  • DatiContinuity: (read-only) when the curve is closed, indicates the continuity of the curve [0], or [0,0]. Otherwise it's [].

View

  • VistaArrow Size: specifies the size of the symbol displayed at the end of the curve.
  • VistaArrow Type: specifies the type of symbol displayed at the end of the curve, which can be dot, circle, arrow, and tick.
  • VistaEnd Arrow: specifies whether to show a symbol at the last point of the curve, so it can be used as an annotation line.
  • VistaPattern: specifies a Draft Pattern with which to fill the face of the closed curve. This property only works if DatiMake Face is true, and if VistaDisplay Mode is "Flat Lines".
  • VistaPattern Size: specifies the size of the Draft Pattern.

Script

Lo strumento Curva di Bezier può essere utilizzato nelle macro e dalla console di Python tramite la seguente funzione:

BezCurve = makeBezCurve(pointslist, closed=False, placement=None, face=None, support=None, Degree=None)
BezCurve = makeBezCurve(Part.Wire, closed=False, placement=None, face=None, support=None, Degree=None)
  • Crea un oggetto curva di Bezier dalla lista di vettori dati. Invece di un pointslist, si può anche passare una Part Wire.

Example:

import FreeCAD, Draft

p1 = FreeCAD.Vector(0, 0, 0)
p2 = FreeCAD.Vector(1000, 1000, 0)
p3 = FreeCAD.Vector(2000, 0, 0)
p4 = FreeCAD.Vector(1500, -2000, 0)

BezCurve1 = Draft.makeBezCurve([p1, p2, p3, p4], closed=True)
BezCurve2 = Draft.makeBezCurve([p4, 1.3*p2, p1, 4.1*p3], closed=True)
BezCurve3 = Draft.makeBezCurve([1.7*p3, 1.5*p4, 2.1*p2, p1], closed=True)