Rysunek Roboczy: Kształt z tekstu
Draft ShapeString |
Lokalizacja w menu |
---|
Draft → Shape from text ... |
Środowisko pracy |
Draft, Arch |
Domyślny skrót |
S S |
Wprowadzono w wersji |
0.14 |
Zobacz także |
Draft Text, Part Extrude, Macro Fonts Win10 PYMP |
Description
The Draft ShapeString tool inserts a compound shape that represents a text string. Text height, tracking and font can be specified. The resulting shape can be used with the Part Extrude tool to create 3D letters.
Alternatively: To insert a simpler text element without a closed shape use Draft Text. To create a text label with a lead and an arrow use Draft Label.
Single point required to position the Shapestring
Usage
If your Draft interface mode is set to ToolBar:
- Press the Draft ShapeString button, or press S then S keys.
- Click a point on the 3D view, or type a coordinate and press the add point button.
- Enter the desired text, and press Enter.
- Enter the desired size, and press Enter.
- Enter the desired tracking, and press Enter.
- Press Enter to accept the displayed font file, or press ... to select a font file.
If your Draft interface mode is set to TaskView:
- Press the Draft ShapeString button, or press S then S keys.
- A dialog will appear where you can specify your parameters.
- Press OK to create the ShapeString.
- The text, size, tracking, and font can be changed after creation, by modifying the values in the Property Editor.
- You will want to set the default font file in Draft Preferences, in the Texts and dimensions tab. This will prefill the font file box in the dialog.
- Supported fonts include TrueType (.ttf), OpenType (.otf), and Type 1 (.pfb).
Limitations
- Very small text heights may result in deformed character shapes due to loss of detail in scaling.
- The current version is limited to left-to-right writing.
- To create text arranged in a circular fashion use the Circular Text macro.
Options
- To enter coordinates manually, simply enter the numbers, then press Enter between each X, Y and Z component. You can press the add point button when you have the desired values to insert the point.
- Press Esc or the Close button to abort the current command.
Properties
- DANEPosition: specifies the position of the base point of the compound shape.
- DANEAngle: specifies the rotation of the baseline of the shape.
- DANEAxis: specifies the axis to use for the rotation.
- DANEString: specifies the text string to display; unlike the Draft Text tool, the Draft ShapeString can only display a single line.
- DANESize: specifies the general height of the letters.
- DANETracking: specifies the additional inter-character spacing in the string.
- DANEFont File: specifies the full path of the font file used to draw the string.
Scripting
See also: Draft API and FreeCAD Scripting Basics.
The ShapeString tool can be used in macros and from the Python console by using the following function:
ShapeString = makeShapeString(String, FontFile, Size=100, Tracking=0)
- Creates a
ShapeString
compound shape using the specifiedString
and the full path of a supportedFontFile
. Size
is the height of the resulting text in millimeters.Tracking
is the additional inter-character spacing in millimeters.
The placement of the ShapeString can be changed by overwriting its Placement
attribute, or by individually overwriting its Placement.Base
and Placement.Rotation
attributes.
Example:
import FreeCAD as App
import Draft
doc = App.newDocument()
font1 = "/usr/share/fonts/truetype/msttcorefonts/Arial.ttf"
font2 = "/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf"
font3 = "/usr/share/fonts/truetype/freefont/FreeSerifItalic.ttf"
S1 = Draft.makeShapeString("This is a sample text", font1, 200)
S2 = Draft.makeShapeString("Inclined text", font2, 200, 10)
ZAxis = App.Vector(0, 0, 1)
p2 = App.Vector(-1000, 500, 0)
place2 = App.Placement(p2, App.Rotation(ZAxis, 45))
S2.Placement = place2
S3 = Draft.makeShapeString("Upside-down text", font3, 200, 10)
S3.Placement.Base = App.Vector(0, -1000, 0)
S3.Placement.Rotation = App.Rotation(ZAxis, 180)
doc.recompute()
Tutorials
- Draft ShapeString tutorial: extrude a ShapeString, position it in 3D space, and create an engraving in another body.
- How to use ShapeStrings in PartDesign
Notes
- Many fonts will generate problematic geometric. This is because font contours are allowed to overlap, have small gaps and have varying directions within a glyph. These conditions are considered errors in the Wires used to define Faces. Options are to correct the font definition with a tool like FontForge or to use another font.
- 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, Złożenie, BIM, 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