Rysunek Roboczy: Sześcienna krzywa Béziera
Rysunek Roboczy: Sześcienna krzywa Beziera |
Lokalizacja w menu |
---|
Drafting → Bézier tools → Sześcienna krzywa Beziera |
Środowisko pracy |
Rysunek Roboczy, Architektura |
Domyślny skrót |
brak |
Wprowadzono w wersji |
0.19 |
Zobacz także |
Krzywa Bezier'a, Krzywa złożona |
Opis
Polecenie Sześcienna krzywa Beziera tworzy krzywą Béziera trzeciego stopnia (wymagane są cztery punkty).
Krzywa Béziera jest jedną z najczęściej używanych krzywych w grafice komputerowej. Polecenie to pozwala utworzyć ciągły splajn składający się z kilku segmentów Béziera trzeciego stopnia, w sposób podobny do narzędzia Bézier w Inkscape. Ogólną krzywą Béziera dowolnego stopnia można utworzyć za pomocą polecenia Krzywa Bezier'a.
Polecenia Krzywa Bezier'a i Sześcienna krzywa Bezier'a używają punktów kontrolnych do zdefiniowania położenia i krzywizny odcinka krzywej. Z kolei polecenie Krzywa złożona określa dokładne punkty, przez które będzie przechodzić krzywa.
Krzywa Spline składająca się z trzech sześciennych segmentów Béziera. Pierwszy segment jest zdefiniowany przez cztery punkty. Kolejne segmenty wykorzystują ponownie dwa punkty z poprzedniego segmentu, a zatem wymagają tylko dwóch dodatkowych punktów.
Usage
See also: Draft Tray, Draft Snap and Draft Constrain.
- There are several ways to invoke the command:
- Press the Draft CubicBezCurve button.
- Select the Drafting → Bézier tools → Cubic Bézier curve option from the menu.
- The Cubic Bézier curve task panel opens. See Options for more information.
- It is not possible the enter points via the task panel.
- 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.
- Pick the first point in the 3D view and hold the mouse button (1), this is the first endpoint.
- Drag the pointer to another point in the 3D view and release the mouse button (2), this is the first control point.
- Move the pointer to another point in the 3D view, pick this point and hold the mouse button (3), this is the second endpoint.
- 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.
- You now have one Bézier curve of the 3rd degree.
- 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.
- Press Esc or the Close button to finish the command.
Options
See Draft BezCurve.
Notes
- A Draft CubicBezCurve can be edited with the Draft Edit command.
Preferences
See Draft BezCurve.
Properties
See Draft BezCurve.
Scripting
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
or3n
, wheren
is the number of segments, forn >= 1
.
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.
Example:
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()
- Kreślenie: Linia, Polilinia, Zaokrąglenie, Łuk, Łuk przez 3 punkty, Okrąg, Elipsa, Wielokąt foremny, Krzywa złożona, Krzywa Bezier'a, Punkt, Łącznik ścian, Kształt z tekstu, Kreskowanie, Prostokąt
- Adnotacje: Adnotacja wieloliniowa, Wymiarowanie, Etykieta, Edytor stylów adnotacji, Widżet skali anotacji
- Modyfikacja: Przesuń, Obróć, Skala, Odbicie lustrzane, Odsunięcie, Przytnij, Rozciągnij, Klonuj, Szyk, Szyk biegunowy, Szyk kołowy, Szyk po ścieżce, Szyk powiązań po ścieżce, Szyk z punktów, Szyk powiązań w punktach, Edycja, Podświetl element podrzędny, Połącz, Rozdziel, Ulepsz kształt, Rozbij obiekt na elementy, Polilinia na krzywą złożoną, Rysunek Roboczy do szkicu, Nachylenie, Obróć wymiar, Widok 2D kształtu
- Tacka narzędziowa: Wybór płaszczyzny, Ustaw styl, Przełącz tryb konstrukcyjny, Grupowanie automatyczne
- Przyciąganie: Przełącz przyciąganie, Przyciągnij do punktu końcowego, Przyciągnij do punktu środkowego, Przyciągnij do środka, Przyciągnij do kąta, Przyciąganie do punktu przecięcia, Przyciągnij prostopadle, Rozszerz, Przyciągnij równolegle, Przyciągnij specjalnie, Przyciąganie do najbliższego, Przyciągnij ortogonalnie, Przyciągnij do siatki, Przyciągnij do płaszczyzny roboczej, Przyciągnij do wymiaru, Pokaż / ukryj siatkę
- Różności: Zastosuj bieżący styl, Warstwa, Zarządzaj warstwami, Dodaj grupę o nazwie, Dodaj do grupy, Wybierz grupę, Dodaj do grupy konstrukcyjnej, Przełącz tryb wyświetlania, Pośrednia płaszczyzna robocza, Ulecz, Przełącz tryb kontynuacji, Pokaż przybornik przyciągania
- Dodatkowe:: Wiązania, Wypełnienie wzorem, Preferencje, Ustawienia Importu i Eksportu, DXF/DWG, SVG, OCA, DAT
- Menu podręczne:
- Kontener warstwy: Połącz duplikaty warstw, Dodaj warstwę
- Warstwa: Aktywuj warstwę, Zaznacz zawartość warstwy
- Pośrednia płaszczyzna robocza: Zapisz ujęcie widoku, Zapisz stan obiektów
- Jak zacząć
- Instalacja: Pobieranie programu, Windows, Linux, Mac, Dodatkowych komponentów, Docker, AppImage, Ubuntu Snap
- Podstawy: Informacje na temat FreeCAD, Interfejs użytkownika, Profil nawigacji myszką, Metody wyboru, Nazwa obiektu, Edytor ustawień, Środowiska pracy, Struktura dokumentu, Właściwości, Pomóż w rozwoju FreeCAD, Dotacje
- Pomoc: Poradniki, Wideo poradniki
- Środowiska pracy: Strona Startowa, Architektura, Assembly, CAM, Rysunek Roboczy, MES, Inspekcja, Siatka, OpenSCAD, Część, Projekt Części, Punkty, Inżynieria Wsteczna, Robot, Szkicownik, Arkusz Kalkulacyjny, Powierzchnia 3D, Rysunek Techniczny, Test Framework