Macro FCCircularText/de

FC Zirkulärer Text

Beschreibung
Dieses Makro nutzt das Werkzeug Draft Textform, um eine Textzeile zu erstellen, die in verschiedenen kreisförmigen Ausrichtungen platziert werden kann, darunter umlaufend und spiralförmig (ähnlich wie bei der Trajanssäule). Es kann auch verwendet werden, um ein Zifferblatt mit arabischen Ziffern „1, 2, 3“ usw. oder römischen Ziffern „I, II, III“ usw. zu erstellen.

Versionsmakro : 0.22f
Datum der letzten Änderung : 2025/09/23
FreeCAD version : 0.19 und mehr
Herunterladen : Werkzeugleisten-Symbol
Autor: Mario52
Autor
Mario52
Herunterladen
Werkzeugleisten-Symbol
Links
Macro-Version
0.22f
Datum der letzten Änderung
2025/09/23
FreeCAD-Version(s)
0.19 und mehr
Standardverknüpfung
None
Siehe auch
None

Beschreibung

This macro makes use of the Draft ShapeString tool to create a text line placed in different circular orientations, including circumferential and helical in the fashion of a Trajan's Column. It can also be used to create a clock face with Arabic numerals 1, 2, 3, etc., or Roman numerals I, II, III, etc. This latter usage was inspired by the Forum thread Macro to Create Clock Face by FC community member, cblt2l.

Temporary code for external macro link. Do not use this code. This code is used exclusively by Addon Manager. Link for optional manual installation: Macro


# This code is copied instead of the original macro code
# to guide the user to the online download page.
# Use it if the code of the macro is larger than 64 KB and cannot be included in the wiki
# or if the RAW code URL is somewhere else in the wiki.

from PySide import QtGui, QtCore

diag = QtGui.QMessageBox(QtGui.QMessageBox.Information,
    "Information",
    "This macro must be downloaded from this link\n"
    "\n"
    "https://gist.githubusercontent.com/mario52a/a25e802498bae6959335/raw/3a7b030af1395ebe515b7ac7ff399636df55fbc8/Macro_FCCircularText.FCMacro" + "\n"
    "\n"
    "Quit this window to access the download page")

diag.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
diag.setWindowModality(QtCore.Qt.ApplicationModal)
diag.exec_()

import webbrowser 
webbrowser.open("https://gist.githubusercontent.com/mario52a/a25e802498bae6959335/raw/3a7b030af1395ebe515b7ac7ff399636df55fbc8/Macro_FCCircularText.FCMacro")
<class="rawcodeurl"><a href="https://gist.githubusercontent.com/mario52a/a25e802498bae6959335/raw/3a7b030af1395ebe515b7ac7ff399636df55fbc8/Macro_FCCircularText.FCMacro">raw code</a>


360-Grad-Ausrichtung

Beispiel für das Makro, das Text in einer 360-Grad-Ausrichtung anzeigt

Anwendung

Den Makroordner FcString für erstellte Zeichen und eine Datei FcClock für erstellte Uhren starten.

Alle Zeichen sind und bleiben unabhängig. Beim Erstellen von Extrusionen wird nichts gelöscht. Wenn der Verbund mit Run Comp erstellt wird, wird es aus dem Ordner kopiert.

Die Optionen sind standardmäßig ausgegraut und in allen Funktionen aktiv, wenn sie aktiviert sind :

Mit Ausnahme einer Uhr-Serviceplatzierungsbox wird Z aktiviert und verschiebt den Text in Richtung Z, um ihn auf der Auflagefläche zu platzieren.

Hinweise

Schnittstelle

Übersicht

GUI

Erster Abschnitt

  • TextEdit window that lets you copy the text to display (click on the Reset allows to know the number of the input string that is displayed in the window title)
  • The Reverse button reverses the text
  • Word checked, this option consider the text as word, the text is cut on space and write the text word by word (instead character by character in normal use)
  • The Help button displays the wiki page in the FreeCAD browser
  • LineEdit: display the path and name of file font
  • Other button for search the font in other directory in case all directory is not discovery automatically
  • ComboView to choose the font
  • Origin return to origin system font path ex: "C:/Windows/Fonts/"
    • Default ARIAL.TTF

Verfügbare Optionen

Nach der ersten Verwendung müssen die folgenden Parameter geändert werden:

User parameter:BaseApp/Preferences/Macros/FCMmacros/FCCircularText

switchModeTextList

  • 0 = normal text mode (and black) cuts the switchFontComBox
  • 1 = allows switchFontComBox 1

switchFontComBox

  • 0 = (and switchModeTextList= 1) text mode (in color) in ComboBox list, faster
  • 1 = (and switchModeTextList= 1) fontFamily slower but more beautiful ComboBoxst!

setSystemFonts

  • 0 = matplotlib.font_manager.findSystemFonts("C:/", "ttf")
  • do all the fonts (in all folders and sub-folders of the DD) time !!
  • 1 = fontman.findSystemFonts(self.pathFont)
  • do all the fonts in the directory (and in all the sub-folders)

seTtextAlignement

  • 0 = AlignLeft (default)
  • 1 = AlignCenter
  • 2 = AlignRight

setFontByDefault

  • Font by Default

switchResetFALSE

  • 0 = reset (default)
  • 1 = no reset (not recommended) some switches can remain open or close unexpectedly!

Beispiel

  1. switchModeTextList= false
  2. switchFontComBox = false
  3. setSystemFonts = false
  4. seTtextAlignement = 0

  1. switchModeTextList= true
  2. switchFontComBox = false
  3. setSystemFonts = false
  4. seTtextAlignement = 0

  1. switchModeTextList= true
  2. switchFontComBox = false
  3. setSystemFonts = false
  4. seTtextAlignement = 1 (0=Left, 1=Centered, 2=Right)

  1. switchModeTextList= true
  2. switchFontComBox = true
  3. setSystemFonts = false
  4. seTtextAlignement = 1

Zweiter Abschnitt

Konfigurieren von Zeichen in FCCircularText

Erste Zone

Deine Wahl:

  • Mode Stand or Mode Flat : The text will be placed standing or flat (same as clock) options Outdoor and Indoor are reversed.

Zweiter Bereich

In diesem Abschnitt kann man das allgemeine Verhalten der Zeichen in allen verfügbaren Optionen konfigurieren, jedoch mit einigen Abweichungen. Wenn der Befehl in der ausgewählten Option nicht verwendet wird, wird er ausgegraut angezeigt.

  • 10.0 mm Radius of circle : Radius of the circle. (Default 10)
  • 2.0 mm Size character : Character height. (Default 2)
  • 0 deg Begin angle : Starting angle of the first character in the circle. (Default 0 °)
  • 360 deg End angle : Angle end of the last character of the text. (Default 360)
  • 10.0 deg Correction angle : Character correction angle to make it tangent to the circle. (Default 10 °)
  • 0.15 mm Correction radius : Fixed the radius of the circle characters (optional). (Default 0.15)
  • Extrude Char : Checkbox extrusion characters. (Inactive Default)
  • Placement : Text placement in the 3D view. (Inactive Default)
  • Sp. inclination : Inclination of characters in three axes X, Y and Z (example to cover such a cone). (Inactive Default)

Ausserhalb

Standardmodus. Der Text wird an der Außenseite des Kreisumfangs geschrieben.

Innerhalb

Der Text ist auf der Innenseite des Kreisumfangs geschrieben

Helix

Der Text wird auf den Außenumfang einer Helix geschrieben.

  • The helix area is hidden by default. The window is visible if the radio button Helix is checked
  • All characters configuration options are available.
  • Step of helix which corresponds to the pitch of the helix turns and displays 2 (character height) by default.
  • Char. per turn activates and displays 10 by default, which corresponds to 10 characters per helical turn.
  • If Step of helix (helix pitch) is zero, Spinboxes Base Helix and End Helix are activated.
  • Base Helix provides the basis for starting the helix (even Placement Z). If 'Placement Z' is different from zero, the starting point is added to Z Placement
  • End Helix End of the helix pitch of the helix will be calculated relative to the height and the number of characters per helical turn.

Uhr

Die Zahlen sind Teil eines Kreises mit arabischen oder römischen Ziffern.

  • By default, the section is hidden. The window is visible if the radio button Clock is checked
  • When the selection is made, the following functions get dark and are usable:
    1. Begin angle.
    2. End angle.
    3. Correction angle.
    4. Correction radius.
    5. The buttom Mode Stand or Mode Flat.
  • The area Clock is activated.
  • Radius of support : If a value is given, support will be created (default 0).
  • If Support number face is different from zero a support is created. (If Extrude support = zero then a face is created).
    • 1 = A circle is created (circle appears).
    • 2 = A rectangle is created (length = (Radius of media * 1.5) width = Radius of support) (Rectangle appears).
    • 3 = A triangle is created (circumscribed) (Triangle appears).
    • 4 = A square is created (Radius of support) (Square appears).
    • 5 = A polygon with the number of faces displayed (circumscribed) (Polygon appears).
  • Extrude support is activated and an extrusion dimension can be given.

  • If Support number face is equal to zero there is no support.
  • Mode Roman : The writing will be in Roman figures I II III IIII V VI VII VIII IX X XI XII
  • Axial  : The figures will be written axially.

Abschnitt Pfad

Der Titelbereich ändert sich und zeigt die Länge des ausgewählten Drahtes an.

Wenn man einen Linienzug, einen Bogen, einen Kreis, eine Linie und eine Kante auswählen, wird der Abschnitt Pfad in grün und der nicht verwendete Befehl in rot eingefärbt.

  1. Orthogonal Das Zeichen ist orthogonal zur Ansicht.
  2. Tangential Das Zeichen ist tangential zum Punktpfad auf dem Linienzug.
  1. BB Base Der Punktbasis des Charakters soll den Pfad auf dem Linienzug anzeigen.
  2. BB Center Die BounBox-Mitte des Charakters soll den Pfad auf dem Linienzug anzeigen.
  3. BB Top Die obere BoundingBox des Charakters soll den Pfad auf dem Linienzug anzeigen.

Der zuletzt verwendete Radiobutton wird im Parameter von FreeCAD gespeichert.

Abschnitt Befehl

  • Exit  : Leaves the macro.
  • Reset  : Reset all values and displays the number of characters displayed in the window.
  • Run Comp : Launches the macro and creates a Compound object of all characters.
  • Run  : Launches the macro

Verfügbare Parameter

Certain parameter are available in the parameters of FreeCAD see: Menu → Tools → Edit parameters...

    • switchModeTextList :
      • false normal text mode (and black) turns off switchFontComBox
      • true allow switchFontComBox 1 (default)
    • switchFontComBox :
      • false (and switchModeTextList = 1) text mode (in color) in Faster ComboBox list (default)
      • true (and switchModeTextList = 1) font Family in ComboBox list slower but more beautiful!
    • setSystemFonts :
      • false matplotlib.font_manager.findSystemFonts ("C: /", "ttf") do all fonts (in all folders and subfolders of the HD) time !!
      • true fontman.findSystemFonts (self.pathFont)
        make all the fonts in the directory (and in all the subfolders) (default)
    • seTtextAlignement : 0 = AlignLeft (default) 1 = AlignCenter 2 = AlignRight
    • setFontByDefault : Font by Default (the last used)
    • switchResetFALSE : false reset (default), true no reset (not recommended) some switches can stay open or close unexpectedly!
    • setPathOrthogonal : true false
    • setPathTangent : true false
    • setPositionBase : true false
    • setPositionCenter : true false
    • setPositionTop : true false
    • switchVersionSearch : true false
    • Version : FCCircularText version

Den Makroordner FcString für erstellte Zeichen und eine Datei FcClock für erstellte Uhren starten.

Skript

Das Schaltflächen-Symbol:

- als .PNG

- als .SVG

(Siehe Symbolleisten anpassen für mehr)

Skript

Macro_Circular_Text.FCMacro

oder das Skript herunterladen:

- auf GitHub Macro_FCCircularText.FCMacro

- im Forum Extrude from curved surface of cylinder

Beispiel













Beispiel auf Ellipse






Modusentlastung:





Example section path




Einschränkungen

Hinweis Es ist möglich, dass zwischen den Versionen ein Fehler auftritt. Bitte das Problem im Forum melden und auf die aktualisierte Fehlerbehebung oder die Rückkehr zu einer früheren Version des Makros warten. Vielen Dank.

Es ist möglich, dass zwei Zeichen überlappen. Wenn dies passiert, hier ist eine Problemumgehung verfügbar unter Verwendung des Rotate-To-Point Makro.


(nicht vollständig entwickelt)

Geplant:

Schreiben eines kreisförmigen Textes auf einem Pfad des ausgewählten Positionsobjekts.

Änderungsprotokoll

  • ver 0.22d 2024/07/11 : delete "import WebGui" cause error in 0.22xxx FC and replaced by "import webbrowser"
  • ver 0.22c 2023/11/17 : adding restore selection after delete the last object , by TheMarkster , thanks

see Curved text on a flat surface?

sel = Gui.Selection.getCompleteSelection()
#delete objects
#restore previous selection
Gui.Selection.clearSelection()
for s in sel:
    Gui.Selection.addSelection(s.Object,s.SubElementNames)
  • ver 0.22b 2023/11/15 : upgrade correction stylesheet and FreeCAD.activeDocument().recompute(None,True,True)
  • ver 0.21 2022/05/31 : adding button search other path fontmanuelly, and button return font origin of system
  • ver 0.20 2021/04/05 : adding icone in macro, Tab for diminish the heigth of the macro, remove all dimensions of widgets now fully compatible with the stylesheet, revisite the search version for compatibility and other little change.
  • ver 1.19 2021/03/15 : adding button Delette the last object created and the code FreeCAD.ActiveDocument.openTransaction("FCCTc") for Undo/Redo system
    • Adding CheckBox Reset for switched/activated (requested by users) the natural reset after all push button Runand Run comp. This use checkBox is not advised, is you constade one malfunction pusch the Reset button or quit FCCircularText and restart.
  • ver 0.17b 2020/09/28 : correction little bug (pl instead plm in path section) and arrange the window (dimension) Clock, Helix, Path
  • ver 0.17 2020/09/26 : adding create circular text on wire (curve, arc, spline, line ...) selected, mode word

ver 16d 2020/09/15 : see the MasterCATZ commented Sep 14, 2020 message

Den Abschnitt FC 0.18-Test löschen:

#### Test FreeCAD.Version simple ############################################################################################################
if int(FreeCAD.Version()[1]) < 18:      # Version de FreeCAD
    FreeCAD.Console.PrintMessage("This version " + __Title__ + " rmu  work with the FreeCAD 0.18 or higher." + "\n\n")
    FreeCAD.Console.PrintMessage("For the precedent version see the page " + "\n\n")
    FreeCAD.Console.PrintMessage("https://gist.githubusercontent.com/mario52a/a25e802498bae6959335/raw/db47f78f2b20a35137ac213b8d1a62d30f525dcb/Macro_FCCircularText.FCMacro" + "\n\n")
#### Test FreeCAD.Version simple ############################################################################################################
  • ver 0.16 2020/06/07 : little bug in Linux with the path, impost PolicePath = "/usr/share/fonts/" (stay on path /xx/xx/xx/xx/xx/xx/ on entry)
  • ver 0.15 2020/06/01 : For PySide2 Qt5 adding matplotlib fonts in comboView, config on parameter
  • ver 0.14-4 2020/04/25 : corrected for "DisplayMode = u"Flat Lines" :
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20655 (Git)
Build type: Release
Branch: master
Hash: e8e67e8c5ebbc9f9ed9ea67aba5b891969595ece
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
       carDegrees = b' \xc2\xb0'.decode("utf-8")    #thanks wmayer	https://forum.freecad.org/viewtopic.php?f=13&t=36380&p=308476#p308357
       self.DS_InclinaisonX.setSuffix(carDegrees)
       self.DS_InclinaisonY.setSuffix(carDegrees)
       self.DS_InclinaisonZ.setSuffix(carDegrees)
latest testing:

#OS: Windows 10
#Word size of OS: 64-bit
#Word size of FreeCAD: 64-bit
#Version: 0.19.16523 (Git)
#Build type: Release
#Branch: master
#Hash: 9b3ec233c8b21e0df66fada487cd10f471d60cac
#Python version: 3.6.6
#Qt version: 5.6.2
#Coin version: 4.0.0a
#OCC version: 7.3.0
  • ver 0.13 09/08/2016 replace the button "New font" to "fontComboBox" cause , with Windows 10 the window Font stay empty the files are hidden
for angleTr in range(debut,rotation,((rotation-debut)/nombre)):

zu

for angleTrFloat in range((debut*10000),(rotation*10000),int((round(((float(rotation)-float(debut))/float(nombre)),4)*10000)) ):    # pour 4 decimales
                angleTr = (float(angleTrFloat)/10000)
supp.MakeFace = True
            App.activeDocument().recompute()

replace

self.DS_InclinaisonX.setSuffix(" X°")
        self.DS_InclinaisonY.setSuffix(" Y°")
        self.DS_InclinaisonZ.setSuffix(" Z°")

to

self.DS_InclinaisonX.setSuffix(unicode(" X°"))
        self.DS_InclinaisonY.setSuffix(unicode(" Y°"))
        self.DS_InclinaisonZ.setSuffix(unicode(" Z°"))
# ver 0.8 10/05/2015 /_ # testing with OS :
##################################################################################################
# OS: Ubuntu 14.04.1 LTS                          # OS: Ubuntu 14.04.2 LTS
# Platform: 32-bit                                # Word size of OS: 32-bit
# Version: 0.14.2935 (Git)                        # Word size of FreeCAD: 32-bit
# Branch: master                                  # Version: 0.16.4928 (Git)
# Hash: eab159b6ee675012bf79de838c206a311e911d85  # Branch: master
# Python version: 2.7.6                           # Hash: d8f63bcfd10301f3d1e141cced4370f0782238d0
# Qt version: 4.8.6                               # Python version: 2.7.6
# Coin version: 4.0.0a                            # Qt version: 4.8.6
# SoQt version: 1.6.0a                            # Coin version: 4.0.0a
# OCC version: 6.7.0                              # OCC version: 6.8.0.oce-0.17
##################################################################################################
# OS: Windows Vista                               # OS: Windows Vista
# Word size of OS: 32-bit                         # Word size of OS: 32-bit
# Word size of FreeCAD: 32-bit                    # Word size of FreeCAD: 32-bit
# Version: 0.15.4527 (Git)                        # Version: 0.15.4671 (Git)
# Branch: master                                  # Branch: releases/FreeCAD-0-15
# Hash: 0da2e4c45a9a259c26abd54c2a35393e1c15696f  # Hash: 244b3aef360841646cbfe80a1b225c8b39c8380c
# Python version: 2.7.8                           # Python version: 2.7.8
# Qt version: 4.8.6                               # Qt version: 4.8.6
# Coin version: 4.0.0a                            # Coin version: 4.0.0a
# OCC version: 6.7.1                              # OCC version: 6.8.0.oce-0.17
##################################################################################################
  • ver 0.7 02/02/2015 suppression 2 str App.Console.PrintMessage(str(PolicePath)+"\n") to App.Console.PrintMessage((PolicePath)+"\n") that caused an error with the characters above 128 in the police path.
  • ver 0.6 23/11/2014 corrected "texte = unicode(self.textEdit.toPlainText())" now accept "'éèà@..."
  • ver 0.5 19/11/2014 Gui
  • ver 0.4 10/10/2014 add variable "rotation" in the loop (for i in range(0,rotation,(rotation/nombre)): # 360 a parametrer)
  • ver 0.4 27/08/2014 correction error of de radius (exterieur=0, debout=1)
  • ver 0.3 26/08/2014 add creation text of flat curve
  • ver 0.2 26/08/2014 add creation text of internal curve
  • ver 0.1

(2537)

Verweise

Um einen Kommentar abzugeben zuExtrude from curved surface of cylinder